Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1672077 > unrolled thread

[PATCH 06/32] ext4: ea_inode owner should be the same as the inode owner

Started byTahsin Erdogan <tahsin@google.com>
First post2017-06-21 23:40 +0200
Last post2017-06-22 03:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 06/32] ext4: ea_inode owner should be the same as the inode owner Tahsin Erdogan <tahsin@google.com> - 2017-06-21 23:40 +0200
    Re: [PATCH 06/32] ext4: ea_inode owner should be the same as the  inode owner Theodore Ts'o <tytso@mit.edu> - 2017-06-22 03:30 +0200

#1672077 — [PATCH 06/32] ext4: ea_inode owner should be the same as the inode owner

FromTahsin Erdogan <tahsin@google.com>
Date2017-06-21 23:40 +0200
Subject[PATCH 06/32] ext4: ea_inode owner should be the same as the inode owner
Message-ID<tUVvY-3sm-27@gated-at.bofh.it>
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>
---
 fs/ext4/xattr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 8e123533315f..32ad2f2870e9 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -826,6 +826,7 @@ static struct inode *ext4_xattr_inode_create(handle_t *handle,
 					     struct inode *inode)
 {
 	struct inode *ea_inode = NULL;
+	uid_t owner[2] = { i_uid_read(inode), i_gid_read(inode) };
 	int err;
 
 	/*
@@ -833,7 +834,7 @@ static struct inode *ext4_xattr_inode_create(handle_t *handle,
 	 * in the same group, or nearby one.
 	 */
 	ea_inode = ext4_new_inode(handle, inode->i_sb->s_root->d_inode,
-				  S_IFREG | 0600, NULL, inode->i_ino + 1, NULL,
+				  S_IFREG | 0600, NULL, inode->i_ino + 1, owner,
 				  EXT4_EA_INODE_FL);
 	if (!IS_ERR(ea_inode)) {
 		ea_inode->i_op = &ext4_file_inode_operations;
-- 
2.13.1.611.g7e3b11ae1-goog

[toc] | [next] | [standalone]


#1672200 — Re: [PATCH 06/32] ext4: ea_inode owner should be the same as the inode owner

FromTheodore Ts'o <tytso@mit.edu>
Date2017-06-22 03:30 +0200
SubjectRe: [PATCH 06/32] ext4: ea_inode owner should be the same as the inode owner
Message-ID<tUZ6x-5ZI-11@gated-at.bofh.it>
In reply to#1672077
On Wed, Jun 21, 2017 at 02:21:16PM -0700, Tahsin Erdogan wrote:
> 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>

Thanks, added to the ext4 patch queue.

					- Ted

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web