diff options
author | Tiezhu Yang <kernelpatch@126.com> | 2018-11-21 07:21:38 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-02-12 19:46:00 +0100 |
commit | c357fe55e4e2c3e2f45357cdbf065be183816230 (patch) | |
tree | d1cbf295d300d7c48f9e2ac2c9ced49eeb0490fb /fs | |
parent | 58282978fe278202bb9aebe41fc679f10e5dc447 (diff) | |
download | linux-exynos-c357fe55e4e2c3e2f45357cdbf065be183816230.tar.gz linux-exynos-c357fe55e4e2c3e2f45357cdbf065be183816230.tar.bz2 linux-exynos-c357fe55e4e2c3e2f45357cdbf065be183816230.zip |
f2fs: fix wrong return value of f2fs_acl_create
[ Upstream commit f6176473a0c7472380eef72ebeb330cf9485bf0a ]
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 beaf226b863a
("posix_acl: don't ignore return value of posix_acl_create_masq()").
Fixes: 83dfe53c185e ("f2fs: fix reference leaks in f2fs_acl_create")
Signed-off-by: Tiezhu Yang <kernelpatch@126.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/acl.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c index 436b3a1464d9..5e4860b8bbfc 100644 --- a/fs/f2fs/acl.c +++ b/fs/f2fs/acl.c @@ -349,12 +349,14 @@ static int f2fs_acl_create(struct inode *dir, umode_t *mode, return PTR_ERR(p); clone = f2fs_acl_clone(p, GFP_NOFS); - if (!clone) - goto no_mem; + if (!clone) { + ret = -ENOMEM; + goto release_acl; + } ret = f2fs_acl_create_masq(clone, mode); if (ret < 0) - goto no_mem_clone; + goto release_clone; if (ret == 0) posix_acl_release(clone); @@ -368,11 +370,11 @@ static int f2fs_acl_create(struct inode *dir, umode_t *mode, return 0; -no_mem_clone: +release_clone: posix_acl_release(clone); -no_mem: +release_acl: posix_acl_release(p); - return -ENOMEM; + return ret; } int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage, |