Commit f6176473 authored by Tiezhu Yang's avatar Tiezhu Yang Committed by Jaegeuk Kim

f2fs: fix wrong return value of f2fs_acl_create

When call f2fs_acl_create_masq() failed, the caller f2fs_acl_create()
should return -EIO instead of -ENOMEM, this patch makes it consistent
with posix_acl_create() which has been fixed in commit beaf226b
("posix_acl: don't ignore return value of posix_acl_create_masq()").

Fixes: 83dfe53c ("f2fs: fix reference leaks in f2fs_acl_create")
Signed-off-by: default avatarTiezhu Yang <kernelpatch@126.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent f5d5510e
...@@ -352,12 +352,14 @@ static int f2fs_acl_create(struct inode *dir, umode_t *mode, ...@@ -352,12 +352,14 @@ static int f2fs_acl_create(struct inode *dir, umode_t *mode,
return PTR_ERR(p); return PTR_ERR(p);
clone = f2fs_acl_clone(p, GFP_NOFS); clone = f2fs_acl_clone(p, GFP_NOFS);
if (!clone) if (!clone) {
goto no_mem; ret = -ENOMEM;
goto release_acl;
}
ret = f2fs_acl_create_masq(clone, mode); ret = f2fs_acl_create_masq(clone, mode);
if (ret < 0) if (ret < 0)
goto no_mem_clone; goto release_clone;
if (ret == 0) if (ret == 0)
posix_acl_release(clone); posix_acl_release(clone);
...@@ -371,11 +373,11 @@ static int f2fs_acl_create(struct inode *dir, umode_t *mode, ...@@ -371,11 +373,11 @@ static int f2fs_acl_create(struct inode *dir, umode_t *mode,
return 0; return 0;
no_mem_clone: release_clone:
posix_acl_release(clone); posix_acl_release(clone);
no_mem: release_acl:
posix_acl_release(p); posix_acl_release(p);
return -ENOMEM; return ret;
} }
int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage, int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment