]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs: allow users to specify rtinherit=0
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 20 Nov 2020 22:03:28 +0000 (17:03 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 20 Nov 2020 22:03:28 +0000 (17:03 -0500)
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 <darrick.wong@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
mkfs/xfs_mkfs.c

index 049fa9ee57f76dfaaf8a3f80ced0feebdac15c3f..4cb79b695921c527eb91b88c31d6a89b9fe5db22 100644 (file)
@@ -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);