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

ext4: ea_inode owner should be the same as the inode owner

Quota charging is based on the ownership of the inode. Currently, the
xattr inode owner is set to the caller which may be different from the
parent inode owner. This is inconsistent with how quota is charged for
xattr block and regular data block writes.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

authored by

Tahsin Erdogan and committed by
Theodore Ts'o
9e1ba001 bd3b963b

+2 -1
+2 -1
fs/ext4/xattr.c
··· 824 824 struct inode *inode) 825 825 { 826 826 struct inode *ea_inode = NULL; 827 + uid_t owner[2] = { i_uid_read(inode), i_gid_read(inode) }; 827 828 int err; 828 829 829 830 /* ··· 832 831 * in the same group, or nearby one. 833 832 */ 834 833 ea_inode = ext4_new_inode(handle, inode->i_sb->s_root->d_inode, 835 - S_IFREG | 0600, NULL, inode->i_ino + 1, NULL, 834 + S_IFREG | 0600, NULL, inode->i_ino + 1, owner, 836 835 EXT4_EA_INODE_FL); 837 836 if (!IS_ERR(ea_inode)) { 838 837 ea_inode->i_op = &ext4_file_inode_operations;