From: "Yan, Zheng" <zheng.z.yan@intel.com>
To: Sage Weil <sage@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH 3/6] ceph: allow revoking duplicated caps issued by non-auth MDS
Date: Sun, 06 Jan 2013 16:49:18 +0800 [thread overview]
Message-ID: <50E93A8E.7040102@intel.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1301052208200.15430@cobra.newdream.net>
how about below patch, I also rebased git://github.com/ukernel/ceph-client.git wip-ceph
----
From 19f0e26cb90c29bb22ad09769bfc0df03b3d07be Mon Sep 17 00:00:00 2001
From: "Yan, Zheng" <zheng.z.yan@intel.com>
Date: Fri, 4 Jan 2013 14:37:57 +0800
Subject: [PATCH 3/5] ceph: allow revoking duplicated caps issued by non-auth
MDS
Allow revoking duplicated caps issued by non-auth MDS if these caps
are also issued by auth MDS.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
fs/ceph/caps.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index a9fe2d5..76b1923 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -1468,7 +1468,7 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
struct ceph_mds_client *mdsc = fsc->mdsc;
struct inode *inode = &ci->vfs_inode;
struct ceph_cap *cap;
- int file_wanted, used;
+ int file_wanted, used, cap_used;
int took_snap_rwsem = 0; /* true if mdsc->snap_rwsem held */
int issued, implemented, want, retain, revoking, flushing = 0;
int mds = -1; /* keep track of how far we've gone through i_caps list
@@ -1571,9 +1571,14 @@ retry_locked:
/* NOTE: no side-effects allowed, until we take s_mutex */
+ cap_used = used;
+ if (ci->i_auth_cap && cap != ci->i_auth_cap)
+ cap_used &= ~ci->i_auth_cap->issued;
+
revoking = cap->implemented & ~cap->issued;
- dout(" mds%d cap %p issued %s implemented %s revoking %s\n",
+ dout(" mds%d cap %p used %s issued %s implemented %s revoking %s\n",
cap->mds, cap, ceph_cap_string(cap->issued),
+ ceph_cap_string(cap_used),
ceph_cap_string(cap->implemented),
ceph_cap_string(revoking));
@@ -1601,7 +1606,7 @@ retry_locked:
}
/* completed revocation? going down and there are no caps? */
- if (revoking && (revoking & used) == 0) {
+ if (revoking && (revoking & cap_used) == 0) {
dout("completed revocation of %s\n",
ceph_cap_string(cap->implemented & ~cap->issued));
goto ack;
@@ -1678,8 +1683,8 @@ ack:
sent++;
/* __send_cap drops i_ceph_lock */
- delayed += __send_cap(mdsc, cap, CEPH_CAP_OP_UPDATE, used, want,
- retain, flushing, NULL);
+ delayed += __send_cap(mdsc, cap, CEPH_CAP_OP_UPDATE, cap_used,
+ want, retain, flushing, NULL);
goto retry; /* retake i_ceph_lock and restart our cap scan. */
}
--
1.7.11.7
next prev parent reply other threads:[~2013-01-06 8:49 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 [this message]
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
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=50E93A8E.7040102@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.