diff options
| author | Tao Ma <tao.ma@oracle.com> | 2009-10-14 23:10:48 -0400 | 
|---|---|---|
| committer | Joel Becker <joel.becker@oracle.com> | 2009-10-29 01:44:19 -0400 | 
| commit | 87f4b1bb98696e6cf84f57df7de41f28c2a7dbeb (patch) | |
| tree | edfc70e8681ee3ff98d5a7eb181edf4554deb0f4 | |
| parent | fb5cbe9efd741b16e72133613747f76490bbecd3 (diff) | |
ocfs2: Move ocfs2_complete_reflink to the right place.
As its name ocfs2_complete_reflink indicates, it should
be called after all the work for reflink is done, so
it really should be called after we reflink xattr
successfully.
Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Tested-by: Tristan Ye <tristan.ye@oracle.com>
| -rw-r--r-- | fs/ocfs2/refcounttree.c | 14 | 
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 60287fc56bcb..9d439b277304 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c  | |||
| @@ -4013,10 +4013,6 @@ static int ocfs2_create_reflink_node(struct inode *s_inode, | |||
| 4013 | goto out_unlock_refcount; | 4013 | goto out_unlock_refcount; | 
| 4014 | } | 4014 | } | 
| 4015 | 4015 | ||
| 4016 | ret = ocfs2_complete_reflink(s_inode, s_bh, t_inode, t_bh, preserve); | ||
| 4017 | if (ret) | ||
| 4018 | mlog_errno(ret); | ||
| 4019 | |||
| 4020 | out_unlock_refcount: | 4016 | out_unlock_refcount: | 
| 4021 | ocfs2_unlock_refcount_tree(osb, ref_tree, 1); | 4017 | ocfs2_unlock_refcount_tree(osb, ref_tree, 1); | 
| 4022 | brelse(ref_root_bh); | 4018 | brelse(ref_root_bh); | 
| @@ -4068,9 +4064,17 @@ static int __ocfs2_reflink(struct dentry *old_dentry, | |||
| 4068 | ret = ocfs2_reflink_xattrs(inode, old_bh, | 4064 | ret = ocfs2_reflink_xattrs(inode, old_bh, | 
| 4069 | new_inode, new_bh, | 4065 | new_inode, new_bh, | 
| 4070 | preserve); | 4066 | preserve); | 
| 4071 | if (ret) | 4067 | if (ret) { | 
| 4072 | mlog_errno(ret); | 4068 | mlog_errno(ret); | 
| 4069 | goto inode_unlock; | ||
| 4070 | } | ||
| 4073 | } | 4071 | } | 
| 4072 | |||
| 4073 | ret = ocfs2_complete_reflink(inode, old_bh, | ||
| 4074 | new_inode, new_bh, preserve); | ||
| 4075 | if (ret) | ||
| 4076 | mlog_errno(ret); | ||
| 4077 | |||
| 4074 | inode_unlock: | 4078 | inode_unlock: | 
| 4075 | ocfs2_inode_unlock(new_inode, 1); | 4079 | ocfs2_inode_unlock(new_inode, 1); | 
| 4076 | brelse(new_bh); | 4080 | brelse(new_bh); | 
