[PATCH 04/29] mds: xlock stray dentry when handling rename or unlink

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Yan, Zheng" <zheng.z.yan@xxxxxxxxx>

This prevents MDS from reintegrating stray before rename/unlink finishes

Signed-off-by: Yan, Zheng <zheng.z.yan@xxxxxxxxx>
---
 src/mds/Server.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index dc14bbe..064733c 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -4536,6 +4536,7 @@ void Server::handle_client_unlink(MDRequest *mdr)
   if (straydn) {
     wrlocks.insert(&straydn->get_dir()->inode->filelock);
     wrlocks.insert(&straydn->get_dir()->inode->nestlock);
+    xlocks.insert(&straydn->lock);
   }
   if (in->is_dir())
     rdlocks.insert(&in->filelock);   // to verify it's empty
@@ -5300,6 +5301,7 @@ void Server::handle_client_rename(MDRequest *mdr)
   if (straydn) {
     wrlocks.insert(&straydn->get_dir()->inode->filelock);
     wrlocks.insert(&straydn->get_dir()->inode->nestlock);
+    xlocks.insert(&straydn->lock);
   }
 
   // xlock versionlock on dentries if there are witnesses.
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux