Whamcloud - gitweb
mke2fs: Do not require -F for block size < physical size
authorTheodore Ts'o <tytso@mit.edu>
Sun, 21 Nov 2010 14:56:53 +0000 (09:56 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 22 Nov 2010 14:22:05 +0000 (09:22 -0500)
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" <tytso@mit.edu>
misc/mke2fs.c

index 3c10a7a..a11dd8c 100644 (file)
@@ -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);
                }
        }