Skip to content

Commit

Permalink
ext2: initialize quota info in ext2_xattr_set()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
cgxu519 authored and jankara committed Jul 9, 2020
1 parent cf1013f commit 1197d04
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/ext2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 1197d04

Please sign in to comment.