public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH, RFC] Add new "development flag" to the ext4 filesystem
@ 2008-01-22 23:17 Theodore Tso
  2008-01-23  3:55 ` Eric Sandeen
  2008-01-30 22:26 ` supersud501
  0 siblings, 2 replies; 12+ messages in thread
From: Theodore Tso @ 2008-01-22 23:17 UTC (permalink / raw)
  To: linux-ext4

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

As discussed on RFC, this flag is simply a generic "this is a
crash/burn test filesystem" marker.  If it is set, then filesystem
code which is "in development" will be allowed to mount the
filesystem.  Filesystem code which is not considered ready for
prime-time will check for this flag, and if it is not set, it will
refuse to touch the filesystem.

As we start rolling ext4 out to distro's like Fedora, et. al, this
makes it less likely that a user might accidentally start using ext4
on a production filesystem; a bad thing, since that will essentially
make it be unfsckable until e2fsprogs catches up.

						- Ted


[-- Attachment #2: kernel.patch --]
[-- Type: text/x-diff, Size: 1408 bytes --]

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index cf2f612..a8c599a 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1991,6 +1991,17 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
 		printk(KERN_WARNING
 		       "EXT4-fs warning: feature flags set on rev 0 fs, "
 		       "running e2fsck is recommended\n");
+
+	/*
+	 * Since ext4 is still considered development code, we require
+	 * that the TEST_FILESYS flag in s->flags be set.
+	 */
+	if (!(le32_to_cpu(es->s_flags) & EXT2_FLAGS_TEST_FILESYS)) {
+		printk(KERN_WARNING, "EXT4-fs: %s: test filesystem flag "
+		       "not set.\n");
+		goto failed_mount;
+	}
+
 	/*
 	 * Check feature flags regardless of the revision level, since we
 	 * previously didn't change the revision level when setting the flags,
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index 98d1c3c..d203543 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -547,6 +547,13 @@ do {									       \
 #define	EXT4_ORPHAN_FS			0x0004	/* Orphans being recovered */
 
 /*
+ * Misc. filesystem flags
+ */
+#define EXT2_FLAGS_SIGNED_HASH		0x0001  /* Signed dirhash in use */
+#define EXT2_FLAGS_UNSIGNED_HASH	0x0002  /* Unsigned dirhash in use */
+#define EXT2_FLAGS_TEST_FILESYS		0x0004	/* OK for use on development code */
+
+/*
  * Mount flags
  */
 #define EXT4_MOUNT_CHECK		0x00001	/* Do mount-time checks */

[-- Attachment #3: e2fsprogs.patch --]
[-- Type: text/x-diff, Size: 4836 bytes --]

diff --git a/lib/e2p/ls.c b/lib/e2p/ls.c
index b9ae14a..957ba5b 100644
--- a/lib/e2p/ls.c
+++ b/lib/e2p/ls.c
@@ -147,11 +147,15 @@ static void print_super_flags(struct ext2_super_block * s, FILE *f)
 
 	fputs("Filesystem flags:         ", f);
 	if (s->s_flags & EXT2_FLAGS_SIGNED_HASH) {
-		fputs("signed directory hash ", f);
+		fputs("signed_directory_hash ", f);
 		flags_found++;
 	}
 	if (s->s_flags & EXT2_FLAGS_UNSIGNED_HASH) {
-		fputs("unsigned directory hash ", f);
+		fputs("unsigned_directory_hash ", f);
+		flags_found++;
+	}
+	if (s->s_flags & EXT2_FLAGS_TEST_FILESYS) {
+		fputs("test_filesystem ", f);
 		flags_found++;
 	}
 	if (flags_found)
diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h
index e096577..dd5e495 100644
--- a/lib/ext2fs/ext2_fs.h
+++ b/lib/ext2fs/ext2_fs.h
@@ -467,12 +467,14 @@ struct ext2_inode_large {
  */
 #define EXT2_VALID_FS			0x0001	/* Unmounted cleanly */
 #define EXT2_ERROR_FS			0x0002	/* Errors detected */
+#define EXT4_ORPHAN_FS			0x0004	/* Orphans being recovered */
 
 /*
  * Misc. filesystem flags
  */
 #define EXT2_FLAGS_SIGNED_HASH		0x0001  /* Signed dirhash in use */
 #define EXT2_FLAGS_UNSIGNED_HASH	0x0002  /* Unsigned dirhash in use */
+#define EXT2_FLAGS_TEST_FILESYS		0x0004	/* OK for use on development code */
 
 /*
  * Mount flags
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 7a360ea..e754d6b 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -849,6 +849,8 @@ static void parse_extended_opts(struct ext2_super_block *param,
 
 				param->s_reserved_gdt_blocks = rsv_gdb;
 			}
+		} else if (!strcmp(token, "test_fs")) {
+			param->s_flags |= EXT2_FLAGS_TEST_FILESYS;
 		} else
 			r_usage++;
 	}
@@ -859,7 +861,8 @@ static void parse_extended_opts(struct ext2_super_block *param,
 			"\tis set off by an equals ('=') sign.\n\n"
 			"Valid extended options are:\n"
 			"\tstride=<stride length in blocks>\n"
-			"\tresize=<resize maximum size in blocks>\n\n"));
+			"\tresize=<resize maximum size in blocks>\n"
+			"\ttest_fs\n"));
 		free(buf);
 		exit(1);
 	}
@@ -1556,6 +1559,9 @@ int main (int argc, char *argv[])
 		exit(1);
 	}
 
+	if (fs_param.s_flags & EXT2_FLAGS_TEST_FILESYS)
+		fs->super->s_flags |= EXT2_FLAGS_TEST_FILESYS;
+
 	/*
 	 * Wipe out the old on-disk superblock
 	 */
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 833b994..a714530 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -71,6 +71,7 @@ static unsigned short errors;
 static int open_flag;
 static char *features_cmd;
 static char *mntopts_cmd;
+static char *extended_cmd;
 
 int journal_size, journal_flags;
 char *journal_device;
@@ -505,7 +506,7 @@ static void parse_tune2fs_options(int argc, char **argv)
 	struct passwd * pw;
 
 	printf("tune2fs %s (%s)\n", E2FSPROGS_VERSION, E2FSPROGS_DATE);
-	while ((c = getopt(argc, argv, "c:e:fg:i:jlm:o:r:s:u:C:J:L:M:O:T:U:")) != EOF)
+	while ((c = getopt(argc, argv, "c:e:fg:i:jlm:o:r:s:u:C:E:J:L:M:O:T:U:")) != EOF)
 		switch (c)
 		{
 			case 'c':
@@ -548,6 +549,10 @@ static void parse_tune2fs_options(int argc, char **argv)
 				e_flag = 1;
 				open_flag = EXT2_FLAG_RW;
 				break;
+			case 'E':
+				extended_cmd = optarg;
+				open_flag = EXT2_FLAG_RW;
+				break;
 			case 'f': /* Force */
 				f_flag = 1;
 				break;
@@ -739,6 +744,56 @@ void do_findfs(int argc, char **argv)
 	exit(0);
 }
 
+static void parse_extended_opts(ext2_filsys fs, const char *opts)
+{
+	char	*buf, *token, *next, *p, *arg;
+	int	len;
+	int	r_usage = 0;
+
+	len = strlen(opts);
+	buf = malloc(len+1);
+	if (!buf) {
+		fprintf(stderr,
+			_("Couldn't allocate memory to parse options!\n"));
+		exit(1);
+	}
+	strcpy(buf, opts);
+	for (token = buf; token && *token; token = next) {
+		p = strchr(token, ',');
+		next = 0;
+		if (p) {
+			*p = 0;
+			next = p+1;
+		}
+		arg = strchr(token, '=');
+		if (arg) {
+			*arg = 0;
+			arg++;
+		}
+		if (!strcmp(token, "test_fs")) {
+			fs->super->s_flags |= EXT2_FLAGS_TEST_FILESYS;
+			printf("Setting test filesystem flag\n");
+			ext2fs_mark_super_dirty(fs);
+		} else if (!strcmp(token, "production_fs")) {
+			fs->super->s_flags &= ~EXT2_FLAGS_TEST_FILESYS;
+			printf("Clearing test filesystem flag\n");
+			ext2fs_mark_super_dirty(fs);
+		} else
+			r_usage++;
+	}
+	if (r_usage) {
+		fprintf(stderr, _("\nBad options specified.\n\n"
+			"Extended options are separated by commas, "
+			"and may take an argument which\n"
+			"\tis set off by an equals ('=') sign.\n\n"
+			"Valid extended options are:\n"
+			"\ttestfs\n"));
+		free(buf);
+		exit(1);
+	}
+	free(buf);
+}	
+
 
 int main (int argc, char ** argv)
 {
@@ -902,6 +957,8 @@ int main (int argc, char ** argv)
 		update_mntopts(fs, mntopts_cmd);
 	if (features_cmd)
 		update_feature_set(fs, features_cmd);
+	if (extended_cmd)
+		parse_extended_opts(fs, extended_cmd);
 	if (journal_size || journal_device)
 		add_journal(fs);
 	

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH, RFC] Add new "development flag" to the ext4 filesystem
  2008-01-22 23:17 [PATCH, RFC] Add new "development flag" to the ext4 filesystem Theodore Tso
@ 2008-01-23  3:55 ` Eric Sandeen
  2008-01-23 16:53   ` Theodore Tso
  2008-01-30 22:26 ` supersud501
  1 sibling, 1 reply; 12+ messages in thread
From: Eric Sandeen @ 2008-01-23  3:55 UTC (permalink / raw)
  To: Theodore Tso; +Cc: linux-ext4

Theodore Tso wrote:
> As discussed on RFC, this flag is simply a generic "this is a
> crash/burn test filesystem" marker.  If it is set, then filesystem
> code which is "in development" will be allowed to mount the
> filesystem.  Filesystem code which is not considered ready for
> prime-time will check for this flag, and if it is not set, it will
> refuse to touch the filesystem.
> 
> As we start rolling ext4 out to distro's like Fedora, et. al, this
> makes it less likely that a user might accidentally start using ext4
> on a production filesystem; a bad thing, since that will essentially
> make it be unfsckable until e2fsprogs catches up.
> 
> 						- Ted
> 

Overall, seems ok.  One other question though, when ext4 is a
fully-fledged production filesystem, and the flag requirement is gone,
what stops ext3 filesystems from being silently mounted as ext4, just as
happened with ext4dev today?  Will users need to be sure everything
explicitly mounts -t ext3 to avoid this?


+static void parse_extended_opts(ext2_filsys fs, const char *opts)

...

+		if (!strcmp(token, "test_fs")) {
+			fs->super->s_flags |= EXT2_FLAGS_TEST_FILESYS;
+			printf("Setting test filesystem flag\n");
+			ext2fs_mark_super_dirty(fs);
+		} else if (!strcmp(token, "production_fs")) {
+			fs->super->s_flags &= ~EXT2_FLAGS_TEST_FILESYS;
+			printf("Clearing test filesystem flag\n");
+			ext2fs_mark_super_dirty(fs);
+		} else
+			r_usage++;
+	}
+	if (r_usage) {
+		fprintf(stderr, _("\nBad options specified.\n\n"
+			"Extended options are separated by commas, "
+			"and may take an argument which\n"
+			"\tis set off by an equals ('=') sign.\n\n"
+			"Valid extended options are:\n"
+			"\ttestfs\n"));

help text doesn't match reality here, missing a "_"

-Eric

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, RFC] Add new "development flag" to the ext4 filesystem
  2008-01-23  3:55 ` Eric Sandeen
@ 2008-01-23 16:53   ` Theodore Tso
  2008-01-23 17:04     ` Eric Sandeen
  2008-01-23 21:50     ` Andreas Dilger
  0 siblings, 2 replies; 12+ messages in thread
From: Theodore Tso @ 2008-01-23 16:53 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-ext4

On Tue, Jan 22, 2008 at 09:55:37PM -0600, Eric Sandeen wrote:
> 
> Overall, seems ok.  One other question though, when ext4 is a
> fully-fledged production filesystem, and the flag requirement is gone,
> what stops ext3 filesystems from being silently mounted as ext4, just as
> happened with ext4dev today?  

Nothing will prevent that, but in the long term we don't want ext4 to
be automatically adding new features flags anyway.  The only reason
why we were doing that was to encourage more people to test out ext4,
and for the convenience of the ABAT auto-testing.

So I'm assuming that before we remove this test, we will also be
fixing some of the automatic enablement of extents, etc., because that
sort of thing will be moved into e2fsprogs as part of "tune2fs -O
ext4" or "mke2fs -O ext4" or "mkfs.ext4". 

If we do that, then the only downside of having ext3 filesystems run
under ext4 is the test matrix concern.  Since I'm still hoping that
some point in the future, fs/ext4 could subsume fs/ext3 so we don't
have to worry about bug fixes going into fs/ext2 AND fs/ext3 AND
fs/ext4, I have my own reasons for wanting that.  But I do understand
the concerns that maybe in the short term some distro's don't want to
do that.  So in that case I could see adding a "you must have extents"
test into ext4, if I distro has specific support concerns. But for
people who are running mainline kernel, I think it's actually a *good*
thing if fs/ext4 can mount and read and write to an ext3 filesystem
--- as long as it doesn't automatically turn on features behind the
user's back.

> +			"\ttestfs\n"));
> 
> help text doesn't match reality here, missing a "_"

Oops, thanks for catching that.

						- Ted

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, RFC] Add new "development flag" to the ext4 filesystem
  2008-01-23 16:53   ` Theodore Tso
@ 2008-01-23 17:04     ` Eric Sandeen
  2008-01-23 17:26       ` Theodore Tso
  2008-01-23 21:50     ` Andreas Dilger
  1 sibling, 1 reply; 12+ messages in thread
From: Eric Sandeen @ 2008-01-23 17:04 UTC (permalink / raw)
  To: Theodore Tso; +Cc: linux-ext4

Theodore Tso wrote:

> If we do that, then the only downside of having ext3 filesystems run
> under ext4 is the test matrix concern.  Since I'm still hoping that
> some point in the future, fs/ext4 could subsume fs/ext3 so we don't
> have to worry about bug fixes going into fs/ext2 AND fs/ext3 AND
> fs/ext4, I have my own reasons for wanting that.  But I do understand
> the concerns that maybe in the short term some distro's don't want to
> do that.  So in that case I could see adding a "you must have extents"
> test into ext4, if I distro has specific support concerns. But for
> people who are running mainline kernel, I think it's actually a *good*
> thing if fs/ext4 can mount and read and write to an ext3 filesystem
> --- as long as it doesn't automatically turn on features behind the
> user's back.

Well, sure, the ability of ext4 code to mount,read,write ext3
filesystems is fine, esp. if ext4.ko stops doing things which makes it
hard to go back to ext3.  And, I do like the long-term plan of ext4
replacing ext3, it's a bit of a pain to keep this all in sync.

I just think that ext4.ko running ext3 filesystems needs to be under
explicit control, and not something that happens, occasionally,
accidentally, without the user/administrator requesting it.  Least
surprise, and all that...

-Eric

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, RFC] Add new "development flag" to the ext4 filesystem
  2008-01-23 17:04     ` Eric Sandeen
@ 2008-01-23 17:26       ` Theodore Tso
  0 siblings, 0 replies; 12+ messages in thread
From: Theodore Tso @ 2008-01-23 17:26 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-ext4

On Wed, Jan 23, 2008 at 11:04:35AM -0600, Eric Sandeen wrote:
> 
> I just think that ext4.ko running ext3 filesystems needs to be under
> explicit control, and not something that happens, occasionally,
> accidentally, without the user/administrator requesting it.  Least
> surprise, and all that...
> 

Well, most of the time that will happen, given that /etc/fstab
explicitly states which filesystem to use; and if the user doesn't
specify a filesystme type, mount will use blkid/vol_id, and if that
says ext3, then ext3 will be used.  The only time where it might not
happen without an explicit administrator request is on the root
filesystem automount.... and if you are using an initrd to mount the
filesystem (as all of the enterprise distros now do anyway), that
could be easily controlled form userspace as well.

						- Ted

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, RFC] Add new "development flag" to the ext4 filesystem
  2008-01-23 16:53   ` Theodore Tso
  2008-01-23 17:04     ` Eric Sandeen
@ 2008-01-23 21:50     ` Andreas Dilger
  2008-01-25 10:05       ` Jan Kara
  1 sibling, 1 reply; 12+ messages in thread
From: Andreas Dilger @ 2008-01-23 21:50 UTC (permalink / raw)
  To: Theodore Tso; +Cc: Eric Sandeen, linux-ext4

On Jan 23, 2008  11:53 -0500, Theodore Tso wrote:
> Since I'm still hoping that
> some point in the future, fs/ext4 could subsume fs/ext3 so we don't
> have to worry about bug fixes going into fs/ext2 AND fs/ext3 AND
> fs/ext4, I have my own reasons for wanting that.

If any newbie kernel hacker wants a filesystem project, allowing ext4
to mount ext2 filesystems w/o a journal would be very useful.  I
suspect that a simple flag check in the ext4_journal_* wrappers of the
jbd2 functions would be enough in many cases.

One of the reasons to keep ext2 around is that ext3 cannot mount the
filesystem without a journal, and removing that limitation for ext4
would bring us one step closer to removing a ton of duplicate code.
Another reason for ext2 vs. ext3 was overhead from journaling, and
that could also be removed by allowing ext4 to mount ext2 filesystems
w/o a journal.

Maybe a good proposal for a Google Summer-of-Code project.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, RFC] Add new "development flag" to the ext4 filesystem
  2008-01-23 21:50     ` Andreas Dilger
@ 2008-01-25 10:05       ` Jan Kara
  2008-01-25 10:50         ` Andreas Dilger
  0 siblings, 1 reply; 12+ messages in thread
From: Jan Kara @ 2008-01-25 10:05 UTC (permalink / raw)
  To: Theodore Tso, Eric Sandeen, linux-ext4

  Hi,

> On Jan 23, 2008  11:53 -0500, Theodore Tso wrote:
> > Since I'm still hoping that
> > some point in the future, fs/ext4 could subsume fs/ext3 so we don't
> > have to worry about bug fixes going into fs/ext2 AND fs/ext3 AND
> > fs/ext4, I have my own reasons for wanting that.
> 
> If any newbie kernel hacker wants a filesystem project, allowing ext4
> to mount ext2 filesystems w/o a journal would be very useful.  I
> suspect that a simple flag check in the ext4_journal_* wrappers of the
> jbd2 functions would be enough in many cases.
> 
> One of the reasons to keep ext2 around is that ext3 cannot mount the
> filesystem without a journal, and removing that limitation for ext4
> would bring us one step closer to removing a ton of duplicate code.
> Another reason for ext2 vs. ext3 was overhead from journaling, and
> that could also be removed by allowing ext4 to mount ext2 filesystems
> w/o a journal.
  Actually, folding ext2 into ext3/4 isn't as easy as one would guess in
the beginning. For example ext2 on fsync() just sync's a single inode
(and has to use private_list to track metadata buffers associated with
the inode) while ext3 flushes the whole journal. Also in ext2, directory
handling code is quite different. ext2 works in page cache of the
directory while ext3 uses page cache of the underlying device via buffer
heads - at least this second thing would be more or less mechanical
thing to change and would make sence (we wouldn't have to reimplement
readahead in ext3 directory handling code as we do now). I've looked at
it once but then more urgent things came and ... you know it.

								Honza
-- 
Jan Kara <jack@suse.cz>
SuSE CR Labs

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, RFC] Add new "development flag" to the ext4 filesystem
  2008-01-25 10:05       ` Jan Kara
@ 2008-01-25 10:50         ` Andreas Dilger
  2008-01-28 12:16           ` Jan Kara
  0 siblings, 1 reply; 12+ messages in thread
From: Andreas Dilger @ 2008-01-25 10:50 UTC (permalink / raw)
  To: Jan Kara; +Cc: Theodore Tso, Eric Sandeen, linux-ext4

On Jan 25, 2008  11:05 +0100, Jan Kara wrote:
> For example ext2 on fsync() just sync's a single inode
> (and has to use private_list to track metadata buffers associated with
> the inode) while ext3 flushes the whole journal.

As for fsync(), we definitely need to preserve correct behaviour for the
file itself, but there isn't a requirement that ext2 behave exactly like
ext3 (it of course cannot).  In the proposed ext4-mount-unjournaled-ext2
case, the superblock would be marked dirty as it is today and an e2fsck
would need to be run at boot time.  That is fine so long as the fsync()
will cause the one file's data to be on disk before it returns.

> In ext2, directory
> handling code is quite different. ext2 works in page cache of the
> directory while ext3 uses page cache of the underlying device via buffer
> heads - at least this second thing would be more or less mechanical
> thing to change and would make sence (we wouldn't have to reimplement
> readahead in ext3 directory handling code as we do now). I've looked at
> it once but then more urgent things came and ... you know it.

I don't think it is a requirement that ext3 mounting a filesystem without
a journal has to use page cache for directories.  I wouldn't object to
that being fixed.  It definitely isn't a requirement for this to work,
just an implementation difference.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, RFC] Add new "development flag" to the ext4 filesystem
  2008-01-25 10:50         ` Andreas Dilger
@ 2008-01-28 12:16           ` Jan Kara
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Kara @ 2008-01-28 12:16 UTC (permalink / raw)
  To: Theodore Tso, Eric Sandeen, linux-ext4

On Fri 25-01-08 03:50:04, Andreas Dilger wrote:
> On Jan 25, 2008  11:05 +0100, Jan Kara wrote:
> > For example ext2 on fsync() just sync's a single inode
> > (and has to use private_list to track metadata buffers associated with
> > the inode) while ext3 flushes the whole journal.
> 
> As for fsync(), we definitely need to preserve correct behaviour for the
> file itself, but there isn't a requirement that ext2 behave exactly like
> ext3 (it of course cannot).  In the proposed ext4-mount-unjournaled-ext2
> case, the superblock would be marked dirty as it is today and an e2fsck
> would need to be run at boot time.  That is fine so long as the fsync()
> will cause the one file's data to be on disk before it returns.
  Well, you have to also make sure that all indirect blocks are on disk
before fsync() returns. Otherwise there's not much point in the fact that
data itself reached the disk. And for that you need something like
private_list.

> > In ext2, directory
> > handling code is quite different. ext2 works in page cache of the
> > directory while ext3 uses page cache of the underlying device via buffer
> > heads - at least this second thing would be more or less mechanical
> > thing to change and would make sence (we wouldn't have to reimplement
> > readahead in ext3 directory handling code as we do now). I've looked at
> > it once but then more urgent things came and ... you know it.
> 
> I don't think it is a requirement that ext3 mounting a filesystem without
> a journal has to use page cache for directories.  I wouldn't object to
> that being fixed.  It definitely isn't a requirement for this to work,
> just an implementation difference.
  Yes, of course. I just wanted to point out that ext2 isn't a strict
subset of ext3 so there is some non-trivial work to be done before you can
safely mount ext2 as ext3-without-journal.

									Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, RFC] Add new "development flag" to the ext4 filesystem
  2008-01-22 23:17 [PATCH, RFC] Add new "development flag" to the ext4 filesystem Theodore Tso
  2008-01-23  3:55 ` Eric Sandeen
@ 2008-01-30 22:26 ` supersud501
  2008-01-30 22:48   ` Theodore Tso
  1 sibling, 1 reply; 12+ messages in thread
From: supersud501 @ 2008-01-30 22:26 UTC (permalink / raw)
  To: Theodore Tso; +Cc: linux-ext4

Theodore Tso wrote:
> As discussed on RFC, this flag is simply a generic "this is a
> crash/burn test filesystem" marker.  If it is set, then filesystem
> code which is "in development" will be allowed to mount the
> filesystem.  Filesystem code which is not considered ready for
> prime-time will check for this flag, and if it is not set, it will
> refuse to touch the filesystem.
> 
> As we start rolling ext4 out to distro's like Fedora, et. al, this
> makes it less likely that a user might accidentally start using ext4
> on a production filesystem; a bad thing, since that will essentially
> make it be unfsckable until e2fsprogs catches up.
> 
> 						- Ted
> 
> 

how can i set this "flag" on my filesystem? i've never set any flags 
before so i just removed the code from ext4-module to mount my 
filesystems, but setting the flag once would make it easier i think :)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, RFC] Add new "development flag" to the ext4 filesystem
  2008-01-30 22:26 ` supersud501
@ 2008-01-30 22:48   ` Theodore Tso
  2008-01-30 23:03     ` supersud501
  0 siblings, 1 reply; 12+ messages in thread
From: Theodore Tso @ 2008-01-30 22:48 UTC (permalink / raw)
  To: supersud501; +Cc: linux-ext4

On Wed, Jan 30, 2008 at 11:26:20PM +0100, supersud501 wrote:
>
> how can i set this "flag" on my filesystem? i've never set any flags before 
> so i just removed the code from ext4-module to mount my filesystems, but 
> setting the flag once would make it easier i think :)

If you have e2fsprogs 1.40.5, you set at mke2fs time via "mke2fs -E
test_fs ...".  If you haven't mounted the filesystem using ext4 yet,
you can also convert an existing filesystem using "tune2fs -E test_fs
/dev/hdXXX".  At least with e2fsprogs 1.40.5, it won't work with a
filesystem with extents enabled because tune2fs will refuse to touch
such a filesystem.  (And you don't want to use e2fsprogs 1.40.5 with
ext4 anyway, since e2fsck in 1.40.5 doesn't understand extents yet.)

You can manually set the flag using debugfs:

    # debugfs -w /dev/hdXX
    debugfs: set_super_value s_flags 4
    debugfs: quit

(Or, if you're lazy, you can also type the shorthand "ssv flags 4" to
debugfs.)

With e2fsprogs 1.40.5, if the test_fs flag is set, then blkid will
return a filesystem type ext4dev, such that if your mount is
configured to use blkid (instead of vol_id), it will automatically use
ext4dev to mount a filesystem that has (a) a journal (since ext4
currently requires a journal), and (b) the test_fs flag set.

This makes it easier for people who are testing ext4, since they will
just be able to do something like:

      # mke2fs -j -E test_fs /dev/mapper/lvmset-test
      # mount /dev/mapper/lvmset-test

.. and /dev/mapper/lvmset-test will automatically be mounted using
ext4.

							 - Ted

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH, RFC] Add new "development flag" to the ext4 filesystem
  2008-01-30 22:48   ` Theodore Tso
