CEPH filesystem development
 help / color / mirror / Atom feed
From: "Yan, Zheng" <zheng.z.yan@intel.com>
To: ceph-devel@vger.kernel.org
Cc: sage@inktank.com, alex.elder@linaro.org
Subject: Re: [PATCH 2/3] mds: fix cap revoke race
Date: Mon, 24 Jun 2013 16:19:52 +0800	[thread overview]
Message-ID: <51C80128.6070408@intel.com> (raw)
In-Reply-To: <1372056089-11603-2-git-send-email-zheng.z.yan@intel.com>

This patch's title is wrong, please ignore it.

Thanks
Yan, Zheng

On 06/24/2013 02:41 PM, Yan, Zheng wrote:
> From: "Yan, Zheng" <zheng.z.yan@intel.com>
> 
> If caps are been revoking by the auth MDS, don't consider them as
> issued even they are still issued by non-auth MDS. The non-auth
> MDS should also be revoking/exporting these caps, the client just
> hasn't received the cap revoke/export message.
> 
> The race I encountered is: When caps are exporting to new MDS, the
> client receives cap import message and cap revoke message from the
> new MDS, then receives cap export message from the old MDS. When
> the client receives cap revoke message from the new MDS, the revoking
> caps are still issued by the old MDS, so the client does nothing.
> Later when the cap export message is received, the client removes
> the caps issued by the old MDS. (Another way to fix the race is
> calling ceph_check_caps() in handle_cap_export())
> 
> Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
> ---
>  fs/ceph/caps.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
> index 9a5ccc9..a8c616b 100644
> --- a/fs/ceph/caps.c
> +++ b/fs/ceph/caps.c
> @@ -697,6 +697,15 @@ int __ceph_caps_issued(struct ceph_inode_info *ci, int *implemented)
>  		if (implemented)
>  			*implemented |= cap->implemented;
>  	}
> +	/*
> +	 * exclude caps issued by non-auth MDS, but are been revoking
> +	 * by the auth MDS. The non-auth MDS should be revoking/exporting
> +	 * these caps, but the message is delayed.
> +	 */
> +	if (ci->i_auth_cap) {
> +		cap = ci->i_auth_cap;
> +		have &= ~cap->implemented | cap->issued;
> +	}
>  	return have;
>  }
>  
> 


  parent reply	other threads:[~2013-06-24  8:20 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-24  6:41 [PATCH 1/3] libceph: call r_unsafe_callback when unsafe reply is received Yan, Zheng
2013-06-24  6:41 ` [PATCH 2/3] mds: fix cap revoke race Yan, Zheng
2013-06-24  8:00   ` Yan, Zheng
2013-06-24  8:19   ` Yan, Zheng [this message]
2013-06-24  6:41 ` [PATCH 3/3] mds: fix race between cap issue and revoke Yan, Zheng
2013-06-24  8:16   ` Yan, Zheng
2013-07-01  7:28 ` [PATCH 1/3] libceph: call r_unsafe_callback when unsafe reply is received Yan, Zheng
2013-07-01 19:46   ` Sage Weil
2013-07-03 21:57     ` Sage Weil
2013-07-03 22:07       ` Milosz Tanski
2013-07-03 22:10         ` Sage Weil
2013-07-03 22:43         ` Yan, Zheng
2013-07-08 14:42           ` Milosz Tanski
2013-07-08 19:58             ` Milosz Tanski
2013-07-08 20:30               ` Yan, Zheng
2013-07-08 21:16                 ` Milosz Tanski
2013-07-25 15:43                   ` Milosz Tanski
2013-07-03 22:18       ` Alex Elder
2013-07-03 22:22       ` Yan, Zheng
2013-07-03 22:26         ` Sage Weil
2013-07-03 22:32           ` Sage Weil
2013-07-02 13:07 ` Alex Elder
2013-07-02 14:27   ` Yan, Zheng
2013-07-02 18:10   ` Sage Weil
2013-07-02 18:11     ` Alex Elder
  -- strict thread matches above, loose matches on Subject: below --
2013-06-17  2:48 [PATCH 2/3] mds: fix cap revoke race Yan, Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51C80128.6070408@intel.com \
    --to=zheng.z.yan@intel.com \
    --cc=alex.elder@linaro.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=sage@inktank.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox