]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.60/f2fs-fix-to-detect-failure-of-dquot_initialize.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 4.14.60 / f2fs-fix-to-detect-failure-of-dquot_initialize.patch
CommitLineData
a65d4bac
GKH
1From foo@baz Sat Jul 28 10:25:26 CEST 2018
2From: Chao Yu <yuchao0@huawei.com>
3Date: Sat, 21 Apr 2018 17:53:52 +0800
4Subject: f2fs: fix to detect failure of dquot_initialize
5
6From: Chao Yu <yuchao0@huawei.com>
7
8[ Upstream commit c22aecd75919511abea872b201751e0be1add898 ]
9
10dquot_initialize() can fail due to any exception inside quota subsystem,
11f2fs needs to be aware of it, and return correct return value to caller.
12
13Signed-off-by: Chao Yu <yuchao0@huawei.com>
14Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
15Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 fs/f2fs/file.c | 4 +++-
19 1 file changed, 3 insertions(+), 1 deletion(-)
20
21--- a/fs/f2fs/file.c
22+++ b/fs/f2fs/file.c
23@@ -2493,7 +2493,9 @@ static int f2fs_ioc_setproject(struct fi
24 }
25 f2fs_put_page(ipage, 1);
26
27- dquot_initialize(inode);
28+ err = dquot_initialize(inode);
29+ if (err)
30+ goto out_unlock;
31
32 transfer_to[PRJQUOTA] = dqget(sb, make_kqid_projid(kprojid));
33 if (!IS_ERR(transfer_to[PRJQUOTA])) {