Blob Blame History Raw
From: Xiubo Li <xiubli@redhat.com>
Date: Thu, 6 Jan 2022 09:35:52 +0800
Subject: ceph: remove redundant Lsx caps check
Git-commit: 76bdbc7ac777adb6bc316bfe3f57b3de93c50985
Patch-mainline: v5.17-rc1
References: jsc#SES-1880

The newcaps has already included the Ls, no need to check it again.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Acked-by: Luis Henriques <lhenriques@suse.com>
---
 fs/ceph/caps.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index c447fa2e2d1f..62448691608f 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -3375,8 +3375,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;
 	}