[PATCH] mke2fs: Disallow bigalloc with with bs < 4096

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently there is nothing preventing user to create file system with
bigalloc feature enabled and block size smaller than 4096 Bytes. However
such combination does not make much sense at all because the whole point
of bigalloc is to have bigger allocation units.

This patch disallow such combination.

Thanks!
-Lukas
---
 misc/mke2fs.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index bbf477a..1f33a20 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1924,6 +1924,12 @@ profile_error:
 				  "smaller than the block size.\n"));
 			exit(1);
 		}
+		if (EXT2_BLOCK_SIZE(&fs_param) < 4096) {
+			com_err(program_name, 0,
+				_("Bigalloc feature is not supported with "
+				  "block size smaller than 4096 B"));
+			exit(1);
+		}
 	} else if (cluster_size) {
 		com_err(program_name, 0,
 			_("specifying a cluster size requires the "
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux