All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: fstests@vger.kernel.org
Cc: Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH] defrag: test $TEST_DEV for extents for ext4 defrag
Date: Thu,  9 Jun 2016 14:41:09 -0400	[thread overview]
Message-ID: <1465497669-3137-1-git-send-email-tytso@mit.edu> (raw)

Commit 902223bdbbf2: "defrag: require extents support for ext4 defrag"
added a test to make sure the ext4 file system has extents enabled by
testing the scratch device.  Unfortunately at the time when
_require_defrag is run, the scratch file system hasn't been
initialized yet by the test, so its contents are undefined.

If the previous test explicitly creates a file system with extents
disabled on $SCRATCH_DEV (such as ext4/306), then subsequent tests
(e.g., ext4/307 and ext4/306) will refuse to run.

Fix this by testing $TEST_DEV instead of $SCRATCH_DEV.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 common/defrag | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/defrag b/common/defrag
index 44fc536..7db0cb4 100644
--- a/common/defrag
+++ b/common/defrag
@@ -33,7 +33,7 @@ _require_defrag()
 	else
 		DEFRAG_PROG="$E4DEFRAG_PROG"
 	fi
-	dumpe2fs -h $SCRATCH_DEV 2> /dev/null | grep -wq extent || \
+	dumpe2fs -h $TEST_DEV 2> /dev/null | grep -wq extent || \
 		_notrun "file system does not have extents, needed for defrag"
 	;;
     btrfs)
-- 
2.5.0


                 reply	other threads:[~2016-06-09 18:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1465497669-3137-1-git-send-email-tytso@mit.edu \
    --to=tytso@mit.edu \
    --cc=fstests@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.