Skip to content

Commit 1197d04

Browse files
cgxu519jankara
authored andcommitted
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/[email protected] Signed-off-by: Chengguang Xu <[email protected]> Reviewed-by: Reviewed-by: Ritesh Harjani <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent cf1013f commit 1197d04

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/ext2/xattr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ ext2_xattr_set(struct inode *inode, int name_index, const char *name,
437437
name_len = strlen(name);
438438
if (name_len > 255 || value_len > sb->s_blocksize)
439439
return -ERANGE;
440+
error = dquot_initialize(inode);
441+
if (error)
442+
return error;
440443
down_write(&EXT2_I(inode)->xattr_sem);
441444
if (EXT2_I(inode)->i_file_acl) {
442445
/* The inode already has an extended attribute block. */

0 commit comments

Comments
 (0)