Skip to contentSkip to conversation

Patches for review

PATCH New Aneesh Kumar K.V 4 participants 18 messages Oct 24, 2007 ext4 file system

lore
Share & tools
lore
#0 lore raw

Send some patches which are in my local repo for review. The compile bench fix patch is already in patch queue.

#1 lore raw

Send some patches which are in my local repo for review. The compile bench fix patch is already in patch queue.

GIT: Please enter your email below.
GIT: Lines beginning in "GIT: " will be removed.
GIT: Consider including an overall diffstat or table of contents
GIT: for the patch you are writing.

#2 lore raw

Send some patches which are in my local repo for review. The compile bench fix patch is already in patch queue.

#3 lore raw

PATCH 1/1 ext4: Change the default behaviour on error

ext4 file system was by default ignoring errors and continuing. This is not a good default as continuing on error could lead to file system corruption. Change the default to mark the file system readonly. Debian and ubuntu already does this as the default in their fstab.

---
 fs/ext4/super.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
fs/ext4/super.c +8 -8
index 10feae6..62d7ec8 100644
@@ -691,16 +691,16 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
 	    le16_to_cpu(es->s_def_resgid) != EXT4_DEF_RESGID) {
 		seq_printf(seq, ",resgid=%u", sbi->s_resgid);
 	}
-	if (test_opt(sb, ERRORS_CONT)) {
+	if (test_opt(sb, ERRORS_RO)) {
 		int def_errors = le16_to_cpu(es->s_errors);
 
 		if (def_errors == EXT4_ERRORS_PANIC ||
-		    def_errors == EXT4_ERRORS_RO) {
-			seq_puts(seq, ",errors=continue");
+		    def_errors == EXT4_ERRORS_CONTINUE) {
+			seq_puts(seq, ",errors=remount-ro");
 		}
 	}
-	if (test_opt(sb, ERRORS_RO))
-		seq_puts(seq, ",errors=remount-ro");
+	if (test_opt(sb, ERRORS_CONT))
+		seq_puts(seq, ",errors=continue");
 	if (test_opt(sb, ERRORS_PANIC))
 		seq_puts(seq, ",errors=panic");
 	if (test_opt(sb, NO_UID32))
@@ -1809,10 +1809,10 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
 
 	if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_PANIC)
 		set_opt(sbi->s_mount_opt, ERRORS_PANIC);
-	else if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_RO)
-		set_opt(sbi->s_mount_opt, ERRORS_RO);
-	else
+	else if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_CONTINUE)
 		set_opt(sbi->s_mount_opt, ERRORS_CONT);
+	else
+		set_opt(sbi->s_mount_opt, ERRORS_RO);
 
 	sbi->s_resuid = le16_to_cpu(es->s_def_resuid);
 	sbi->s_resgid = le16_to_cpu(es->s_def_resgid);
Signature · 1 line
1.5.3.4.319.gdd817-dirty
#4 lore raw

PATCH 1/1 ext4: Fix mballoc BUG when running compilebench

This fix the mballoc bug when running compile bench. Instead of using direct division even though the arguments are 32 bits we retain do_div. This would be needed if we move to 64 bit logical block number.

---
 fs/ext4/mballoc.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
fs/ext4/mballoc.c +4 -3
index fe7cf9e..8467b3d 100644
@@ -3089,13 +3089,14 @@ static void ext4_mb_normalize_request(struct ext4_allocation_context *ac,
 		}
 	}
 	if (wind == 0) {
+		__u64 tstart;
 		/* file is quite large, we now preallocate with
 		 * the biggest configured window with regart to
 		 * logical offset */
 		wind = sbi->s_mb_prealloc_table[i - 1];
-		start = ac->ac_o_ex.fe_logical;
-		do_div(start, wind);
-		start = start * wind;
+		tstart = ac->ac_o_ex.fe_logical;
+		do_div(tstart, wind);
+		start = tstart * wind;
 	}
 	size = wind;
 	orig_size = size;
Signature · 1 line
1.5.3.4.319.gdd817-dirty
#5 lore raw

PATCH 1/1 ext4: Enable delalloc and mballoc by default.

This ensure we test the latest features more easily. We need an option to clear delayed alloc feature. Add nodealloc option.

