]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix shutdown with open inodes 10419/head
authorJohn Spray <john.spray@redhat.com>
Sun, 24 Jul 2016 16:19:55 +0000 (17:19 +0100)
committerJohn Spray <john.spray@redhat.com>
Sun, 24 Jul 2016 16:21:24 +0000 (17:21 +0100)
This piece of code was dereferencing an invalid
iterator (invalidated by call to erase())

Fixes: http://tracker.ceph.com/issues/16764
Signed-off-by: John Spray <john.spray@redhat.com>
src/client/Client.cc

index e6b5e555c990db22926a43a90db216b3e5faf2d0..27468c16f02b349db1b95f7a0bfdfab79cee911a 100644 (file)
@@ -5650,9 +5650,10 @@ void Client::unmount()
   
   while (!ll_unclosed_fh_set.empty()) {
     set<Fh*>::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()) {