f2fs: add missing quota_initialize

This patch adds to call quota_intialize in f2fs_set_acl, f2fs_unlink,
and f2fs_rename.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Jaegeuk Kim 2017-10-23 23:50:15 +02:00
parent 8f1572f7ce
commit d8d1389ea1
2 changed files with 13 additions and 0 deletions

View File

@ -430,6 +430,9 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry)
return -EIO; return -EIO;
err = dquot_initialize(dir); err = dquot_initialize(dir);
if (err)
return err;
err = dquot_initialize(inode);
if (err) if (err)
return err; return err;
@ -809,6 +812,12 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
if (err) if (err)
goto out; goto out;
if (new_inode) {
err = dquot_initialize(new_inode);
if (err)
goto out;
}
old_entry = f2fs_find_entry(old_dir, &old_dentry->d_name, &old_page); old_entry = f2fs_find_entry(old_dir, &old_dentry->d_name, &old_page);
if (!old_entry) { if (!old_entry) {
if (IS_ERR(old_page)) if (IS_ERR(old_page))

View File

@ -678,6 +678,10 @@ int f2fs_setxattr(struct inode *inode, int index, const char *name,
struct f2fs_sb_info *sbi = F2FS_I_SB(inode); struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
int err; int err;
err = dquot_initialize(inode);
if (err)
return err;
/* this case is only from init_inode_metadata */ /* this case is only from init_inode_metadata */
if (ipage) if (ipage)
return __f2fs_setxattr(inode, index, name, value, return __f2fs_setxattr(inode, index, name, value,