summaryrefslogtreecommitdiff
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorTahsin Erdogan <tahsin@google.com>2017-05-25 01:24:07 +0300
committerTheodore Ts'o <tytso@mit.edu>2017-05-25 01:24:07 +0300
commitb8cb5a545c3dd8b975aad19ea020eabe0a888e8d (patch)
tree922a559467f7a606bede9f9892731ec414ea9dc4 /fs/ext4/super.c
parentc41d342b39f15acbdc61948bab0cb3c567ec992a (diff)
downloadlinux-b8cb5a545c3dd8b975aad19ea020eabe0a888e8d.tar.xz
ext4: fix quota charging for shared xattr blocks
ext4_xattr_block_set() calls dquot_alloc_block() to charge for an xattr block when new references are made. However if dquot_initialize() hasn't been called on an inode, request for charging is effectively ignored because ext4_inode_info->i_dquot is not initialized yet. Add dquot_initialize() to call paths that lead to ext4_xattr_block_set(). Signed-off-by: Tahsin Erdogan <tahsin@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 8f05c72bc4ec..d37c81f327e7 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1174,6 +1174,9 @@ static int ext4_set_context(struct inode *inode, const void *ctx, size_t len,
return res;
}
+ res = dquot_initialize(inode);
+ if (res)
+ return res;
retry:
handle = ext4_journal_start(inode, EXT4_HT_MISC,
ext4_jbd2_credits_xattr(inode));