xfs
[Top] [All Lists]

[PATCH 19/19] mkfs: conflicting values with disabled crc should fail

To: xfs@xxxxxxxxxxx
Subject: [PATCH 19/19] mkfs: conflicting values with disabled crc should fail
From: Jan Tulak <jtulak@xxxxxxxxxx>
Date: Thu, 21 Apr 2016 11:39:53 +0200
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1461231593-31294-1-git-send-email-jtulak@xxxxxxxxxx>
References: <1461231593-31294-1-git-send-email-jtulak@xxxxxxxxxx>
If crc=0, then finobt=1 and spinodes=1 should both fail, instead of a warning.

Signed-off-by: Jan Tulak <jtulak@xxxxxxxxxx>
---
 mkfs/xfs_mkfs.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index c4cd5ba..249e547 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -2394,21 +2394,24 @@ _("32 bit Project IDs always enabled on CRC enabled 
filesytems\n"));
        } else {
                /*
                 * The kernel doesn't currently support crc=0,finobt=1
-                * filesystems. If crcs are not enabled and the user has
-                * explicitly turned them off then silently turn them off
-                * to avoid an unnecessary warning. If the user explicitly
-                * tried to use crc=0,finobt=1, then issue a warning before
-                * turning them off. The same is also for sparse inodes.
+                * filesystems. If crcs are not enabled and the user has not
+                * explicitly turned finobt on, then silently turn it off to
+                * avoid an unnecessary warning.
+                * If the user explicitly tried to use crc=0,finobt=1,
+                * then issue an error.
+                * The same is also for sparse inodes.
                 */
                if (sb_feat.finobt && mopts.subopt_params[M_FINOBT].seen) {
                        fprintf(stderr,
-_("warning: finobt not supported without CRC support, disabled.\n"));
+_("finobt not supported without CRC support\n"));
+                       usage();
                }
                sb_feat.finobt = 0;
 
                if (sb_feat.spinodes) {
                        fprintf(stderr,
-       _("warning: sparse inodes not supported without CRC support, 
disabled.\n"));
+       _("sparse inodes not supported without CRC support\n"));
+                       usage();
                }
                sb_feat.spinodes = 0;
 
-- 
2.5.0

<Prev in Thread] Current Thread [Next in Thread>