Re: [PATCH 5/6] ceph: check mds_wanted for imported cap

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

 



On Fri, 4 Jan 2013, Yan, Zheng wrote:
> From: "Yan, Zheng" <zheng.z.yan@xxxxxxxxx>
> 
> The MDS may have incorrect wanted caps after importing caps. So the
> client should check the value mds has and send cap update if necessary.
> 
> Signed-off-by: Yan, Zheng <zheng.z.yan@xxxxxxxxx>
> ---
>  fs/ceph/caps.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
> index 7e90299..16c10f8 100644
> --- a/fs/ceph/caps.c
> +++ b/fs/ceph/caps.c
> @@ -2425,10 +2425,12 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant,
>  	     ceph_cap_string(used),
>  	     ceph_cap_string(dirty));
>  	if (wanted != le32_to_cpu(grant->wanted)) {
> -		dout("mds wanted %s -> %s\n",
> -		     ceph_cap_string(le32_to_cpu(grant->wanted)),
> -		     ceph_cap_string(wanted));
> -		grant->wanted = cpu_to_le32(wanted);

Doh, this was a holdover from when we used to re-use the incoming message 
and send it back out over the wire.

> +		dout("mds wanted = %s\n",
> +		     ceph_cap_string(le32_to_cpu(grant->wanted)));

Any reason to drop the "old -> new" output?

> +		/* imported cap may not have correct mds_wanted */
> +		if (cap == ci->i_auth_cap &&
> +		    (wanted & ~(cap->mds_wanted | cap->issued)))
> +			check_caps = 1;

I think we want

		if (cap == ci->i_auth_cap)
			check_caps = 1;

If we want more caps, check_caps will request immediately.  If we have 
extra, we'll put the cap on the delay list.

sage


>  	}
>  
>  	cap->seq = seq;
> -- 
> 1.7.11.7
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux