tags 488663 +pending
thanks

I've applied the following two patches to e2fsprogs's git repository.

                                          - Ted
>From b4d5105b2527a5279cf5b885b957e1e07a53e725 Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <[EMAIL PROTECTED]>
Date: Sun, 6 Jul 2008 20:24:29 -0400
Subject: [PATCH] mke2fs: Use a fs_type of 'journal' when creating an external journal

If creating a an external journal via "mke2fs -O journal_dev",
override the fs_type list (i.e., "ext2", "small"), and replace it with
an fs_type list of "journal".  This will prevent external journals
smaller than 512MB from being created with a block size of 1k, which
is not very useful and leads to much confusion.

Addresses-Debian-Bug: #488663

Signed-off-by: "Theodore Ts'o" <[EMAIL PROTECTED]>
---
 misc/mke2fs.c |   29 ++++++++++-------------------
 1 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index acb3054..c47470b 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1446,25 +1446,6 @@ static void PRS(int argc, char *argv[])
 		fprintf(stderr, _("Failed to parse fs types list\n"));
 		exit(1);
 	}
-	if (verbose) {
-		fputs("Fs_types for mke2fs.conf resolution: ", stdout);
-		print_str_list(fs_types);
-	}
-
-	if (!fs_type) {
-		int megs = (__u64)fs_param.s_blocks_count *
-			(EXT2_BLOCK_SIZE(&fs_param) / 1024) / 1024;
-
-		if (fs_param.s_feature_incompat & 
-		    EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)
-			fs_type = "journal";
-		else if (megs <= 3)
-			fs_type = "floppy";
-		else if (megs <= 512)
-			fs_type = "small";
-		else
-			fs_type = "default";
-	}
 
 	/* Figure out what features should be enabled */
 
@@ -1492,6 +1473,16 @@ static void PRS(int argc, char *argv[])
 	if (tmp)
 		free(tmp);
 
+	if (fs_param.s_feature_incompat & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) {
+		fs_types[0] = strdup("journal");
+		fs_types[1] = 0;
+	}
+
+	if (verbose) {
+		fputs(_("fs_types for mke2fs.conf resolution: "), stdout);
+		print_str_list(fs_types);
+	}
+
 	if (r_opt == EXT2_GOOD_OLD_REV && 
 	    (fs_param.s_feature_compat || fs_param.s_feature_incompat ||
 	     fs_param.s_feature_incompat)) {
-- 
1.5.6.1.205.ge2c7.dirty

>From f8df04bcc638585ee73cb795153f4456279b9b85 Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <[EMAIL PROTECTED]>
Date: Sun, 6 Jul 2008 20:57:17 -0400
Subject: [PATCH] mke2fs: Print a better error msg when ext2fs_get_device_size() returns EFBIG

Print a message when mke2fs uses a default blocksize from an external
journal device, and print a more self-explanatory message so that if
that blocksize is used and ext2fs_get_device_size() returns EFBIG, the
user has a better chance of understanding why mke2fs issued that error
message.

Addresses-Debian-Bug: #488663

Signed-off-by: "Theodore Ts'o" <[EMAIL PROTECTED]>
---
 misc/mke2fs.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index c47470b..352e66b 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1353,6 +1353,7 @@ static void PRS(int argc, char *argv[])
 			exit(1);
 		}
 		blocksize = jfs->blocksize;
+		printf(_("Using journal device's blocksize: %d\n"), blocksize);
 		fs_param.s_log_block_size =
 			int_log2(blocksize >> EXT2_MIN_BLOCK_LOG_SIZE);
 		ext2fs_close(jfs);
@@ -1404,6 +1405,13 @@ static void PRS(int argc, char *argv[])
 		}
 	}
 			
+	if (retval == EFBIG) {
+		fprintf(stderr, _("%s: Size of device %s too big "
+				  "to be expressed in 32 bits\n\t"
+				  "using a blocksize of %d.\n"),
+			program_name, device_name, EXT2_BLOCK_SIZE(&fs_param));
+		exit(1);
+	}
 	if (retval && (retval != EXT2_ET_UNIMPLEMENTED)) {
 		com_err(program_name, retval,
 			_("while trying to determine filesystem size"));
-- 
1.5.6.1.205.ge2c7.dirty

Reply via email to