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)
This commit is contained in:
Theodore Ts'o 2005-01-27 19:07:26 -05:00
parent d4dc0a9e29
commit 20953129e6
2 changed files with 18 additions and 2 deletions

View File

@ -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

View File

@ -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(&param),
&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"));