From 74dee07d4a5ddaed9485c11bf6c9b5778edd9a7f Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 20 Jun 2009 19:05:45 +0200 Subject: [PATCH 1/1] fix _require_scratch test for extN, resierfs, gfs2, and btrfs The extN, reiserfs, gfs2, and btrfs filesysytem types should use the same check for a block device as XFS and UDF, and not the test for NFS, which was checking for host:/foo/bar/baz when checking for a scratch device. Also, the NFS logic was also incorrect, in that it would allow a zero-length SCRATCH_DEV to continue. Signed-off-by: "Theodore Ts'o" Signed-off-by: Christoph Hellwig Reviewed-by: Felix Blyakher --- common.rc | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/common.rc b/common.rc index 581cfbae..39350b31 100644 --- a/common.rc +++ b/common.rc @@ -593,26 +593,23 @@ _supported_os() _require_scratch() { case "$FSTYP" in - xfs|udf) - if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ] + nfs*) + echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1 + if [ -z "$SCRATCH_DEV" -o "$?" != "0" ] then _notrun "this test requires a valid \$SCRATCH_DEV" fi - if [ "`_is_block_dev $SCRATCH_DEV`" = "`_is_block_dev $TEST_DEV`" ] + ;; + *) + if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ] then _notrun "this test requires a valid \$SCRATCH_DEV" fi - ;; - nfs*|ext2|ext3|ext4|reiserfs|gfs2|btrfs) - echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1 - if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" -a "$?" != "0" ] + if [ "`_is_block_dev $SCRATCH_DEV`" = "`_is_block_dev $TEST_DEV`" ] then _notrun "this test requires a valid \$SCRATCH_DEV" fi ;; - *) - _notrun "\$FSTYP ($FSTYP) unknown or not specified" - ;; esac # mounted? -- 2.30.2