[RFC PATCH] ceph: fix cap revoke race

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Xiubo Li <xiubli@xxxxxxxxxx>

The cap->implemented is one subset of the cap->issued, the logic
here want to exclude the revoking caps, but the following code
will be (~cap->implemented | cap->issued) == 0xFFFF, so it will
make no sense when we doing the "have &= 0xFFFF".

Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx>
---
 fs/ceph/caps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index c62e88da4fee..a9335402c2a5 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -812,7 +812,7 @@ int __ceph_caps_issued(struct ceph_inode_info *ci, int *implemented)
 	 */
 	if (ci->i_auth_cap) {
 		cap = ci->i_auth_cap;
-		have &= ~cap->implemented | cap->issued;
+		have &= ~(cap->implemented & ~cap->issued);
 	}
 	return have;
 }
-- 
2.21.0





[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux