[PATCH 18/29] mds: fix rename inode exportor check

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

 



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

Use "srcdn->is_auth() && destdnl->is_primary()" to check if the MDS is
inode exportor of rename operation is not reliable, This is because
OP_FINISH slave request may race with subtree import. The fix is use
a variable in MDRequest to indicate if the MDS is inode exportor.

Signed-off-by: Yan, Zheng <zheng.z.yan@xxxxxxxxx>
---
 src/mds/Mutation.h | 4 ++--
 src/mds/Server.cc  | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mds/Mutation.h b/src/mds/Mutation.h
index bf59dba..d0d3eca 100644
--- a/src/mds/Mutation.h
+++ b/src/mds/Mutation.h
@@ -213,7 +213,7 @@ struct MDRequest : public Mutation {
     bufferlist inode_import;
     version_t inode_import_v;
     CInode* destdn_was_remote_inode;
-    bool was_link_merge;
+    bool was_inode_exportor;
     int prepared_inode_exporter; // has asked auth of srci to mark srci as ambiguous auth
 
     map<client_t,entity_inst_t> imported_client_map;
@@ -233,7 +233,7 @@ struct MDRequest : public Mutation {
 
     More() : 
       src_reanchor_atid(0), dst_reanchor_atid(0), inode_import_v(0),
-      destdn_was_remote_inode(0), was_link_merge(false),
+      destdn_was_remote_inode(0), was_inode_exportor(false),
       prepared_inode_exporter(-1), flock_was_waiting(false),
       stid(0),
       slave_commit(0) { }
diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index 6097552..c5793e5 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -6261,6 +6261,7 @@ void Server::_logged_slave_rename(MDRequest *mdr,
 
     // remove mdr auth pin
     mdr->auth_unpin(srcdnl->get_inode());
+    mdr->more()->was_inode_exportor = true;
     
     dout(10) << " exported srci " << *srcdnl->get_inode() << dendl;
   }
@@ -6299,7 +6300,7 @@ void Server::_commit_slave_rename(MDRequest *mdr, int r,
 
     // unfreeze+singleauth inode
     //  hmm, do i really need to delay this?
-    if (srcdn->is_auth() && destdnl->is_primary()) {
+    if (mdr->more()->was_inode_exportor) {
 
       CInode *in = destdnl->get_inode();
 
-- 
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