From 9c7e941bd5bc1ae1a037030ec90555f5e3fd1b9e Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Fri, 20 Nov 2020 17:03:28 -0500 Subject: [PATCH] mkfs: allow users to specify rtinherit=0 mkfs has quite a few boolean options that can be specified in several ways: "option=1" (turn it on), "option" (turn it on), or "option=0" (turn it off). For whatever reason, rtinherit sticks out as the only mkfs parameter that doesn't behave that way. Let's make it behave the same as all the other boolean variables. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Eric Sandeen Reviewed-by: Christoph Hellwig Signed-off-by: Eric Sandeen --- mkfs/xfs_mkfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 049fa9ee5..4cb79b695 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -351,7 +351,7 @@ static struct opt_params dopts = { }, { .index = D_RTINHERIT, .conflicts = { { NULL, LAST_CONFLICT } }, - .minval = 1, + .minval = 0, .maxval = 1, .defaultval = 1, }, @@ -1448,6 +1448,8 @@ data_opts_parser( case D_RTINHERIT: if (getnum(value, opts, subopt)) cli->fsx.fsx_xflags |= FS_XFLAG_RTINHERIT; + else + cli->fsx.fsx_xflags &= ~FS_XFLAG_RTINHERIT; break; case D_PROJINHERIT: cli->fsx.fsx_projid = getnum(value, opts, subopt); -- 2.47.3