ext4: propagate error from dquot_initialize() in EXT4_IOC_FSSETXATTR
authorWang Shilong <wshilong@ddn.com>
Wed, 3 Oct 2018 16:19:21 +0000 (12:19 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 3 Oct 2018 16:19:21 +0000 (12:19 -0400)
We return most failure of dquota_initialize() except
inode evict, this could make a bit sense, for example
we allow file removal even quota files are broken?

But it dosen't make sense to allow setting project
if quota files etc are broken.

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
fs/ext4/ioctl.c

index 0b3e2486f988d89cb5c4eea26385b76a6ec4f1e9..0edee31913d1fcccdc3b326aabeeb403fadcca75 100644 (file)
@@ -380,7 +380,9 @@ static int ext4_ioctl_setproject(struct file *filp, __u32 projid)
                brelse(iloc.bh);
        }
 
-       dquot_initialize(inode);
+       err = dquot_initialize(inode);
+       if (err)
+               return err;
 
        handle = ext4_journal_start(inode, EXT4_HT_QUOTA,
                EXT4_QUOTA_INIT_BLOCKS(sb) +