Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.net
Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
Reviewed-by: Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: Jan Kara <jack@suse.cz>

authored by

Chengguang Xu and committed by
Jan Kara
1197d04f cf1013f4

+3
+3
fs/ext2/xattr.c
··· 437 437 name_len = strlen(name); 438 438 if (name_len > 255 || value_len > sb->s_blocksize) 439 439 return -ERANGE; 440 + error = dquot_initialize(inode); 441 + if (error) 442 + return error; 440 443 down_write(&EXT2_I(inode)->xattr_sem); 441 444 if (EXT2_I(inode)->i_file_acl) { 442 445 /* The inode already has an extended attribute block. */