public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mkfs.xfs: Assign proper defaults to rmapbt and reflink flags
@ 2017-04-26 14:02 Eric Sandeen
  2017-04-26 15:10 ` Darrick J. Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Sandeen @ 2017-04-26 14:02 UTC (permalink / raw)
  To: linux-xfs; +Cc: Darrick J. Wong, Jan Tulak

The "defaultval" field in the options structure was a bit confusing,
so when the rmapbt & reflink options got added, the desire was
to keep them off by default, and "defaultval = 0" got set.

However, the purpose of this field is to define the default value
when the flag is specified with no associated value, i.e.

-m rmapbt vs. -m rmapbt=0 or -m rmapbt=1

Today, the resulting behavior is unexpected, and different from any
other mkfs flags; specifying "-m rmapbt,reflink" results in a
filesystem /without/ those features.

Fix these to be consistent with every other boolean flag in the
mkfs options, so that specifying the flag with no value will
enable the feature.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

I want to get this fixed up for 4.11, so just sending it separately
ahead of any other change Jan may make in this area.

diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index affa405..10858e4 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -697,13 +697,13 @@ struct opt_params mopts = {
 		  .conflicts = { LAST_CONFLICT },
 		  .minval = 0,
 		  .maxval = 1,
-		  .defaultval = 0,
+		  .defaultval = 1,
 		},
 		{ .index = M_REFLINK,
 		  .conflicts = { LAST_CONFLICT },
 		  .minval = 0,
 		  .maxval = 1,
-		  .defaultval = 0,
+		  .defaultval = 1,
 		},
 	},
 };


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-26 22:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-26 14:02 [PATCH] mkfs.xfs: Assign proper defaults to rmapbt and reflink flags Eric Sandeen
2017-04-26 15:10 ` Darrick J. Wong
2017-04-26 15:16   ` Jan Tulak
2017-04-26 22:50   ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox