commit
df79944a "mds: cleanup unneeded client_snap_caps when
splitting snap inode" is incomplete.
Fixes: http://tracker.ceph.com/issues/39987
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit
0a1e92abf1cfc8bddf526cbf5bceea7b854dcfe8)
Conflicts:
src/mds/MDCache.cc
- in mimic, "error: 'vec' is not a member of 'MDSContext'"
addressed by declaring finished as list<MDSInternalContextBase*> instead of
MDSContext::vec
in->client_snap_caps.clear();
in->item_open_file.remove_myself();
in->item_caps.remove_myself();
+
+ list<MDSInternalContextBase*> finished;
for (const auto &p : client_snap_caps) {
SimpleLock *lock = in->get_lock(p.first);
ceph_assert(lock);
lock->put_wrlock();
(void)q; /* unused */
}
- ceph_assert(!lock->get_num_wrlocks());
- lock->set_state(LOCK_SYNC);
- in->auth_unpin(lock);
+ if (!lock->get_num_wrlocks()) {
+ lock->set_state(LOCK_SYNC);
+ lock->take_waiting(SimpleLock::WAIT_STABLE|SimpleLock::WAIT_RD, finished);
+ in->auth_unpin(lock);
+ }
}
+ mds->queue_waiters(finished);
}
return oldin;
}