- drop orphan flag to prevent a race between mds_cleanup_orphans() and
mds_mfd_close() when the both try to unlink the same orphan
last_orphan = mds_orphan_open_dec_test(inode) &&
mds_inode_is_orphan(inode);
+ if (last_orphan && unlink_orphan)
+ mds_inode_unset_orphan(inode);
UP_WRITE_I_ALLOC_SEM(inode);
/* this is half of the actual "close" */
CWARN("orphan %s re-opened during recovery\n", d_name);
GOTO(next, rc = 0);
}
+ mds_inode_unset_orphan(child_inode);
UP_READ_I_ALLOC_SEM(child_inode);
rc = mds_unlink_orphan(obd, dchild, child_inode, pending_dir);
if (rc == 0) {