]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix off-by-one in cow_inode vs snap flushes
authorSage Weil <sage.weil@dreamhost.com>
Fri, 1 Jul 2011 05:04:42 +0000 (22:04 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 1 Jul 2011 05:04:42 +0000 (22:04 -0700)
We need to wait for the client to flush snapped caps if the client has
not already flushed for the given snap.  If the client has already flushed
caps through the last snapid for the old inode, we do not need to set up
the snapped inode's locks to wait for that.

This fixes an occasional hang on the snaps/snaptest-multiple-capsnaps.sh
workunit.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/mds/MDCache.cc

index d11799295cf31add1101a9c6ac70fc2462f19833..e2596a072b42fc76256eee35ccda07e031247701 100644 (file)
@@ -1407,7 +1407,7 @@ CInode *MDCache::cow_inode(CInode *in, snapid_t last)
     Capability *cap = p->second;
     int issued = cap->issued();
     if ((issued & CEPH_CAP_ANY_WR) &&
-       cap->client_follows <= oldin->first) {
+       cap->client_follows < last) {
       // note in oldin
       for (int i = 0; i < num_cinode_locks; i++) {
        if (issued & cinode_lock_info[i].wr_caps) {