From: Zhi Zhang Date: Thu, 18 Feb 2016 10:45:50 +0000 (+0800) Subject: [ceph-fuse] Fh ref might leak at umounting X-Git-Tag: v10.1.0~177^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f0dcd32b67aff827b9b5ffff0fc7bd3291410c4a;p=ceph.git [ceph-fuse] Fh ref might leak at umounting Signed-off-by: Zhi Zhang --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 294bbcd15e66..26c0764d9022 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -5491,9 +5491,9 @@ void Client::unmount() _release_fh(fh); } - while (!ll_unclosed_fh.empty()) { - set::iterator it = ll_unclosed_fh.begin(); - ll_unclosed_fh.erase(*it); + 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); } @@ -11044,7 +11044,7 @@ int Client::ll_open(Inode *in, int flags, Fh **fhp, int uid, int gid) out: Fh *fhptr = fhp ? *fhp : NULL; if (fhptr) { - ll_unclosed_fh.insert(fhptr); + ll_unclosed_fh_set.insert(fhptr); } tout(cct) << (unsigned long)fhptr << std::endl; ldout(cct, 3) << "ll_open " << vino << " " << flags << " = " << r << " (" << @@ -11118,7 +11118,7 @@ out: Fh *fhptr = fhp ? *fhp : NULL; if (fhptr) { - ll_unclosed_fh.insert(fhptr); + ll_unclosed_fh_set.insert(fhptr); } tout(cct) << (unsigned long)fhptr << std::endl; tout(cct) << attr->st_ino << std::endl; @@ -11515,8 +11515,8 @@ int Client::ll_release(Fh *fh) tout(cct) << "ll_release (fh)" << std::endl; tout(cct) << (unsigned long)fh << std::endl; - if (ll_unclosed_fh.count(fh)) - ll_unclosed_fh.erase(fh); + if (ll_unclosed_fh_set.count(fh)) + ll_unclosed_fh_set.erase(fh); return _release_fh(fh); } diff --git a/src/client/Client.h b/src/client/Client.h index 18e7b3e1699f..e59db87e6726 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -421,7 +421,7 @@ protected: // file handles, etc. interval_set free_fd_set; // unused fds ceph::unordered_map fd_map; - set ll_unclosed_fh; + set ll_unclosed_fh_set; int get_fd() { int fd = free_fd_set.range_start();