mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 13:44:15 +08:00
ceph: clear dir complete, invalidate dentry on replayed rename
If a rename operation is resent to the MDS following an MDS restart, the client does not get a full reply (containing the resulting metadata) back. In that case, a ceph_rename() needs to compensate by doing anything useful that fill_inode() would have, like d_move(). It also needs to invalidate the dentry (to workaround the vfs_rename_dir() bug) and clear the dir complete flag, just like fill_trace(). Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
5c6a2cdb4f
commit
ea1409f961
@ -880,7 +880,16 @@ static int ceph_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
* do_request, above). If there is no trace, we need
|
||||
* to do it here.
|
||||
*/
|
||||
|
||||
/* d_move screws up d_subdirs order */
|
||||
ceph_i_clear(new_dir, CEPH_I_COMPLETE);
|
||||
|
||||
d_move(old_dentry, new_dentry);
|
||||
|
||||
/* ensure target dentry is invalidated, despite
|
||||
rehashing bug in vfs_rename_dir */
|
||||
new_dentry->d_time = jiffies;
|
||||
ceph_dentry(new_dentry)->lease_shared_gen = 0;
|
||||
}
|
||||
ceph_mdsc_put_request(req);
|
||||
return err;
|
||||
|
Loading…
Reference in New Issue
Block a user