ceph: remove redundant Lsx caps check
PATCH 1/1 ceph: remove redundant Lsx caps check
From: Xiubo Li <[email protected]>
The newcaps has already included the Ls, no need to check it again.
Signed-off-by Xiubo Li <[email protected]>
--- fs/ceph/caps.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/ceph/caps.c +1 -2
@@ -3451,8 +3451,7 @@ static void handle_cap_grant(struct inode *inode,if ((newcaps &CEPH_CAP_LINK_SHARED ) && (extra_info->issued &CEPH_CAP_LINK_EXCL ) ==0 ) {set_nlink (inode,le32_to_cpu (grant->nlink)); -if (inode->i_nlink ==0 && - (newcaps & (CEPH_CAP_LINK_SHARED |CEPH_CAP_LINK_EXCL ))) +if (inode->i_nlink ==0 ) deleted_inode = true; }
Signature · 1 line
2.27.0
Quoted 14 lines · On Thu, 2022-01-06 at 09:35 +0800, [email protected] wrote:
From: Xiubo Li <[email protected]>
The newcaps has already included the Ls, no need to check it again.
Signed-off-by Xiubo Li <[email protected]>--- fs/ceph/caps.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)fs/ceph/caps.c +0
-0
fs/ceph/caps.c static void handle_cap_grant(struct inode *inode, · line 3457
Quoted 9 lines
fs/ceph/caps.c +1
-2@@ -3451,8 +3451,7 @@ static void handle_cap_grant(struct inode *inode,if ((newcaps &CEPH_CAP_LINK_SHARED ) && (extra_info->issued &CEPH_CAP_LINK_EXCL ) ==0 ) {set_nlink (inode,le32_to_cpu (grant->nlink)); -if (inode->i_nlink ==0 && - (newcaps & (CEPH_CAP_LINK_SHARED |CEPH_CAP_LINK_EXCL ))) +if (inode->i_nlink ==0 ) deleted_inode = true; }
Good catch. Merged into testing branch. It should make v5.17.
Thanks!
Signature · 1 line
Jeff Layton <[email protected]>