return true;
}
-void MDRequest::unfreeze_auth_pin()
+void MDRequest::unfreeze_auth_pin(bool clear_inode)
{
assert(more()->is_freeze_authpin);
CInode *inode = more()->rename_inode;
else
inode->unfreeze_inode();
more()->is_freeze_authpin = false;
+ if (clear_inode)
+ more()->rename_inode = NULL;
}
void MDRequest::set_remote_frozen_auth_pin(CInode *inode)
void MDRequest::drop_local_auth_pins()
{
if (has_more() && more()->is_freeze_authpin)
- unfreeze_auth_pin();
+ unfreeze_auth_pin(true);
Mutation::drop_local_auth_pins();
}
bool slave_did_prepare();
bool did_ino_allocation();
bool freeze_auth_pin(CInode *inode);
- void unfreeze_auth_pin();
+ void unfreeze_auth_pin(bool clear_inode=false);
void set_remote_frozen_auth_pin(CInode *inode);
bool can_auth_pin(MDSCacheObject *object);
void drop_local_auth_pins();
if (fail) {
mdr->drop_local_auth_pins(); // just in case
} else {
+ /* freeze authpin wrong inode */
+ if (mdr->has_more() && mdr->more()->is_freeze_authpin &&
+ mdr->more()->rename_inode != auth_pin_freeze)
+ mdr->unfreeze_auth_pin(true);
+
/* handle_slave_rename_prep() call freeze_inode() to wait for all other operations
* on the source inode to complete. This happens after all locks for the rename
* operation are acquired. But to acquire locks, we need auth pin locks' parent