summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2014-04-26 15:12:21 -0400
committerTheodore Ts'o <tytso@mit.edu>2014-04-26 15:12:21 -0400
commit82739458664554e804fe0f4042ef10054f237d6b (patch)
tree9336ae865180a43baa81f01151dea6d257ee6377
parentd69f43f56a215b3335d8cf853b6521715e90b769 (diff)
downloade2fsprogs-82739458664554e804fe0f4042ef10054f237d6b.tar.gz
mke2fs: don't complain if the regular file is too small
Don't ask the user if it's OK that a regular file is smaller than the requested size. This test only makes sense if we are creating the file system on a block device. This allow users to not need to manually answer the "proceed?" question when creating a file system backed by a simple file. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--misc/mke2fs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 3c62edea..fa61e7b8 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1383,7 +1383,7 @@ static void PRS(int argc, char *argv[])
unsigned long flex_bg_size = 0;
double reserved_ratio = -1.0;
int lsector_size = 0, psector_size = 0;
- int show_version_only = 0;
+ int show_version_only = 0, is_device = 0;
unsigned long long num_inodes = 0; /* unsigned long long to catch too-large input */
errcode_t retval;
char * oldpath = getenv("PATH");
@@ -1749,7 +1749,7 @@ profile_error:
if (optind < argc)
usage();
- if (!check_plausibility(device_name, 0, NULL) && !force)
+ if (!check_plausibility(device_name, 0, &is_device) && !force)
proceed_question();
check_mount(device_name, force, _("filesystem"));
@@ -1793,7 +1793,7 @@ profile_error:
fs_blocks_count &= ~((blk64_t) ((sys_page_size /
EXT2_BLOCK_SIZE(&fs_param))-1));
}
- } else if (!force && (fs_blocks_count > dev_size)) {
+ } else if (!force && is_device && (fs_blocks_count > dev_size)) {
com_err(program_name, 0, "%s",
_("Filesystem larger than apparent device size."));
proceed_question();