---
 fs/ext4/super.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
fs/ext4/super.c +7 -1
index 62d7ec8..0c32dc8 100644
@@ -872,7 +872,7 @@ enum {
 	Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
 	Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
 	Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
-	Opt_grpquota, Opt_extents, Opt_noextents, Opt_delalloc,
+	Opt_grpquota, Opt_extents, Opt_noextents, Opt_delalloc, Opt_nodelalloc,
 	Opt_mballoc, Opt_nomballoc, Opt_stripe,
 };
 
@@ -928,6 +928,7 @@ static match_table_t tokens = {
 	{Opt_extents, "extents"},
 	{Opt_noextents, "noextents"},
 	{Opt_delalloc, "delalloc"},
+	{Opt_nodelalloc, "nodelalloc"},
 	{Opt_mballoc, "mballoc"},
 	{Opt_nomballoc, "nomballoc"},
 	{Opt_stripe, "stripe=%u"},
@@ -1279,6 +1280,9 @@ clear_qf_name:
 		case Opt_delalloc:
 			set_opt (sbi->s_mount_opt, DELALLOC);
 			break;
+		case Opt_nodelalloc:
+			clear_opt (sbi->s_mount_opt, DELALLOC);
+			break;
 		case Opt_mballoc:
 			set_opt(sbi->s_mount_opt, MBALLOC);
 			break;
@@ -1824,6 +1828,8 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
 	 * User -o noextents to turn it off
 	 */
 	set_opt(sbi->s_mount_opt, EXTENTS);
+	set_opt(sbi->s_mount_opt, DELALLOC);
+	set_opt(sbi->s_mount_opt, MBALLOC);
 
 	if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum,
 			    NULL, 0))
Signature · 1 line
1.5.3.4.319.gdd817-dirty
#6 lore raw

PATCH 1/1 ext4: Show mballoc and delalloc options

Both these options are enabled by default. So if they are are not set in mount options that means the user explicity disabled them using nomablloc and nodelalloc option. Show the same in ext4_show_options

---
 fs/ext4/super.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
fs/ext4/super.c +6 -0
index 0c32dc8..f1f70ce 100644
@@ -733,8 +733,14 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
 		seq_puts(seq, ",barrier=1");
 	if (test_opt(sb, NOBH))
 		seq_puts(seq, ",nobh");
+
+	/* extents,mballoc and delalloc are enabled by default */
 	if (!test_opt(sb, EXTENTS))
 		seq_puts(seq, ",noextents");
+	if (!test_opt(sb, MBALLOC))
+		seq_puts(seq, ",nomballoc");
+	if (!test_opt(sb, DELALLOC))
+		seq_puts(seq, ",nodelalloc");
 
 	if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
 		seq_puts(seq, ",data=journal");
Signature · 1 line
1.5.3.4.319.gdd817-dirty
#7 lore raw

PATCH 1/1 ext4: Fix ext4_show_options to show the correct mount options.

We need to look at the default value and make sure the mount options are not set via default value before showing them via ext4_show_options

---
 fs/ext4/super.c |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)
