mirror of
https://github.com/ceph/ceph
synced 2025-02-24 03:27:10 +00:00
Merge PR #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 <vshankar@redhat.com> Reviewed-by: Dhairya Parmar <dparmar@redhat.com> Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
commit
f5dae89148
@ -6673,11 +6673,18 @@ void Client::_unmount(bool abort)
|
||||
}
|
||||
|
||||
mount_cond.wait(lock, [this] {
|
||||
if (!mds_requests.empty()) {
|
||||
ldout(cct, 10) << "waiting on " << mds_requests.size() << " requests"
|
||||
<< dendl;
|
||||
// Only wait for write OPs
|
||||
for (auto& [tid, req] : mds_requests) {
|
||||
if (req->is_write()) {
|
||||
ldout(cct, 10) << "waiting for write request '" << tid
|
||||
<< "' to complete, currently there are "
|
||||
<< mds_requests.size()
|
||||
<< " outstanding read/write requests"
|
||||
<< dendl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return mds_requests.empty();
|
||||
return true;
|
||||
});
|
||||
|
||||
cwd.reset();
|
||||
@ -6690,7 +6697,7 @@ void Client::_unmount(bool abort)
|
||||
ldout(cct, 0) << " destroyed lost open file " << fh << " on " << *fh->inode << dendl;
|
||||
_release_fh(fh);
|
||||
}
|
||||
|
||||
|
||||
while (!ll_unclosed_fh_set.empty()) {
|
||||
set<Fh*>::iterator it = ll_unclosed_fh_set.begin();
|
||||
Fh *fh = *it;
|
||||
@ -11964,6 +11971,9 @@ int Client::_sync_fs()
|
||||
flush_caps_sync();
|
||||
ceph_tid_t flush_tid = last_flush_tid;
|
||||
|
||||
// flush the mdlog before waiting for unsafe requests.
|
||||
flush_mdlog_sync();
|
||||
|
||||
// wait for unsafe mds requests
|
||||
wait_unsafe_requests();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user