Skip to content

Commit f86a486

Browse files
Dan Carpenteridryomov
authored andcommitted
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: aa87052 ("ceph: fix incorrectly showing the .snap size for stat") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Reviewed-by: Xiubo Li <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 3a4e894 commit f86a486

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ceph/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2492,7 +2492,7 @@ int ceph_getattr(struct user_namespace *mnt_userns, const struct path *path,
24922492
struct inode *parent;
24932493

24942494
parent = ceph_lookup_inode(sb, ceph_ino(inode));
2495-
if (!parent)
2495+
if (IS_ERR(parent))
24962496
return PTR_ERR(parent);
24972497

24982498
pci = ceph_inode(parent);

0 commit comments

Comments
 (0)