diff --git a/src/client/Client.cc b/src/client/Client.cc index 0f0fb4a6031..a2d3b743a6e 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -5689,9 +5689,10 @@ void Client::unmount() while (!ll_unclosed_fh_set.empty()) { set::iterator it = ll_unclosed_fh_set.begin(); - ll_unclosed_fh_set.erase(*it); - ldout(cct, 0) << " destroyed lost open file " << *it << " on " << *((*it)->inode) << dendl; - _release_fh(*it); + Fh *fh = *it; + ll_unclosed_fh_set.erase(fh); + ldout(cct, 0) << " destroyed lost open file " << fh << " on " << *(fh->inode) << dendl; + _release_fh(fh); } while (!opened_dirs.empty()) {