@ 2008-01-30 23:03     ` supersud501
  0 siblings, 0 replies; 12+ messages in thread
From: supersud501 @ 2008-01-30 23:03 UTC (permalink / raw)
  To: Theodore Tso; +Cc: linux-ext4

Theodore Tso wrote:

> 
> You can manually set the flag using debugfs:
> 
>     # debugfs -w /dev/hdXX
>     debugfs: set_super_value s_flags 4
>     debugfs: quit
> 
> (Or, if you're lazy, you can also type the shorthand "ssv flags 4" to
> debugfs.)
> 
> With e2fsprogs 1.40.5, if the test_fs flag is set, then blkid will
> return a filesystem type ext4dev, such that if your mount is
> configured to use blkid (instead of vol_id), it will automatically use
> ext4dev to mount a filesystem that has (a) a journal (since ext4
> currently requires a journal), and (b) the test_fs flag set.
> 
> This makes it easier for people who are testing ext4, since they will
> just be able to do something like:
> 
>       # mke2fs -j -E test_fs /dev/mapper/lvmset-test
>       # mount /dev/mapper/lvmset-test
> 
> .. and /dev/mapper/lvmset-test will automatically be mounted using
> ext4.
> 
> 							 - Ted

thanks for your quick answer! i think i've learned something more about 
ext4 and those flags.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-01-31  1:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-22 23:17 [PATCH, RFC] Add new "development flag" to the ext4 filesystem Theodore Tso
2008-01-23  3:55 ` Eric Sandeen
2008-01-23 16:53   ` Theodore Tso
2008-01-23 17:04     ` Eric Sandeen
2008-01-23 17:26       ` Theodore Tso
2008-01-23 21:50     ` Andreas Dilger
2008-01-25 10:05       ` Jan Kara
2008-01-25 10:50         ` Andreas Dilger
2008-01-28 12:16           ` Jan Kara
2008-01-30 22:26 ` supersud501
2008-01-30 22:48   ` Theodore Tso
2008-01-30 23:03     ` supersud501

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox