From: Xiubo Li Date: Thu, 4 May 2023 06:22:37 +0000 (+0800) Subject: client: only wait for write MDS OPs when unmounting X-Git-Tag: v17.2.7~182^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=12c8685bfa62f92775996b957a0bb83ad5f757a5;p=ceph.git 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 (cherry picked from commit ee8443d63a175b9e5a3c60ba4e06270ae688d910) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index bdee3b3176ff2..ce65477ea555c 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -6555,11 +6555,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(); @@ -6572,7 +6579,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::iterator it = ll_unclosed_fh_set.begin(); Fh *fh = *it;