From: "Yan, Zheng" <zheng.z.yan@intel.com>
To: Sage Weil <sage@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH 5/6] ceph: check mds_wanted for imported cap
Date: Sun, 06 Jan 2013 16:21:15 +0800 [thread overview]
Message-ID: <50E933FB.7040801@intel.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1301052216330.15430@cobra.newdream.net>
On 01/06/2013 02:20 PM, Sage Weil wrote:
> On Fri, 4 Jan 2013, Yan, Zheng wrote:
>> From: "Yan, Zheng" <zheng.z.yan@intel.com>
>>
>> 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@intel.com>
>> ---
>> 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?
>
will and it back in next patch
>> + /* 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;
probably, we need
if (le32_to_cpu(grant->op) == CEPH_CAP_OP_IMPORT)
check_caps = 1;
Regards
Yan, Zheng
>
> 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
>>
>>
next prev parent reply other threads:[~2013-01-06 8:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-04 11:34 [PATCH 0/6] fixes for cephfs kernel client Yan, Zheng
2013-01-04 11:34 ` [PATCH 1/6] ceph: re-calculate truncate_size for strip object Yan, Zheng
2013-01-06 6:04 ` Sage Weil
2013-01-04 11:34 ` [PATCH 2/6] ceph: move dirty inode to migrating list when clearing auth caps Yan, Zheng
2013-01-06 6:05 ` Sage Weil
2013-01-04 11:34 ` [PATCH 3/6] ceph: allow revoking duplicated caps issued by non-auth MDS Yan, Zheng
2013-01-06 6:09 ` Sage Weil
2013-01-06 8:49 ` Yan, Zheng
2013-01-04 11:34 ` [PATCH 4/6] ceph: allocate cap_release message when receiving cap import Yan, Zheng
2013-01-06 6:12 ` Sage Weil
2013-01-04 11:34 ` [PATCH 5/6] ceph: check mds_wanted for imported cap Yan, Zheng
2013-01-06 6:20 ` Sage Weil
2013-01-06 8:21 ` Yan, Zheng [this message]
2013-01-07 5:06 ` Sage Weil
2013-01-06 8:54 ` Yan, Zheng
2013-01-07 5:11 ` Sage Weil
2013-01-07 5:39 ` Yan, Zheng
2013-01-04 11:34 ` [PATCH 6/6] ceph: don't acquire i_mutex ceph_vmtruncate_work Yan, Zheng
2013-01-06 6:00 ` Sage Weil
2013-01-06 7:54 ` Yan, Zheng
2013-01-07 5:05 ` Sage Weil
2013-01-07 5:31 ` 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=50E933FB.7040801@intel.com \
--to=zheng.z.yan@intel.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.