summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLuís Henriques <lhenriques@suse.de>2023-09-08 13:20:20 +0200
committerIlya Dryomov <idryomov@gmail.com>2023-09-18 12:04:50 +0200
commit2816a09678f50fc6a69e742e90cb1fd7a9f1f9ff (patch)
treea6ee8c15c90a966b9f6c5e7d0a5199cc5880e8d2 /fs
parentLinux 6.6-rc2 (diff)
downloadlinux-2816a09678f50fc6a69e742e90cb1fd7a9f1f9ff.tar.xz
linux-2816a09678f50fc6a69e742e90cb1fd7a9f1f9ff.zip
ceph: remove unnecessary check for NULL in parse_longname()
Function ceph_get_inode() never returns NULL; instead it returns an ERR_PTR() if something fails. Thus, the check for NULL in parse_longname() is useless and can be dropped. Instead, move there the debug code that does the error checking so that it's only executed if ceph_get_inode() is called. Fixes: dd66df0053ef ("ceph: add support for encrypted snapshot names") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Luís Henriques <lhenriques@suse.de> Reviewed-by: Xiubo Li <xiubli@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/crypto.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ceph/crypto.c b/fs/ceph/crypto.c
index e4d5cd56a80b..e1f31b86fd48 100644
--- a/fs/ceph/crypto.c
+++ b/fs/ceph/crypto.c
@@ -249,11 +249,9 @@ static struct inode *parse_longname(const struct inode *parent,
if (!dir) {
/* This can happen if we're not mounting cephfs on the root */
dir = ceph_get_inode(parent->i_sb, vino, NULL);
- if (!dir)
- dir = ERR_PTR(-ENOENT);
+ if (IS_ERR(dir))
+ dout("Can't find inode %s (%s)\n", inode_number, name);
}
- if (IS_ERR(dir))
- dout("Can't find inode %s (%s)\n", inode_number, name);
out:
kfree(inode_number);