ceph: fix up error handling with snapdirs
authorJeff Layton <jlayton@kernel.org>
Thu, 25 Feb 2021 20:04:15 +0000 (15:04 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 8 Mar 2021 15:19:36 +0000 (10:19 -0500)
commit3e10a15ffc8d77f05e655d14fd48c0b790dede35
treea17d57ad4dea11482c47292192fa89c548dcf2fd
parent6e3e2c4362e41a2f18e3f7a5ad81bd2f49a47b85
ceph: fix up error handling with snapdirs

There are several warts in the snapdir error handling. The -EOPNOTSUPP
return in __snapfh_to_dentry is currently lost, and the call to
ceph_handle_snapdir is not currently checked at all.

Fix all of this up and eliminate a BUG_ON in ceph_get_snapdir. We can
handle that case with a warning and return an error.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ceph/dir.c
fs/ceph/export.c
fs/ceph/inode.c