OSDN Git Service

mke2fs: Print a better error msg when ext2fs_get_device_size() returns EFBIG
authorTheodore Ts'o <tytso@mit.edu>
Mon, 7 Jul 2008 00:57:17 +0000 (20:57 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 7 Jul 2008 00:57:17 +0000 (20:57 -0400)
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" <tytso@mit.edu>
misc/mke2fs.c

index c47470b..352e66b 100644 (file)
@@ -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"));