From 038a754fd491b1493d466f1653405ea55e95a20a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 30 Jun 2011 22:04:42 -0700 Subject: [PATCH] mds: fix off-by-one in cow_inode vs snap flushes 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 --- src/mds/MDCache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index d11799295cf31..e2596a072b42f 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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) { -- 2.39.5