From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Subject: [PATCH 2/2 V2] e2fsprogs: enable user namespace xattrs by default
Date: Thu, 17 Feb 2011 15:56:17 -0600 [thread overview]
Message-ID: <4D5D9981.1020300@redhat.com> (raw)
In-Reply-To: <4D5C15C6.5000802@redhat.com>
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, via a
mke2fs.conf option.
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>
---
diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c
index 1d2927c..4cf0863 100644
--- a/lib/ext2fs/initialize.c
+++ b/lib/ext2fs/initialize.c
@@ -147,6 +147,7 @@ errcode_t ext2fs_initialize(const char *name, int flags,
set_field(s_feature_compat, 0);
set_field(s_feature_incompat, 0);
set_field(s_feature_ro_compat, 0);
+ set_field(s_default_mount_opts, 0);
set_field(s_first_meta_bg, 0);
set_field(s_raid_stride, 0); /* default stride size: 0 */
set_field(s_raid_stripe_width, 0); /* default stripe width: 0 */
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 2910e6e..e9e3129 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -829,6 +829,18 @@ static void edit_feature(const char *str, __u32 *compat_array)
}
}
+static void edit_mntopts(const char *str, __u32 *mntopts)
+{
+ if (!str)
+ return;
+
+ if (e2p_edit_mntopts(str, mntopts, ~0)) {
+ fprintf(stderr, _("Invalid mount option set: %s\n"),
+ str);
+ exit(1);
+ }
+}
+
struct str_list {
char **list;
int num;
@@ -1576,6 +1588,16 @@ profile_error:
}
edit_feature(fs_features ? fs_features : tmp,
&fs_param.s_feature_compat);
+
+ if (tmp)
+ free(tmp);
+
+ /* And which mount options as well */
+ tmp = NULL;
+ tmp = get_string_from_profile(fs_types, "default_mntopts",
+ "acl,user_xattr");
+ edit_mntopts(tmp, &fs_param.s_default_mount_opts);
+
if (tmp)
free(tmp);
diff --git a/misc/mke2fs.conf b/misc/mke2fs.conf
index a96251e..775e046 100644
--- a/misc/mke2fs.conf
+++ b/misc/mke2fs.conf
@@ -1,5 +1,6 @@
[defaults]
base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr
+ default_mntopts = acl,user_xattr
enable_periodic_fsck = 0
blocksize = 4096
inode_size = 256
diff --git a/misc/mke2fs.conf.5.in b/misc/mke2fs.conf.5.in
index 1e777cd..791cf7e 100644
--- a/misc/mke2fs.conf.5.in
+++ b/misc/mke2fs.conf.5.in
@@ -314,6 +314,13 @@ relations. It may be overridden by the
command-line option to
.BR mke2fs (8).
.TP
+.I default_mntopts
+This relation specifies the set of mount options which should be enabled
+by default. These may be changed at a later time with the
+.B -o
+command-line option to
+.BR tune2fs (8).
+.TP
.I auto_64-bit_support
This relation is a boolean which specifies whether
.BR mke2fs (8)
next prev parent reply other threads:[~2011-02-17 21:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-16 18:12 [PATCH 0/2] e2fsprogs: update mkfs defaults Eric Sandeen
2011-02-16 18:14 ` [PATCH 1/2] e2fsprogs: turn off enforced fsck intervals by default Eric Sandeen
2011-02-16 18:24 ` Lukas Czerner
2011-02-16 19:12 ` Amir Goldstein
2011-02-16 22:55 ` Ted Ts'o
2011-02-17 21:55 ` [PATCH 1/2 V2] " Eric Sandeen
2011-02-16 18:21 ` [PATCH 2/2] e2fsprogs: enable user namespace xattrs " Eric Sandeen
2011-02-16 19:15 ` Andreas Dilger
2011-02-16 19:27 ` Eric Sandeen
2011-02-16 21:49 ` Ted Ts'o
2011-02-16 21:53 ` Eric Sandeen
2011-02-16 22:56 ` Ted Ts'o
2011-02-16 22:58 ` Eric Sandeen
2011-02-16 23:01 ` Ted Ts'o
2011-02-17 21:56 ` Eric Sandeen [this message]
2011-02-20 23:31 ` [PATCH 2/2 V2] " Ted Ts'o
2011-02-21 17:00 ` Eric Sandeen
2011-02-16 22:12 ` [PATCH 0/2] e2fsprogs: update mkfs defaults Andreas Dilger
2011-02-16 22:37 ` Eric Sandeen
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=4D5D9981.1020300@redhat.com \
--to=sandeen@redhat.com \
--cc=linux-ext4@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).