All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@openvz.org>
To: Andreas Dilger <adilger@sun.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: [PATCH 08/19] ext4: replace inode uid,gid,mode init with helper v2
Date: Thu, 18 Feb 2010 10:09:13 +0300	[thread overview]
Message-ID: <87k4ub9g12.fsf_-_@openvz.org> (raw)
In-Reply-To: <E5AA2C0B-42FA-4025-A155-7ACD02EDE261@sun.com> (Andreas Dilger's message of "Wed, 17 Feb 2010 16:39:54 -0700")

[-- Attachment #1: Type: text/plain, Size: 1451 bytes --]

Andreas Dilger <adilger@sun.com> writes:

> On 2010-02-17, at 11:40, Dmitry Monakhov wrote:
>> @@ -985,16 +985,12 @@ got:
>> 		atomic_dec(&sbi->s_flex_groups[flex_group].free_inodes);
>> 	}
>>
>> +	if (test_opt (sb, GRPID)) {
>
> (style) please don't add the space after "test_opt" back into the code.
Ok, updated, new version attached.
>
>
>> +		inode->i_mode = mode;
>> +		inode->i_uid = current_fsuid();
>> 		inode->i_gid = dir->i_gid;
>> 	} else
>> +		inode_init_owner(inode, dir, mode);
>
>
> This code is a bit misleading, since it implies that "i_uid" and
> "i_mode" are set this way due to the GRPID option, even though with
> further investigation it is just set the same way in both cases.
>
> Ted,
> what do you think of just removing the "GRPID" mount option?  I
> believe this was around for ages, due to the lack of BSD setgid-on- 
> parent functionality in Linux.  I don't think it is needed anymore,
> since the BSD functionality is much more flexible (it can be set on a
> per-directory basis instead of for the whole filesystem).
>
> I suppose one way to find out positively would be to add a printk() to
> case Opt_grpid: in the option parsing that this option is deprecated,
> and to contact linux-ext4@vger.kernel.org if you are still using it.
Let's post this as separate patch because this change existing behavior.
>
> Cheers, Andreas
> --
> Andreas Dilger
> Sr. Staff Engineer, Lustre Group
> Sun Microsystems of Canada, Inc.

[-- Attachment #2: 0008-ext4-replace-inode-uid-gid-mode-init-with-helper-v2.patch --]
[-- Type: text/plain, Size: 1135 bytes --]

>From a1336d4e57352423a7eb0f7b95ed20e78dcefc8c Mon Sep 17 00:00:00 2001
From: Dmitry Monakhov <dmonakhov@openvz.org>
Date: Thu, 18 Feb 2010 09:44:01 +0300
Subject: [PATCH 08/19] ext4: replace inode uid,gid,mode init with helper v2


Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 fs/ext4/ialloc.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index f3624ea..a2a35d3 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -985,16 +985,12 @@ got:
 		atomic_dec(&sbi->s_flex_groups[flex_group].free_inodes);
 	}
 
-	inode->i_uid = current_fsuid();
-	if (test_opt(sb, GRPID))
+	if (test_opt(sb, GRPID)) {
+		inode->i_mode = mode;
+		inode->i_uid = current_fsuid();
 		inode->i_gid = dir->i_gid;
-	else if (dir->i_mode & S_ISGID) {
-		inode->i_gid = dir->i_gid;
-		if (S_ISDIR(mode))
-			mode |= S_ISGID;
 	} else
-		inode->i_gid = current_fsgid();
-	inode->i_mode = mode;
+		inode_init_owner(inode, dir, mode);
 
 	inode->i_ino = ino + group * EXT4_INODES_PER_GROUP(sb);
 	/* This is the optimal IO size (for stat), not the fs block size */
-- 
1.6.6


  reply	other threads:[~2010-02-18  7:09 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-17 18:29 [PATCH 00/19] fs cleanup: remove duplicated code on inode init Dmitry Monakhov
2010-02-17 18:34 ` [PATCH 01/19] vfs: Add inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-17 23:03   ` James Morris
2010-02-18  6:57     ` [PATCH 01/19] vfs: Add inode uid,gid,mode init helper v2 Dmitry Monakhov
2010-02-17 18:36 ` [PATCH 02/19] 9p: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-17 18:37 ` [PATCH 03/19] bfs: " Dmitry Monakhov
2010-02-17 18:38 ` [PATCH 04/19] btrfs: " Dmitry Monakhov
2010-02-17 18:39 ` [PATCH 05/19] exofs: " Dmitry Monakhov
2010-02-20  0:15   ` Boaz Harrosh
2010-02-17 18:40 ` [PATCH 06/19] ext2: " Dmitry Monakhov
2010-02-18  1:21   ` Jan Kara
2010-02-18  7:00     ` [PATCH 06/19] ext2: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-02-18 18:49       ` Jan Kara
2010-02-17 18:40 ` [PATCH 07/19] ext3: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-18  7:02   ` [PATCH 07/19] ext3: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-02-17 18:40 ` [PATCH 08/19] ext4: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-17 23:39   ` Andreas Dilger
2010-02-18  7:09     ` Dmitry Monakhov [this message]
2010-02-18 20:52     ` tytso
2010-02-19 10:30       ` Dmitry Monakhov
2010-02-19 14:39       ` [PATCH] ext4: deprecate obsoleted mount options Dmitry Monakhov
2010-02-23  0:28         ` Andreas Dilger
2010-02-23 19:23           ` [PATCH] ext4: deprecate obsoleted mount options v2 Dmitry Monakhov
2010-02-23 20:13             ` tytso
2010-02-24 18:12               ` [PATCH] ext4: deprecate obsoleted mount options v3 Dmitry Monakhov
2010-03-02  3:43                 ` tytso
2010-02-17 18:41 ` [PATCH 09/19] jfs: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-17 21:57   ` Dave Kleikamp
2010-02-18  7:12     ` [PATCH 09/19] jfs: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-02-17 18:41 ` [PATCH 10/19] minix: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-17 18:42 ` [PATCH 11/19] nilfs2: " Dmitry Monakhov
2010-02-18  1:28   ` Ryusuke Konishi
2010-02-17 18:43 ` [Ocfs2-devel] [PATCH 12/19] ocfs2: replace inode uid, gid, mode " Dmitry Monakhov
2010-02-17 18:43   ` [PATCH 12/19] ocfs2: replace inode uid,gid,mode " Dmitry Monakhov
2010-02-18  4:07   ` [Ocfs2-devel] [PATCH 12/19] ocfs2: replace inode uid, gid, mode " Joel Becker
2010-02-18  4:07     ` [PATCH 12/19] ocfs2: replace inode uid,gid,mode " Joel Becker
2010-02-17 18:44 ` [PATCH 13/19] omfs: " Dmitry Monakhov
2010-02-17 18:44 ` [PATCH 14/19] ramfs: " Dmitry Monakhov
2010-02-17 18:45 ` [PATCH 15/19] reiserfs: " Dmitry Monakhov
2010-02-17 18:45 ` [PATCH 16/19] sysv: " Dmitry Monakhov
2010-02-17 18:46 ` [PATCH 17/19] ubifs: replace inode uid, gid, mode " Dmitry Monakhov
2010-02-17 18:46   ` [PATCH 17/19] ubifs: replace inode uid,gid,mode " Dmitry Monakhov
2010-02-18 10:54   ` Artem Bityutskiy
2010-02-18 10:54     ` Artem Bityutskiy
2010-02-17 18:47 ` [PATCH 18/19] udf: " Dmitry Monakhov
2010-02-17 23:43   ` Jan Kara
2010-02-18  7:18     ` [PATCH 18/19] udf: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-02-18 18:53       ` Jan Kara
2010-02-18 19:55         ` [PATCH 18/19] udf: replace inode uid,gid,mode init with helper v3 Dmitry Monakhov
2010-02-19 10:56           ` Jan Kara
2010-02-17 18:47 ` [PATCH 19/19] ufs: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
  -- strict thread matches above, loose matches on Subject: below --
2010-03-04 14:28 [PATCH 00/19] fs cleanup: remove duplicated code on inode init v2 Dmitry Monakhov
2010-03-04 14:31 ` [PATCH 08/19] ext4: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k4ub9g12.fsf_-_@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=adilger@sun.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.