ceph: fix a NULL vs IS_ERR() check
Subsystems (2)
PATCH 1/1 ceph: fix a NULL vs IS_ERR() check
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 <[email protected]>
--- fs/ceph/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/inode.c +1 -1
@@ -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);
Signature · 1 line
2.35.1
Quoted 14 lines · Dan Carpenter
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 <[email protected]>--- fs/ceph/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ceph/inode.c +0
-0
fs/ceph/inode.c int ceph_getattr(struct user_namespace *mnt_userns, const struct path *path, · line 2498
Quoted 8 lines
fs/ceph/inode.c +1
-1@@ -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);
Reviewed-by Jeff Layton <[email protected]>
Quoted 14 lines · Dan Carpenter
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 <[email protected]>--- fs/ceph/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ceph/inode.c +0
-0
fs/ceph/inode.c int ceph_getattr(struct user_namespace *mnt_userns, const struct path *path, · line 2498
Quoted 8 lines
fs/ceph/inode.c +1
-1@@ -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);
Good catch!
Will merge it to the testing branch soon.
Thanks Dan.
- Xiubo