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>
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) {