* [PATCH v2] common/rc: avoid mkfs option conflicts in _scratch_mkfs_xfs_supported
@ 2016-07-15 4:20 Eryu Guan
2016-07-17 23:30 ` Dave Chinner
0 siblings, 1 reply; 2+ messages in thread
From: Eryu Guan @ 2016-07-15 4:20 UTC (permalink / raw)
To: fstests; +Cc: Eryu Guan
In recent mkfs.xfs updates in xfsprogs, commit 9090e187bc3e ("mkfs:
add respecification detection to generic parsing") added
re-specification detection to "-m" option, it causes several tests
_notrun if MKFS_OPTIONS has the same options as those being tested
in _scratch_mkfs_xfs_supported(), because they're specified multiple
times.
MKFS_OPTIONS="-m crc=0" ./check xfs/001
xfs/001 3s ... [not run] mkfs.xfs doesn't have crc feature
Fix it by creating XFS again without MKFS_OPTIONS in
_scratch_mkfs_xfs_supported(), in case there's conflict between
MKFS_OPTIONS and mkfs_opts, like what we do in _scratch_mkfs_xfs().
Signed-off-by: Eryu Guan <eguan@redhat.com>
---
v2:
- check if $mkfs_opts is empty, not MKFS_OPTIONS
- update the comments a bit to match _scratch_mkfs_xfs() more
common/rc | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/common/rc b/common/rc
index 0c68e4f..07a218d 100644
--- a/common/rc
+++ b/common/rc
@@ -473,11 +473,20 @@ _scratch_mkfs_xfs_opts()
_scratch_mkfs_xfs_supported()
{
- mkfs_opts=$*
+ local mkfs_opts=$*
_scratch_options mkfs
$MKFS_XFS_PROG -N $MKFS_OPTIONS $SCRATCH_OPTIONS $mkfs_opts $SCRATCH_DEV
+ local mkfs_status=$?
+
+ # a mkfs failure may be caused by conflicts between $MKFS_OPTIONS and
+ # $mkfs_opts, try again without $MKFS_OPTIONS
+ if [ $mkfs_status -ne 0 -a -n "$mkfs_opts" ]; then
+ $MKFS_XFS_PROG -N $SCRATCH_OPTIONS $mkfs_opts $SCRATCH_DEV
+ mkfs_status=$?
+ fi
+ return $mkfs_status
}
_scratch_mkfs_xfs()
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] common/rc: avoid mkfs option conflicts in _scratch_mkfs_xfs_supported
2016-07-15 4:20 [PATCH v2] common/rc: avoid mkfs option conflicts in _scratch_mkfs_xfs_supported Eryu Guan
@ 2016-07-17 23:30 ` Dave Chinner
0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2016-07-17 23:30 UTC (permalink / raw)
To: Eryu Guan; +Cc: fstests
On Fri, Jul 15, 2016 at 12:20:51PM +0800, Eryu Guan wrote:
> In recent mkfs.xfs updates in xfsprogs, commit 9090e187bc3e ("mkfs:
> add respecification detection to generic parsing") added
> re-specification detection to "-m" option, it causes several tests
> _notrun if MKFS_OPTIONS has the same options as those being tested
> in _scratch_mkfs_xfs_supported(), because they're specified multiple
> times.
>
> MKFS_OPTIONS="-m crc=0" ./check xfs/001
> xfs/001 3s ... [not run] mkfs.xfs doesn't have crc feature
>
> Fix it by creating XFS again without MKFS_OPTIONS in
> _scratch_mkfs_xfs_supported(), in case there's conflict between
> MKFS_OPTIONS and mkfs_opts, like what we do in _scratch_mkfs_xfs().
>
> Signed-off-by: Eryu Guan <eguan@redhat.com>
looks fine.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-17 23:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-15 4:20 [PATCH v2] common/rc: avoid mkfs option conflicts in _scratch_mkfs_xfs_supported Eryu Guan
2016-07-17 23:30 ` Dave Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox