Re: [RFC PATCH] ceph: fix cap revoke race

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

 



On Wed, 2019-11-27 at 05:45 -0500, xiubli@xxxxxxxxxx wrote:
> 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;
>  }

Nice catch. This patch looks correct to me. I'll merge it into the
testing branch and we'll see if anything breaks.
-- 
Jeff Layton <jlayton@xxxxxxxxxx>




[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