fs/ext4/super.c +16 -12
index f1f70ce..5300c17 100644
@@ -668,18 +668,20 @@ static inline void ext4_show_quota_options(struct seq_file *seq, struct super_bl
  */
 static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
 {
+	int def_errors;
+	unsigned long def_mount_opts;
 	struct super_block *sb = vfs->mnt_sb;
 	struct ext4_sb_info *sbi = EXT4_SB(sb);
 	struct ext4_super_block *es = sbi->s_es;
-	unsigned long def_mount_opts;
 
 	def_mount_opts = le32_to_cpu(es->s_default_mount_opts);
+	def_errors     = le16_to_cpu(es->s_errors);
 
 	if (sbi->s_sb_block != 1)
 		seq_printf(seq, ",sb=%llu", sbi->s_sb_block);
 	if (test_opt(sb, MINIX_DF))
 		seq_puts(seq, ",minixdf");
-	if (test_opt(sb, GRPID))
+	if (test_opt(sb, GRPID) && !(def_mount_opts & EXT4_DEFM_BSDGROUPS))
 		seq_puts(seq, ",grpid");
 	if (!test_opt(sb, GRPID) && (def_mount_opts & EXT4_DEFM_BSDGROUPS))
 		seq_puts(seq, ",nogrpid");
@@ -692,25 +694,24 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
 		seq_printf(seq, ",resgid=%u", sbi->s_resgid);
 	}
 	if (test_opt(sb, ERRORS_RO)) {
-		int def_errors = le16_to_cpu(es->s_errors);
-
 		if (def_errors == EXT4_ERRORS_PANIC ||
 		    def_errors == EXT4_ERRORS_CONTINUE) {
 			seq_puts(seq, ",errors=remount-ro");
 		}
 	}
-	if (test_opt(sb, ERRORS_CONT))
+	if (test_opt(sb, ERRORS_CONT) && def_errors != EXT4_ERRORS_CONTINUE)
 		seq_puts(seq, ",errors=continue");
-	if (test_opt(sb, ERRORS_PANIC))
+	if (test_opt(sb, ERRORS_PANIC)&& def_errors != EXT4_ERRORS_PANIC)
 		seq_puts(seq, ",errors=panic");
-	if (test_opt(sb, NO_UID32))
+	if (test_opt(sb, NO_UID32) && !(def_mount_opts & EXT4_DEFM_UID16))
 		seq_puts(seq, ",nouid32");
-	if (test_opt(sb, DEBUG))
+	if (test_opt(sb, DEBUG) && !(def_mount_opts & EXT4_DEFM_DEBUG))
 		seq_puts(seq, ",debug");
 	if (test_opt(sb, OLDALLOC))
 		seq_puts(seq, ",oldalloc");
 #ifdef CONFIG_EXT4_FS_XATTR
-	if (test_opt(sb, XATTR_USER))
+	if (test_opt(sb, XATTR_USER) &&
+	    !(def_mount_opts & EXT4_DEFM_XATTR_USER)) {
 		seq_puts(seq, ",user_xattr");
 	if (!test_opt(sb, XATTR_USER) &&
 	    (def_mount_opts & EXT4_DEFM_XATTR_USER)) {
@@ -718,7 +719,7 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
 	}
 #endif
 #ifdef CONFIG_EXT4_FS_POSIX_ACL
-	if (test_opt(sb, POSIX_ACL))
+	if (test_opt(sb, POSIX_ACL) && !(def_mount_opts & EXT4_DEFM_ACL))
 		seq_puts(seq, ",acl");
 	if (!test_opt(sb, POSIX_ACL) && (def_mount_opts & EXT4_DEFM_ACL))
 		seq_puts(seq, ",noacl");
@@ -742,6 +743,10 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
 	if (!test_opt(sb, DELALLOC))
 		seq_puts(seq, ",nodelalloc");
 
+	/*
+	 * journal mode get enabled in different ways
+	 * So just print the value even if we didn't specify it
+	 */
 	if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
 		seq_puts(seq, ",data=journal");
 	else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA)
@@ -750,7 +755,6 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
 		seq_puts(seq, ",data=writeback");
 
 	ext4_show_quota_options(seq, sb);
-
 	return 0;
 }
 
@@ -1145,7 +1149,7 @@ static int parse_options (char *options, struct super_block *sb,
 					return 0;
 				}
 			} else {
-				sbi->s_mount_opt &= ~EXT4_MOUNT_DATA_FLAGS;
+				clear_opt(sbi->s_mount_opt, DATA_FLAGS);
 				sbi->s_mount_opt |= data_opt;
 			}
 			break;
Signature · 1 line
1.5.3.4.319.gdd817-dirty
#8 lore raw

Re: [PATCH] ext4: Fix ext4_show_options to show the correct mount options.

Quoted 3 lines · Aneesh Kumar K.V

We need to look at the default value and make sure the mount options are not set via default value before showing them via ext4_show_options

Hm, does this jive with the comment about what's intended?

/*
* Show an option if
* - it's set to a non-default value OR
* - if the per-sb default is different from the global default */

Aren't you now omitting the option if it's set in the per-sb default?

For example the "debug" option; it's off by default, globally. The above comment suggests that if you have overridden that global default in the per-sb "default mount options" then it should be shown; this sort of makes sense to me because tune2fs calls these "default mount options," I'd expect them to behave exactly as if you had explicitly mounted with them.

