Patchwork [1/3] mke2fs: indicate bigalloc feature explicity when cluster-size is enabled

login
register
mail settings
Submitter Zheng Liu
Date Jan. 13, 2013, 9:08 a.m.
Message ID <1358068095-9034-1-git-send-email-wenqing.lz@taobao.com>
Download mbox | patch
Permalink /patch/211602/
State Accepted
Headers show

Comments

Zheng Liu - Jan. 13, 2013, 9:08 a.m.
From: Zheng Liu <wenqing.lz@taobao.com>

When cluster-size is enabled without bigalloc feature, mke2fs will ignore this
argument silently.  But user might think bigalloc feature has been enabled
unless they use 'stats' command to check it in debugfs.  So now we ask user
to set bigalloc feature explicity when cluster-size is enabled.  This can
make sure that users understand what they are doing because bigalloc might
impact the performance for some workloads.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 misc/mke2fs.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Theodore Ts'o - Jan. 14, 2013, 8:28 p.m.
On Sun, Jan 13, 2013 at 05:08:13PM +0800, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@taobao.com>
> 
> When cluster-size is enabled without bigalloc feature, mke2fs will ignore this
> argument silently.  But user might think bigalloc feature has been enabled
> unless they use 'stats' command to check it in debugfs.  So now we ask user
> to set bigalloc feature explicity when cluster-size is enabled.  This can
> make sure that users understand what they are doing because bigalloc might
> impact the performance for some workloads.
> 
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>

Thanks, applied.

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

Patch

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index a288147..bf4d7a2 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1915,8 +1915,14 @@  profile_error:
 							    blocksize*16);
 		fs_param.s_log_cluster_size =
 			int_log2(cluster_size >> EXT2_MIN_CLUSTER_LOG_SIZE);
-	} else
+	} else if (cluster_size) {
+		com_err(program_name, EINVAL,
+			_("while setting clustersize; You need to enable "
+			  "bigalloc feature explicity"));
+		exit(1);
+	} else {
 		fs_param.s_log_cluster_size = fs_param.s_log_block_size;
+	}
 
 	if (inode_ratio == 0) {
 		inode_ratio = get_int_from_profile(fs_types, "inode_ratio",