From f89f54aff479af859ee483c907041bcc9c0698f8 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 21 Nov 2010 09:56:53 -0500 Subject: [PATCH] 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" --- misc/mke2fs.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 3c10a7a..a11dd8c 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); } } -- 1.8.3.1