diff mbox

[2/2] e2fsprogs: enable user namespace xattrs by default

Message ID 4D5C15C6.5000802@redhat.com
State Superseded, archived
Headers show

Commit Message

Eric Sandeen Feb. 16, 2011, 6:21 p.m. UTC
User namespace xattrs are generally useful, and I think extN
is the only filesystem requiring a special mount option to
enable them, when xattrs are otherwise available.  So this
change sets that mount option into the defaults.

Note that if xattrs are config'd off, this will lead to a
mostly-harmless:

   EXT4-fs (sdc1): (no)user_xattr options not supported

message at mount time... 

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---


--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Andreas Dilger Feb. 16, 2011, 7:15 p.m. UTC | #1
On 2011-02-16, at 11:21, Eric Sandeen wrote:
> User namespace xattrs are generally useful, and I think extN
> is the only filesystem requiring a special mount option to
> enable them, when xattrs are otherwise available.  So this
> change sets that mount option into the defaults.
> 
> Note that if xattrs are config'd off, this will lead to a
> mostly-harmless:
> 
>   EXT4-fs (sdc1): (no)user_xattr options not supported
> 
> message at mount time... 

Wouldn't it be more useful to change this in the kernel, instead of only changing it in the superblock for new filesystems?

Cheers, Andreas





--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eric Sandeen Feb. 16, 2011, 7:27 p.m. UTC | #2
On 2/16/11 1:15 PM, Andreas Dilger wrote:
> On 2011-02-16, at 11:21, Eric Sandeen wrote:
>> User namespace xattrs are generally useful, and I think extN
>> is the only filesystem requiring a special mount option to
>> enable them, when xattrs are otherwise available.  So this
>> change sets that mount option into the defaults.
>>
>> Note that if xattrs are config'd off, this will lead to a
>> mostly-harmless:
>>
>>   EXT4-fs (sdc1): (no)user_xattr options not supported
>>
>> message at mount time... 
> 
> Wouldn't it be more useful to change this in the kernel, instead of only changing it in the superblock for new filesystems?
> 
> Cheers, Andreas

I thought about that; maybe it should happen in both places?

-Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Theodore Ts'o Feb. 16, 2011, 9:49 p.m. UTC | #3
On Wed, Feb 16, 2011 at 01:27:39PM -0600, Eric Sandeen wrote:
> On 2/16/11 1:15 PM, Andreas Dilger wrote:
> > On 2011-02-16, at 11:21, Eric Sandeen wrote:
> >> User namespace xattrs are generally useful, and I think extN
> >> is the only filesystem requiring a special mount option to
> >> enable them, when xattrs are otherwise available.  So this
> >> change sets that mount option into the defaults.
> >>
> > 
> > Wouldn't it be more useful to change this in the kernel, instead of only changing it in the superblock for new filesystems?
> > 
> 
> I thought about that; maybe it should happen in both places?

Yes, agreed.  Maybe we should do the same thing with posix ACL's as
well?  ACL's can only take away access as compared to the unix
permission bits, so it's safe to enable ACL's.

	   	    	      	 	- Ted


--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eric Sandeen Feb. 16, 2011, 9:53 p.m. UTC | #4
On 2/16/11 3:49 PM, Ted Ts'o wrote:
> On Wed, Feb 16, 2011 at 01:27:39PM -0600, Eric Sandeen wrote:
>> On 2/16/11 1:15 PM, Andreas Dilger wrote:
>>> On 2011-02-16, at 11:21, Eric Sandeen wrote:
>>>> User namespace xattrs are generally useful, and I think extN
>>>> is the only filesystem requiring a special mount option to
>>>> enable them, when xattrs are otherwise available.  So this
>>>> change sets that mount option into the defaults.
>>>>
>>>
>>> Wouldn't it be more useful to change this in the kernel, instead of only changing it in the superblock for new filesystems?
>>>
>>
>> I thought about that; maybe it should happen in both places?
> 
> Yes, agreed.  Maybe we should do the same thing with posix ACL's as
> well?  ACL's can only take away access as compared to the unix
> permission bits, so it's safe to enable ACL's.
> 
> 	   	    	      	 	- Ted
> 

Whoops, I didn't realize that acls were in the same boat, of "config on and then turn on with a mount option"

Ok, sure, adding that makes sense to me too...

Is sticking it in the _initialize() function ok with you?  It's a little odd, but ...

-Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Theodore Ts'o Feb. 16, 2011, 10:56 p.m. UTC | #5
On Wed, Feb 16, 2011 at 03:53:01PM -0600, Eric Sandeen wrote:
> Whoops, I didn't realize that acls were in the same boat, of "config
> on and then turn on with a mount option"
> 
> Ok, sure, adding that makes sense to me too...
> 
> Is sticking it in the _initialize() function ok with you?  It's a
> little odd, but ...

I think it's probably better to put it in the misc/mke2fs.c; we set a
number of superblock options there already.  But either place is fine...

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eric Sandeen Feb. 16, 2011, 10:58 p.m. UTC | #6
On 2/16/11 4:56 PM, Ted Ts'o wrote:
> On Wed, Feb 16, 2011 at 03:53:01PM -0600, Eric Sandeen wrote:
>> Whoops, I didn't realize that acls were in the same boat, of "config
>> on and then turn on with a mount option"
>>
>> Ok, sure, adding that makes sense to me too...
>>
>> Is sticking it in the _initialize() function ok with you?  It's a
>> little odd, but ...
> 
> I think it's probably better to put it in the misc/mke2fs.c; we set a
> number of superblock options there already.  But either place is fine...
> 
> 						- Ted

Ok, if we do it in mke2fs.c that's probably better.

Or - I wonder how hard it'd be to make this into a mke2fs.conf
option instead?  I always forget about that route.

get_string_from_profile(... "default_mount_opts" ....) ?

-Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Theodore Ts'o Feb. 16, 2011, 11:01 p.m. UTC | #7
On Wed, Feb 16, 2011 at 04:58:35PM -0600, Eric Sandeen wrote:
> 
> Ok, if we do it in mke2fs.c that's probably better.
> 
> Or - I wonder how hard it'd be to make this into a mke2fs.conf
> option instead?  I always forget about that route.
> 
> get_string_from_profile(... "default_mount_opts" ....) ?

That would certainly be more general.  I don't really think it matters
for acl and xattr, since I think it's better to make them be the
default in the kernel, and then long term make noacl and noxattr
disappear as mount options altogether.

One reason for doing this is just to make the output of /proc/mounts
look nicer.  :-)

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c
index ff63a92..12a9452 100644
--- a/lib/ext2fs/initialize.c
+++ b/lib/ext2fs/initialize.c
@@ -164,6 +164,7 @@  errcode_t ext2fs_initialize(const char *name, int flags,
 	set_field(s_raid_stripe_width, 0);	/* default stripe width: 0 */
 	set_field(s_log_groups_per_flex, 0);
 	set_field(s_flags, 0);
+	set_field(s_default_mount_opts, EXT2_DEFM_XATTR_USER);
 	if (super->s_feature_incompat & ~EXT2_LIB_FEATURE_INCOMPAT_SUPP) {
 		retval = EXT2_ET_UNSUPP_FEATURE;
 		goto cleanup;