From: Theodore Ts'o Date: Sun, 21 Nov 2010 14:56:53 +0000 (-0500) Subject: mke2fs: Do not require -F for block size < physical size X-Git-Tag: v1.41.13~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f89f54aff479af859ee483c907041bcc9c0698f8;p=thirdparty%2Fe2fsprogs.git mke2fs: Do not require -F for block size < physical size There will be SSD's out soon that have 8k or 16k phyiscal block sizes. So don't enforce a requirement that the block size be less than the physical block size unless the force option is given, and don't give a warning if the user can't do anything about it (i.e., if the physical block size is > than the page size). Signed-off-by: "Theodore Ts'o" --- diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 3c10a7a7a..a11dd8c80 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -1683,17 +1683,16 @@ got_size: blocksize = use_bsize; fs_param.s_blocks_count /= blocksize / 1024; } else { - if (blocksize < lsector_size || /* Impossible */ - (!force && (blocksize < psector_size))) { /* Suboptimal */ + if (blocksize < lsector_size) { /* Impossible */ com_err(program_name, EINVAL, _("while setting blocksize; too small " "for device\n")); exit(1); - } else if (blocksize < psector_size) { + } else if ((blocksize < psector_size) && + (psector_size <= sys_page_size)) { /* Suboptimal */ fprintf(stderr, _("Warning: specified blocksize %d is " - "less than device physical sectorsize %d, " - "forced to continue\n"), blocksize, - psector_size); + "less than device physical sectorsize %d\n"), + blocksize, psector_size); } }