With your patch, if you've set debug as default, it no longer shows up, right?

-Eric

#9 lore raw

Re: [PATCH] ext4: Fix ext4_show_options to show the correct mount options.

Quoted 22 lines · Eric Sandeen
Quoted 3 lines · Aneesh Kumar K.V

We need to look at the default value and make sure the mount options are not set via default value before showing them via ext4_show_options

Hm, does this jive with the comment about what's intended?

/*
* Show an option if
* - it's set to a non-default value OR
* - if the per-sb default is different from the global default */

Aren't you now omitting the option if it's set in the per-sb default?

For example the "debug" option; it's off by default, globally. The above comment suggests that if you have overridden that global default in the per-sb "default mount options" then it should be shown; this sort of makes sense to me because tune2fs calls these "default mount options," I'd expect them to behave exactly as if you had explicitly mounted with them.

Quoted 2 lines

With your patch, if you've set debug as default, it no longer shows up, right?

I was looking at commit 93d44cb275f3eba720617a8c5b00d51a8e0e9049

Using mtab is problematic for various reasons, one of them is that
unprivileged mounts won't turn up in there. So we want to get rid of it, and use /proc/mounts instead.

But most filesystems are lazy, and are not showing all mount options. Which means, that without mtab, the user won't be able to see some or all of the options.

It would be nice if the generic code could remember the mount options, and show them without the need to add extra code to filesystems. But this is not easy, because different filesystems handle mount options given options, and not tough the rest. This is not taken into account by mount(8) either, so /etc/mtab will be broken in this case.

So my understanding was that we are supposed to make /proc/mounts show the same output as /etc/mtab did. In that case should we be showing the the default set in super block ?

-aneesh

#10 lore raw

Re: [PATCH] ext4: Fix ext4_show_options to show the correct mount options.

Quoted 4 lines · Aneesh Kumar K.V

So my understanding was that we are supposed to make /proc/mounts show the same output as /etc/mtab did. In that case should we be showing the the default set in super block ?

-aneesh

Hm, well, it's true that they would not show up in mtab... but to me it's logical that "default mount options" set via tunefs *should* show up as options if they are not set to fs defaults. And using /proc/mounts has the advantage that they *can* show up.

I guess I'm not sure of the pros or cons of either approach. :)

-Eric

Acked-by on v1 1/1
#11 lore raw

Re: [PATCH] ext4: Show mballoc and delalloc options

In reply to Aneesh Kumar K.V
Quoted 5 lines · Aneesh Kumar K.V

Both these options are enabled by default. So if they are are not set in mount options that means the user explicity disabled them using nomablloc and nodelalloc option. Show the same in ext4_show_options

Looks good,

Quoted 24 lines
---
 fs/ext4/super.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
fs/ext4/super.c +6 -0
index 0c32dc8..f1f70ce 100644
@@ -733,8 +733,14 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
 		seq_puts(seq, ",barrier=1");
 	if (test_opt(sb, NOBH))
 		seq_puts(seq, ",nobh");
+
+	/* extents,mballoc and delalloc are enabled by default */
 	if (!test_opt(sb, EXTENTS))
 		seq_puts(seq, ",noextents");
+	if (!test_opt(sb, MBALLOC))
+		seq_puts(seq, ",nomballoc");
+	if (!test_opt(sb, DELALLOC))
+		seq_puts(seq, ",nodelalloc");
 
 	if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
 		seq_puts(seq, ",data=journal");
#12 lore raw

Re: [PATCH] ext4: Enable delalloc and mballoc by default.

In reply to Aneesh Kumar K.V

fs/ext4/super.c clear_qf_name: · line 1282

Quoted 4 lines · Aneesh Kumar K.V
fs/ext4/super.c +0 -0
@@ -1279,6 +1280,9 @@ clear_qf_name:
 		case Opt_delalloc:
 			set_opt (sbi->s_mount_opt, DELALLOC);
 			break;

