Baryl Low writes:
> I'm not sure if this is a known bug already, but, version 1.19 of mke2fs
> doesn't handle the "-r0" switch properly. It sets the version to zero, but
> goes right ahead doing version one stuff like filling the feature bitmaps,
> serial number and activating sparse superblocks and the filetype feature.
I had noticed the sparse-super bug a while ago myself, and made the
following patch. It seems it isn't in the current e2fsprogs. Here is
my previous patch, that looks like it should apply cleanly to 1.19 and
1.20 as well. Give it a shot and let me know how it works, so I can
forward it on to Ted for 1.20.
As for the UUID, a newer e2fsck will add this on ALL filesystems even
if they are rev 0, IIRC, so that it is possible to use mount-by-uuid.
Cheers, Andreas
-------------------------------------------------------------------------
diff -ru e2fsprogs-1.18/misc/mke2fs.c e2fsprogs-1.18a/misc/mke2fs.c
--- e2fsprogs-1.18/misc/mke2fs.c Tue Oct 26 10:30:40 1999
+++ e2fsprogs-1.18a/misc/mke2fs.c Mon Feb 28 13:46:24 2000
@@ -719,13 +719,13 @@
int reserved_ratio = 5;
ino_t num_inodes = 0;
errcode_t retval;
- int sparse_option = 0;
+ int sparse_option = 1;
char * oldpath = getenv("PATH");
struct ext2fs_sb *param_ext2 = (struct ext2fs_sb *) ¶m;
char * raid_opts = 0;
char * fs_type = 0;
- const char * feature_set = "filetype,sparse_super";
+ const char * feature_set = "filetype";
blk_t dev_size;
#ifdef linux
struct utsname ut;
@@ -736,7 +736,7 @@
if ((ut.release[0] == '1') ||
(ut.release[0] == '2' && ut.release[1] == '.' &&
ut.release[2] < '2' && ut.release[3] == '.'))
- feature_set = 0;
+ feature_set = NULL;
#endif
/* Update our PATH to include /sbin */
if (oldpath) {
@@ -961,12 +961,17 @@
param.s_r_blocks_count = (param.s_blocks_count * reserved_ratio) / 100;
#ifdef EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER
+ /* Turn off features not supported by the earlier filesystem version */
+ if (param.s_rev_level == 0) {
+ sparse_option = 0;
+ feature_set = NULL;
+ }
if (sparse_option)
param_ext2->s_feature_ro_compat |=
EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER;
#endif
if (feature_set && !strncasecmp(feature_set, "none", 4))
- feature_set = 0;
+ feature_set = NULL;
if (feature_set && e2p_edit_feature(feature_set,
¶m_ext2->s_feature_compat,
ok_features)) {
--
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]