public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Lukas Czerner <lczerner@redhat.com>
To: xfs@oss.sgi.com
Cc: Lukas Czerner <lczerner@redhat.com>,
	fdmanana@gmail.com, linux-btrfs@vger.kernel.org
Subject: [PATCH 2/3] xfstests: Unset SCRATCH_DEV when deduced from SCRATCH_DEV_POOL
Date: Tue,  8 Apr 2014 17:42:49 +0200	[thread overview]
Message-ID: <1396971770-23553-2-git-send-email-lczerner@redhat.com> (raw)
In-Reply-To: <1396971770-23553-1-git-send-email-lczerner@redhat.com>

In the case that we already have sections in the config file we
have to make sure that we unset SCRATCH_DEV if it has been deduced from
the SCRATCH_DEV_POOL so that it does not complain about SCRATCH_DEV in
this case.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 common/config | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/common/config b/common/config
index 6fa18e2..3163801 100644
--- a/common/config
+++ b/common/config
@@ -372,10 +372,15 @@ get_next_config() {
 	unset MOUNT_OPTIONS
 	unset MKFS_OPTIONS
 	unset FSCK_OPTIONS
+	# We might have deduced SCRATCH_DEV from the SCRATCH_DEV_POOL in the previous
+	# run, so we have to unset it now.
+	if [ "$SCRATCH_DEV_NOT_SET" == "true" ]; then
+		unset SCRATCH_DEV
+	fi
 
 	parse_config_section $1
 
-	if [ -n "$OLD_FSTYP" ] && [ $OLD_FSTYP != $FSTYP ]; then
+	if [ ! -z "$OLD_FSTYP" ] && [ $OLD_FSTYP != $FSTYP ]; then
 		[ -z "$MOUNT_OPTIONS" ] && _mount_opts
 		[ -z "$MKFS_OPTIONS" ] && _mkfs_opts
 		[ -z "$FSCK_OPTIONS" ] && _fsck_opts
@@ -423,6 +428,7 @@ get_next_config() {
 		fi
 		SCRATCH_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
 		export SCRATCH_DEV
+		export SCRATCH_DEV_NOT_SET=true
 	fi
 
 	echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
-- 
1.8.3.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2014-04-08 15:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04  9:03 [ANNOUNCE] xfstests: updated to cf1ed54 Dave Chinner
2014-04-04 13:07 ` Filipe David Manana
2014-04-04 21:12   ` Dave Chinner
2014-04-08 10:07     ` Lukáš Czerner
2014-04-08 15:42     ` [PATCH 1/3] xfstests: Fix SCRATCH_DEV_POOL handling Lukas Czerner
2014-04-08 15:42       ` Lukas Czerner [this message]
2014-04-08 16:52         ` [PATCH 2/3] xfstests: Unset SCRATCH_DEV when deduced from SCRATCH_DEV_POOL Filipe David Manana
2014-04-08 15:42       ` [PATCH 3/3] xfstests: Fix setting FSTYP automatically Lukas Czerner
2014-04-08 16:52         ` Filipe David Manana
2014-04-08 16:51       ` [PATCH 1/3] xfstests: Fix SCRATCH_DEV_POOL handling Filipe David Manana
2014-04-08  0:14   ` [ANNOUNCE] xfstests: updated to cf1ed54 Dave Chinner
2014-04-08 15:16     ` Filipe David Manana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1396971770-23553-2-git-send-email-lczerner@redhat.com \
    --to=lczerner@redhat.com \
    --cc=fdmanana@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox