Skip to content

Commit ee8443d

Browse files
committed
client: only wait for write MDS OPs when unmounting
We do not care about the read MDS OPs and it's safe by just dropping them when unmounting. Fixes: https://tracker.ceph.com/issues/59705 Signed-off-by: Xiubo Li <[email protected]>
1 parent 2b715b8 commit ee8443d

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/client/Client.cc

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6649,11 +6649,18 @@ void Client::_unmount(bool abort)
66496649
}
66506650

66516651
mount_cond.wait(lock, [this] {
6652-
if (!mds_requests.empty()) {
6653-
ldout(cct, 10) << "waiting on " << mds_requests.size() << " requests"
6654-
<< dendl;
6652+
// Only wait for write OPs
6653+
for (auto& [tid, req] : mds_requests) {
6654+
if (req->is_write()) {
6655+
ldout(cct, 10) << "waiting for write request '" << tid
6656+
<< "' to complete, currently there are "
6657+
<< mds_requests.size()
6658+
<< " outstanding read/write requests"
6659+
<< dendl;
6660+
return false;
6661+
}
66556662
}
6656-
return mds_requests.empty();
6663+
return true;
66576664
});
66586665

66596666
cwd.reset();
@@ -6666,7 +6673,7 @@ void Client::_unmount(bool abort)
66666673
ldout(cct, 0) << " destroyed lost open file " << fh << " on " << *fh->inode << dendl;
66676674
_release_fh(fh);
66686675
}
6669-
6676+
66706677
while (!ll_unclosed_fh_set.empty()) {
66716678
set<Fh*>::iterator it = ll_unclosed_fh_set.begin();
66726679
Fh *fh = *it;

0 commit comments

Comments
 (0)