]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix NULL pointer dereference in Server::handle_client_rename
authorYan, Zheng <zheng.z.yan@intel.com>
Wed, 19 Mar 2014 06:26:08 +0000 (14:26 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Wed, 19 Mar 2014 06:30:54 +0000 (14:30 +0800)
Inode's parent dentry can be NULL, which causes segment fault in
Locker::acquire_locks

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/Server.cc

index 4b6b752ccb7d7d1dc2949aa3ac5e2be4015f36ba..2c0f82a9825a648bdfeabb1775820f4812408e4d 100644 (file)
@@ -5689,9 +5689,9 @@ void Server::handle_client_rename(MDRequest *mdr)
     // open_remote_ino() with 'want_locked=true' when the srcdn or destdn
     // is traversed.
     if (srcdnl->is_remote())
-      xlocks.insert(&srci->get_parent_dn()->lock);
+      xlocks.insert(&srci->get_projected_parent_dn()->lock);
     if (destdnl->is_remote())
-      xlocks.insert(&oldin->get_parent_dn()->lock);
+      xlocks.insert(&oldin->get_projected_parent_dn()->lock);
   }
 
   // we need to update srci's ctime.  xlock its least contended lock to do that...