]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
f2fs: fix to detect failure of dquot_initialize
authorChao Yu <yuchao0@huawei.com>
Sat, 21 Apr 2018 09:53:52 +0000 (17:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:47:39 +0000 (07:47 +0200)
[ Upstream commit c22aecd75919511abea872b201751e0be1add898 ]

dquot_initialize() can fail due to any exception inside quota subsystem,
f2fs needs to be aware of it, and return correct return value to caller.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/f2fs/file.c

index ffa20409c7033a3eee06857c921152d3a5d24718..1dba4d22c6d7584f2e3f80099d57ab0e7a75f0c9 100644 (file)
@@ -2571,7 +2571,9 @@ static int f2fs_ioc_setproject(struct file *filp, __u32 projid)
        }
        f2fs_put_page(ipage, 1);
 
-       dquot_initialize(inode);
+       err = dquot_initialize(inode);
+       if (err)
+               goto out_unlock;
 
        transfer_to[PRJQUOTA] = dqget(sb, make_kqid_projid(kprojid));
        if (!IS_ERR(transfer_to[PRJQUOTA])) {