diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-10-14 12:36:53 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2022-11-14 10:29:05 +0100 |
commit | f86a48667b91202d502d753c707e8576a6fe265b (patch) | |
tree | b2055ebf8d037e5349dc5e13f00a80c2590ec2e1 /fs | |
parent | 3a4e894f36f95c63048298aaefee6e3e1a7f6a68 (diff) |
ceph: fix a NULL vs IS_ERR() check when calling ceph_lookup_inode()
The ceph_lookup_inode() function returns error pointers. It never
returns NULL.
Fixes: aa87052dd965 ("ceph: fix incorrectly showing the .snap size for stat")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 4af5e55abc15..bad9eeb6a1a5 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -2492,7 +2492,7 @@ int ceph_getattr(struct user_namespace *mnt_userns, const struct path *path, struct inode *parent; parent = ceph_lookup_inode(sb, ceph_ino(inode)); - if (!parent) + if (IS_ERR(parent)) return PTR_ERR(parent); pci = ceph_inode(parent); |