f2fs: fix to detect failure of dquot_initialize
authorChao Yu <yuchao0@huawei.com>
Sat, 21 Apr 2018 09:53:52 +0000 (17:53 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 31 May 2018 18:31:47 +0000 (11:31 -0700)
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>
fs/f2fs/file.c

index d2b4145cb34e0a2394b6731008eb37ad3712c2f4..ac6452261926ce0b73be09d6d0437441c742bec6 100644 (file)
@@ -2576,7 +2576,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])) {