diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_inode.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 1117dd3ba123..539a85fddbc2 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -2879,7 +2879,13 @@ xfs_rename_alloc_whiteout( | |||
2879 | if (error) | 2879 | if (error) |
2880 | return error; | 2880 | return error; |
2881 | 2881 | ||
2882 | /* Satisfy xfs_bumplink that this is a real tmpfile */ | 2882 | /* |
2883 | * Prepare the tmpfile inode as if it were created through the VFS. | ||
2884 | * Otherwise, the link increment paths will complain about nlink 0->1. | ||
2885 | * Drop the link count as done by d_tmpfile(), complete the inode setup | ||
2886 | * and flag it as linkable. | ||
2887 | */ | ||
2888 | drop_nlink(VFS_I(tmpfile)); | ||
2883 | xfs_finish_inode_setup(tmpfile); | 2889 | xfs_finish_inode_setup(tmpfile); |
2884 | VFS_I(tmpfile)->i_state |= I_LINKABLE; | 2890 | VFS_I(tmpfile)->i_state |= I_LINKABLE; |
2885 | 2891 | ||
@@ -3147,7 +3153,7 @@ xfs_rename( | |||
3147 | * intermediate state on disk. | 3153 | * intermediate state on disk. |
3148 | */ | 3154 | */ |
3149 | if (wip) { | 3155 | if (wip) { |
3150 | ASSERT(wip->i_d.di_nlink == 0); | 3156 | ASSERT(VFS_I(wip)->i_nlink == 0 && wip->i_d.di_nlink == 0); |
3151 | error = xfs_bumplink(tp, wip); | 3157 | error = xfs_bumplink(tp, wip); |
3152 | if (error) | 3158 | if (error) |
3153 | goto out_trans_abort; | 3159 | goto out_trans_abort; |