]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix segment fault in Client::_invalidate_kernel_dcache(). 11414/head
authorYan, Zheng <zyan@redhat.com>
Wed, 21 Sep 2016 13:57:25 +0000 (21:57 +0800)
committerLoic Dachary <ldachary@redhat.com>
Tue, 11 Oct 2016 08:44:32 +0000 (10:44 +0200)
when umounting, root can be NULL

Fixes: http://tracker.ceph.com/issues/17253
Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit ddea9a5b78151c0abe834e4a9872f7cf5f918ebc)

src/client/Client.cc

index b465cadec55f2f337b6e74fce0b0d411f0cbe7b9..189fc265bb0d96c337966f45234793216d450c6e 100644 (file)
@@ -3923,6 +3923,8 @@ public:
 
 void Client::_invalidate_kernel_dcache()
 {
+  if (unmounting)
+    return;
   if (can_invalidate_dentries && dentry_invalidate_cb && root->dir) {
     for (ceph::unordered_map<string, Dentry*>::iterator p = root->dir->dentries.begin();
         p != root->dir->dentries.end();