Skip to contentSkip to conversation

ceph: remove redundant Lsx caps check

PATCH In review [email protected] 2 participants 2 messages Jan 6, 2022 Ceph client

lore
Share & tools
lore
#0 lore raw

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.

---
 fs/ceph/caps.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/ceph/caps.c +1 -2
index 1f1a1c6987ce..d68f04ec147d 100644
@@ -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
#1 lore raw
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.

---
 fs/ceph/caps.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/ceph/caps.c +0 -0
index 1f1a1c6987ce..d68f04ec147d 100644

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]>