diff options
Diffstat (limited to 'fs/ocfs2/refcounttree.c')
-rw-r--r-- | fs/ocfs2/refcounttree.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 55767e1ba724..6ba4bcbc4796 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <linux/quotaops.h> | 46 | #include <linux/quotaops.h> |
47 | #include <linux/namei.h> | 47 | #include <linux/namei.h> |
48 | #include <linux/mount.h> | 48 | #include <linux/mount.h> |
49 | #include <linux/posix_acl.h> | ||
49 | 50 | ||
50 | struct ocfs2_cow_context { | 51 | struct ocfs2_cow_context { |
51 | struct inode *inode; | 52 | struct inode *inode; |
@@ -4268,11 +4269,20 @@ static int ocfs2_reflink(struct dentry *old_dentry, struct inode *dir, | |||
4268 | struct inode *inode = old_dentry->d_inode; | 4269 | struct inode *inode = old_dentry->d_inode; |
4269 | struct buffer_head *old_bh = NULL; | 4270 | struct buffer_head *old_bh = NULL; |
4270 | struct inode *new_orphan_inode = NULL; | 4271 | struct inode *new_orphan_inode = NULL; |
4272 | struct posix_acl *default_acl, *acl; | ||
4273 | umode_t mode; | ||
4271 | 4274 | ||
4272 | if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb))) | 4275 | if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb))) |
4273 | return -EOPNOTSUPP; | 4276 | return -EOPNOTSUPP; |
4274 | 4277 | ||
4275 | error = ocfs2_create_inode_in_orphan(dir, inode->i_mode, | 4278 | mode = inode->i_mode; |
4279 | error = posix_acl_create(dir, &mode, &default_acl, &acl); | ||
4280 | if (error) { | ||
4281 | mlog_errno(error); | ||
4282 | goto out; | ||
4283 | } | ||
4284 | |||
4285 | error = ocfs2_create_inode_in_orphan(dir, mode, | ||
4276 | &new_orphan_inode); | 4286 | &new_orphan_inode); |
4277 | if (error) { | 4287 | if (error) { |
4278 | mlog_errno(error); | 4288 | mlog_errno(error); |
@@ -4303,11 +4313,16 @@ static int ocfs2_reflink(struct dentry *old_dentry, struct inode *dir, | |||
4303 | /* If the security isn't preserved, we need to re-initialize them. */ | 4313 | /* If the security isn't preserved, we need to re-initialize them. */ |
4304 | if (!preserve) { | 4314 | if (!preserve) { |
4305 | error = ocfs2_init_security_and_acl(dir, new_orphan_inode, | 4315 | error = ocfs2_init_security_and_acl(dir, new_orphan_inode, |
4306 | &new_dentry->d_name); | 4316 | &new_dentry->d_name, |
4317 | default_acl, acl); | ||
4307 | if (error) | 4318 | if (error) |
4308 | mlog_errno(error); | 4319 | mlog_errno(error); |
4309 | } | 4320 | } |
4310 | out: | 4321 | out: |
4322 | if (default_acl) | ||
4323 | posix_acl_release(default_acl); | ||
4324 | if (acl) | ||
4325 | posix_acl_release(acl); | ||
4311 | if (!error) { | 4326 | if (!error) { |
4312 | error = ocfs2_mv_orphaned_inode_to_new(dir, new_orphan_inode, | 4327 | error = ocfs2_mv_orphaned_inode_to_new(dir, new_orphan_inode, |
4313 | new_dentry); | 4328 | new_dentry); |