]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix segment fault in Client::_invalidate_kernel_dcache(). 11170/head
authorYan, Zheng <zyan@redhat.com>
Wed, 21 Sep 2016 13:57:25 +0000 (21:57 +0800)
committerYan, Zheng <zyan@redhat.com>
Wed, 21 Sep 2016 13:57:25 +0000 (21:57 +0800)
when umounting, root can be NULL

Fixes: http://tracker.ceph.com/issues/17253
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/client/Client.cc

index 7b19a2a0482dc33ee1a5b13c0f25b9b348538ca2..5352da37ee4f307668eacfdac1a4a96d2383c4a7 100644 (file)
@@ -3938,6 +3938,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();