[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221110031311.1629288-1-linmq006@gmail.com>
Date: Thu, 10 Nov 2022 07:13:10 +0400
From: Miaoqian Lin <linmq006@...il.com>
To: Xiubo Li <xiubli@...hat.com>, Ilya Dryomov <idryomov@...il.com>,
Jeff Layton <jlayton@...nel.org>, ceph-devel@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: linmq006@...il.com
Subject: [PATCH] ceph: Fix NULL vs IS_ERR checking in ceph_getattr
The ceph_lookup_inode() function return error pointers on error
instead of NULL.
Use IS_ERR() to check the return value to fix this.
Fixes: aa87052dd965 ("ceph: fix incorrectly showing the .snap size for stat")
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
fs/ceph/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
2.37.3.671.ge2130fe6da78.dirty
Powered by blists - more mailing lists