diff options
author | Theodore Ts'o <tytso@mit.edu> | 2005-01-27 19:07:26 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2005-01-27 19:07:26 -0500 |
commit | 20953129e6d280c3bb46ced5e8cab18faeca7cbc (patch) | |
tree | 6c19667ed38e7096156bc1c77b7153da8586e188 | |
parent | d4dc0a9e29f9e50a46840bc130c6a816c4c7faa5 (diff) | |
download | e2fsprogs-20953129e6d280c3bb46ced5e8cab18faeca7cbc.tar.gz |
mke2fs.c (PRS): If the device size is too big to be expressed
using a 1k blocksize, retry with a 4k blocksize.
(Addresses Sourceforge bug #1106631)
-rw-r--r-- | misc/ChangeLog | 6 | ||||
-rw-r--r-- | misc/mke2fs.c | 14 |
2 files changed, 18 insertions, 2 deletions
diff --git a/misc/ChangeLog b/misc/ChangeLog index 1372ba64..65387a14 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,9 @@ +2005-01-27 Theodore Ts'o <tytso@mit.edu> + + * mke2fs.c (PRS): If the device size is too big to be expressed + using a 1k blocksize, retry with a 4k blocksize. + (Addresses Sourceforge bug #1106631) + 2005-01-26 Theodore Ts'o <tytso@mit.edu> * Makefile.in (uninstall): Make sure "make uninstall" removes diff --git a/misc/mke2fs.c b/misc/mke2fs.c index c7afeae1..4a428e74 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -702,7 +702,7 @@ static void show_stats(ext2_filsys fs) case EXT2_OS_LINUX: fputs("Linux", stdout); break; case EXT2_OS_HURD: fputs("GNU/Hurd", stdout); break; case EXT2_OS_MASIX: fputs ("Masix", stdout); break; - case EXT2_OS_FREEBSD: fputs ("FerrBSD", stdout); break; + case EXT2_OS_FREEBSD: fputs ("FreeBSD", stdout); break; case EXT2_OS_LITES: fputs ("Lites", stdout); break; default: fputs(_("(unknown os)"), stdout); } @@ -1252,10 +1252,20 @@ static void PRS(int argc, char *argv[]) if (noaction && param.s_blocks_count) { dev_size = param.s_blocks_count; retval = 0; - } else + } else { + retry: retval = ext2fs_get_device_size(device_name, EXT2_BLOCK_SIZE(¶m), &dev_size); + if ((retval == EFBIG) && + (blocksize == 0) && + (param.s_log_block_size == 0)) { + param.s_log_block_size = 2; + blocksize = 4096; + goto retry; + } + } + if (retval && (retval != EXT2_ET_UNIMPLEMENTED)) { com_err(program_name, retval, _("while trying to determine filesystem size")); |