Commit 1197d04f authored by Chengguang Xu's avatar Chengguang Xu Committed by Jan Kara

ext2: initialize quota info in ext2_xattr_set()

In order to correctly account/limit space usage, should initialize
quota info before calling quota related functions.

Link: https://lore.kernel.org/r/20200626054959.114177-1-cgxu519@mykernel.netSigned-off-by: default avatarChengguang Xu <cgxu519@mykernel.net>
Reviewed-by: default avatarReviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent cf1013f4
......@@ -437,6 +437,9 @@ ext2_xattr_set(struct inode *inode, int name_index, const char *name,
name_len = strlen(name);
if (name_len > 255 || value_len > sb->s_blocksize)
return -ERANGE;
error = dquot_initialize(inode);
if (error)
return error;
down_write(&EXT2_I(inode)->xattr_sem);
if (EXT2_I(inode)->i_file_acl) {
/* The inode already has an extended attribute block. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment