[Devel] [PATCH RHEL7 COMMIT] ext4: Module parameter to disable discard mount param on ploop
Konstantin Khorenko
khorenko at virtuozzo.com
Sun Apr 28 23:49:44 MSK 2019
The commit is pushed to "branch-rh7-3.10.0-957.12.1.vz7.95.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.12.1.vz7.95.1
------>
commit 5263b9c619bd9f5b191b0bc1ab2ec734de17a4c5
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Sun Apr 28 23:49:41 2019 +0300
ext4: Module parameter to disable discard mount param on ploop
This is needed to measure performance in a standard way.
https://jira.sw.ru/browse/PSBM-94181
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
fs/ext4/super.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 623540274705..7f00f804cdba 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -117,6 +117,9 @@ MODULE_ALIAS("ext3");
#define IS_EXT3_SB(sb) (0)
#endif
+ushort ext4_force_discard_on_ploop = 1;
+module_param_named(force_discard_on_ploop, ext4_force_discard_on_ploop, ushort, 0644);
+
static int ext4_verify_csum_type(struct super_block *sb,
struct ext4_super_block *es)
{
@@ -3974,7 +3977,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
set_opt(sb, ERRORS_RO);
if (def_mount_opts & EXT4_DEFM_BLOCK_VALIDITY)
set_opt(sb, BLOCK_VALIDITY);
- if (def_mount_opts & EXT4_DEFM_DISCARD || is_ploop(sb))
+ if (def_mount_opts & EXT4_DEFM_DISCARD || (is_ploop(sb) && ext4_force_discard_on_ploop))
set_opt(sb, DISCARD);
sbi->s_resuid = make_kuid(&init_user_ns, le16_to_cpu(es->s_def_resuid));
More information about the Devel
mailing list