Skip to content

Commit f5dae89

Browse files
committed
Merge PR ceph#51417 into main
* refs/pull/51417/head: client: only wait for write MDS OPs when unmounting client: flush the mdlog before waiting for unsafe requests Reviewed-by: Venky Shankar <[email protected]> Reviewed-by: Dhairya Parmar <[email protected]> Reviewed-by: Patrick Donnelly <[email protected]>
2 parents 703f265 + ee8443d commit f5dae89

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/client/Client.cc

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6673,11 +6673,18 @@ void Client::_unmount(bool abort)
66736673
}
66746674

66756675
mount_cond.wait(lock, [this] {
6676-
if (!mds_requests.empty()) {
6677-
ldout(cct, 10) << "waiting on " << mds_requests.size() << " requests"
6678-
<< dendl;
6676+
// Only wait for write OPs
6677+
for (auto& [tid, req] : mds_requests) {
6678+
if (req->is_write()) {
6679+
ldout(cct, 10) << "waiting for write request '" << tid
6680+
<< "' to complete, currently there are "
6681+
<< mds_requests.size()
6682+
<< " outstanding read/write requests"
6683+
<< dendl;
6684+
return false;
6685+
}
66796686
}
6680-
return mds_requests.empty();
6687+
return true;
66816688
});
66826689

66836690
cwd.reset();
@@ -6690,7 +6697,7 @@ void Client::_unmount(bool abort)
66906697
ldout(cct, 0) << " destroyed lost open file " << fh << " on " << *fh->inode << dendl;
66916698
_release_fh(fh);
66926699
}
6693-
6700+
66946701
while (!ll_unclosed_fh_set.empty()) {
66956702
set<Fh*>::iterator it = ll_unclosed_fh_set.begin();
66966703
Fh *fh = *it;
@@ -11964,6 +11971,9 @@ int Client::_sync_fs()
1196411971
flush_caps_sync();
1196511972
ceph_tid_t flush_tid = last_flush_tid;
1196611973

11974+
// flush the mdlog before waiting for unsafe requests.
11975+
flush_mdlog_sync();
11976+
1196711977
// wait for unsafe mds requests
1196811978
wait_unsafe_requests();
1196911979

0 commit comments

Comments
 (0)