If delalloc, mballoc, extents are the new defaults, is there a reason to keep them as options? When would you need to specify -o extents, now, for example? (though my brain is fuzzy today, maybe I'm missing something) If this were not a filesystem ending in "dev" I could see keeping it for compatibility with existing fstabs....

fs/ext4/super.c static int ext4_fill_super (struct super_block *sb, void *data, int silent) · line 1829

Quoted 9 lines
fs/ext4/super.c +3 -0
+		case Opt_nodelalloc:
+			clear_opt (sbi->s_mount_opt, DELALLOC);
+			break;
 		case Opt_mballoc:
 			set_opt(sbi->s_mount_opt, MBALLOC);
 			break;
@@ -1824,6 +1828,8 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
 	 * User -o noextents to turn it off
 	 */

I'd either update this comment ^^^^ or remove it, I think.

Quoted 6 lines
fs/ext4/super.c +2 -0
 	set_opt(sbi->s_mount_opt, EXTENTS);
+	set_opt(sbi->s_mount_opt, DELALLOC);
+	set_opt(sbi->s_mount_opt, MBALLOC);
 
 	if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum,
 			    NULL, 0))
#13 lore raw

Re: [PATCH] ext4: Enable delalloc and mballoc by default.

Quoted 13 lines · Eric Sandeen

fs/ext4/super.c clear_qf_name: · line 1282

Quoted 4 lines · Aneesh Kumar K.V
fs/ext4/super.c +0 -0
@@ -1279,6 +1280,9 @@ clear_qf_name:
 		case Opt_delalloc:
 			set_opt (sbi->s_mount_opt, DELALLOC);
 			break;

If delalloc, mballoc, extents are the new defaults, is there a reason to keep them as options? When would you need to specify -o extents, now, for example? (though my brain is fuzzy today, maybe I'm missing something) If this were not a filesystem ending in "dev" I could see keeping it for compatibility with existing fstabs....

Most of the options have the <option> no<option> pairs. I guess we would need it so that kernel won't throw the error "Unrecognized mount option "

I am also not sure whether we will have the above patch merged upstream when we push mballoc and delalloc.

Quoted 13 lines

fs/ext4/super.c static int ext4_fill_super (struct super_block *sb, void *data, int silent) · line 1829

Quoted 9 lines
fs/ext4/super.c +3 -0
+		case Opt_nodelalloc:
+			clear_opt (sbi->s_mount_opt, DELALLOC);
+			break;
 		case Opt_mballoc:
 			set_opt(sbi->s_mount_opt, MBALLOC);
 			break;
@@ -1824,6 +1828,8 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
 	 * User -o noextents to turn it off
 	 */

I'd either update this comment ^^^^ or remove it, I think.

Quoted 1 line

I will remove it. Anybody reading the kernel code should be able to figure it out.

-aneesh

#14 lore raw

Re: [PATCH] ext4: Enable delalloc and mballoc by default.

In reply to Eric Sandeen
Quoted 11 lines · Eric Sandeen

fs/ext4/super.c clear_qf_name: · line 1282

Quoted 4 lines · Aneesh Kumar K.V
fs/ext4/super.c +0 -0
@@ -1279,6 +1280,9 @@ clear_qf_name:
 		case Opt_delalloc:
 			set_opt (sbi->s_mount_opt, DELALLOC);
 			break;

If delalloc, mballoc, extents are the new defaults, is there a reason to keep them as options? When would you need to specify -o extents, now, for example?

For extents, personally I think we should make it default for ext4 and
remove this option. But as far as I rememember, from one of prevous
the ext4 meeting, it was decided to make extents as default for ext4dev, but for ext4 it was undecided.

For delayed allocation, before we have ordered mode support, we can't make it default and still need this option.

Quoted 27 lines

(though my brain is fuzzy today, maybe I'm missing something) If this were not a filesystem ending in "dev" I could see keeping it for compatibility with existing fstabs....

fs/ext4/super.c static int ext4_fill_super (struct super_block *sb, void *data, int silent) · line 1829

Quoted 9 lines
fs/ext4/super.c +3 -0
+		case Opt_nodelalloc:
+			clear_opt (sbi->s_mount_opt, DELALLOC);
+			break;
 		case Opt_mballoc:
 			set_opt(sbi->s_mount_opt, MBALLOC);
 			break;
@@ -1824,6 +1828,8 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
 	 * User -o noextents to turn it off
 	 */

I'd either update this comment ^^^^ or remove it, I think.

fs/ext4/super.c static int ext4_fill_super (struct super_block *sb, void *data, int silent) · line 1835

Quoted 6 lines
fs/ext4/super.c +2 -0
 	set_opt(sbi->s_mount_opt, EXTENTS);
+	set_opt(sbi->s_mount_opt, DELALLOC);
+	set_opt(sbi->s_mount_opt, MBALLOC);
 
 	if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum,
 			    NULL, 0))

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

