aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2013-01-04 01:37:57 -0500
committerAlex Elder <elder@inktank.com>2013-01-17 13:42:38 -0500
commit395c312b9c535d57db122cbb5b7292223561d0b8 (patch)
tree271b19e34402b0f0dc11911d0b185dc53c57b4c5 /fs/ceph
parent8a92a119b292012a9bd920b908c3e9f1c512291d (diff)
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> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/caps.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index a9fe2d5784c9..76b19239c426 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,
1468 struct ceph_mds_client *mdsc = fsc->mdsc; 1468 struct ceph_mds_client *mdsc = fsc->mdsc;
1469 struct inode *inode = &ci->vfs_inode; 1469 struct inode *inode = &ci->vfs_inode;
1470 struct ceph_cap *cap; 1470 struct ceph_cap *cap;
1471 int file_wanted, used; 1471 int file_wanted, used, cap_used;
1472 int took_snap_rwsem = 0; /* true if mdsc->snap_rwsem held */ 1472 int took_snap_rwsem = 0; /* true if mdsc->snap_rwsem held */
1473 int issued, implemented, want, retain, revoking, flushing = 0; 1473 int issued, implemented, want, retain, revoking, flushing = 0;
1474 int mds = -1; /* keep track of how far we've gone through i_caps list 1474 int mds = -1; /* keep track of how far we've gone through i_caps list
@@ -1571,9 +1571,14 @@ retry_locked:
1571 1571
1572 /* NOTE: no side-effects allowed, until we take s_mutex */ 1572 /* NOTE: no side-effects allowed, until we take s_mutex */
1573 1573
1574 cap_used = used;
1575 if (ci->i_auth_cap && cap != ci->i_auth_cap)
1576 cap_used &= ~ci->i_auth_cap->issued;
1577
1574 revoking = cap->implemented & ~cap->issued; 1578 revoking = cap->implemented & ~cap->issued;
1575 dout(" mds%d cap %p issued %s implemented %s revoking %s\n", 1579 dout(" mds%d cap %p used %s issued %s implemented %s revoking %s\n",
1576 cap->mds, cap, ceph_cap_string(cap->issued), 1580 cap->mds, cap, ceph_cap_string(cap->issued),
1581 ceph_cap_string(cap_used),
1577 ceph_cap_string(cap->implemented), 1582 ceph_cap_string(cap->implemented),
1578 ceph_cap_string(revoking)); 1583 ceph_cap_string(revoking));
1579 1584
@@ -1601,7 +1606,7 @@ retry_locked:
1601 } 1606 }
1602 1607
1603 /* completed revocation? going down and there are no caps? */ 1608 /* completed revocation? going down and there are no caps? */
1604 if (revoking && (revoking & used) == 0) { 1609 if (revoking && (revoking & cap_used) == 0) {
1605 dout("completed revocation of %s\n", 1610 dout("completed revocation of %s\n",
1606 ceph_cap_string(cap->implemented & ~cap->issued)); 1611 ceph_cap_string(cap->implemented & ~cap->issued));
1607 goto ack; 1612 goto ack;
@@ -1678,8 +1683,8 @@ ack:
1678 sent++; 1683 sent++;
1679 1684
1680 /* __send_cap drops i_ceph_lock */ 1685 /* __send_cap drops i_ceph_lock */
1681 delayed += __send_cap(mdsc, cap, CEPH_CAP_OP_UPDATE, used, want, 1686 delayed += __send_cap(mdsc, cap, CEPH_CAP_OP_UPDATE, cap_used,
1682 retain, flushing, NULL); 1687 want, retain, flushing, NULL);
1683 goto retry; /* retake i_ceph_lock and restart our cap scan. */ 1688 goto retry; /* retake i_ceph_lock and restart our cap scan. */
1684 } 1689 }
1685 1690