diff options
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index d6ebc85192b7..539a85fddbc2 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -1946,21 +1946,17 @@ xfs_inactive( | |||
1946 | /* | 1946 | /* |
1947 | * If there are attributes associated with the file then blow them away | 1947 | * If there are attributes associated with the file then blow them away |
1948 | * now. The code calls a routine that recursively deconstructs the | 1948 | * now. The code calls a routine that recursively deconstructs the |
1949 | * attribute fork. We need to just commit the current transaction | 1949 | * attribute fork. If also blows away the in-core attribute fork. |
1950 | * because we can't use it for xfs_attr_inactive(). | ||
1951 | */ | 1950 | */ |
1952 | if (ip->i_d.di_anextents > 0) { | 1951 | if (XFS_IFORK_Q(ip)) { |
1953 | ASSERT(ip->i_d.di_forkoff != 0); | ||
1954 | |||
1955 | error = xfs_attr_inactive(ip); | 1952 | error = xfs_attr_inactive(ip); |
1956 | if (error) | 1953 | if (error) |
1957 | return; | 1954 | return; |
1958 | } | 1955 | } |
1959 | 1956 | ||
1960 | if (ip->i_afp) | 1957 | ASSERT(!ip->i_afp); |
1961 | xfs_idestroy_fork(ip, XFS_ATTR_FORK); | ||
1962 | |||
1963 | ASSERT(ip->i_d.di_anextents == 0); | 1958 | ASSERT(ip->i_d.di_anextents == 0); |
1959 | ASSERT(ip->i_d.di_forkoff == 0); | ||
1964 | 1960 | ||
1965 | /* | 1961 | /* |
1966 | * Free the inode. | 1962 | * Free the inode. |
@@ -2883,7 +2879,13 @@ xfs_rename_alloc_whiteout( | |||
2883 | if (error) | 2879 | if (error) |
2884 | return error; | 2880 | return error; |
2885 | 2881 | ||
2886 | /* 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)); | ||
2887 | xfs_finish_inode_setup(tmpfile); | 2889 | xfs_finish_inode_setup(tmpfile); |
2888 | VFS_I(tmpfile)->i_state |= I_LINKABLE; | 2890 | VFS_I(tmpfile)->i_state |= I_LINKABLE; |
2889 | 2891 | ||
@@ -3151,7 +3153,7 @@ xfs_rename( | |||
3151 | * intermediate state on disk. | 3153 | * intermediate state on disk. |
3152 | */ | 3154 | */ |
3153 | if (wip) { | 3155 | if (wip) { |
3154 | ASSERT(wip->i_d.di_nlink == 0); | 3156 | ASSERT(VFS_I(wip)->i_nlink == 0 && wip->i_d.di_nlink == 0); |
3155 | error = xfs_bumplink(tp, wip); | 3157 | error = xfs_bumplink(tp, wip); |
3156 | if (error) | 3158 | if (error) |
3157 | goto out_trans_abort; | 3159 | goto out_trans_abort; |