#15 lore raw

Re: [PATCH] ext4: Enable delalloc and mballoc by default.

In reply to Eric Sandeen
Quoted 11 lines · Eric Sandeen

fs/ext4/super.c clear_qf_name: · line 1282

Quoted 4 lines · Aneesh Kumar K.V
fs/ext4/super.c +0 -0
@@ -1279,6 +1280,9 @@ clear_qf_name:
 		case Opt_delalloc:
 			set_opt (sbi->s_mount_opt, DELALLOC);
 			break;

If delalloc, mballoc, extents are the new defaults, is there a reason to keep them as options? When would you need to specify -o extents, now, for example? (though my brain is fuzzy today, maybe I'm missing something) If this were not a filesystem ending in "dev" I could see keeping it for compatibility with existing fstabs....

It is useful to be able to mount w/o extents/delalloc/mballoc for perf testing and functional testing of the block-mapped file path in ext4. Also, some users might want the ability to use features of ext4 w/o the incompatibility of extents.

Quoted 3 lines

fs/ext4/super.c static int ext4_fill_super (struct super_block *sb, void *data, int silent) · line 1832

Quoted 3 lines
fs/ext4/super.c +2 -0
 	set_opt(sbi->s_mount_opt, EXTENTS);
+	set_opt(sbi->s_mount_opt, DELALLOC);
+	set_opt(sbi->s_mount_opt, MBALLOC);

I think the other thing to do is enable the INCOMPAT_EXTENTS flag in mkfs.ext4 by default, so that extents is enabled/disabled in the same manner as other ext* features. We can remove the above once we have an e2fsprogs that specifically sets all of the ext4 features (large inodes, etc) for ext4 filesystems.

Cheers, Andreas
--
Andreas Dilger
Sr. Software Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

#16 lore raw

Re: [PATCH] ext4: Enable delalloc and mballoc by default.

Quoted 12 lines · Andreas Dilger
Quoted 10 lines · Eric Sandeen

fs/ext4/super.c clear_qf_name: · line 1282

Quoted 4 lines · Aneesh Kumar K.V
fs/ext4/super.c +0 -0
@@ -1279,6 +1280,9 @@ clear_qf_name:
 		case Opt_delalloc:
 			set_opt (sbi->s_mount_opt, DELALLOC);
 			break;

If delalloc, mballoc, extents are the new defaults, is there a reason to keep them as options? When would you need to specify -o extents, now, for example? (though my brain is fuzzy today, maybe I'm missing something) If this were not a filesystem ending in "dev" I could see keeping it for compatibility with existing fstabs....

Quoted 4 lines

It is useful to be able to mount w/o extents/delalloc/mballoc for perf testing and functional testing of the block-mapped file path in ext4. Also, some users might want the ability to use features of ext4 w/o the incompatibility of extents.

Right, I understand the reason for noextents, nodelalloc, nomballoc. Above, I ask what is the point of having the *defaults* (extents, delalloc, mballoc) as mount options?

-Eric

#17 lore raw

Re: [PATCH] ext4: Enable delalloc and mballoc by default.

Quoted 9 lines · Eric Sandeen
Quoted 4 lines · Andreas Dilger

It is useful to be able to mount w/o extents/delalloc/mballoc for perf testing and functional testing of the block-mapped file path in ext4. Also, some users might want the ability to use features of ext4 w/o the incompatibility of extents.

Right, I understand the reason for noextents, nodelalloc, nomballoc. Above, I ask what is the point of having the *defaults* (extents, delalloc, mballoc) as mount options?

Partly for symmetry, and also to be able to override any "no*" options that might have been specified previously (e.g. in some script that the user doesn't directly control, but can pass additional options to).

Cheers, Andreas
--
Andreas Dilger
Sr. Software Engineer, Lustre Group
Sun Microsystems of Canada, Inc.