From patchwork Fri Dec 12 19:42:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 5485221 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6978EBEEA8 for ; Fri, 12 Dec 2014 19:43:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C346201DD for ; Fri, 12 Dec 2014 19:43:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D295B201C8 for ; Fri, 12 Dec 2014 19:43:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934701AbaLLTnI (ORCPT ); Fri, 12 Dec 2014 14:43:08 -0500 Received: from imap.thunk.org ([74.207.234.97]:53655 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932581AbaLLTnH (ORCPT ); Fri, 12 Dec 2014 14:43:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=Message-Id:Date:Subject:Cc:To:From; bh=nmT63+2jTq1zooNhr/eHJQuKERudJxu20nQoE1DTBDM=; b=JoDpAR0+ZvhQgBO8b25f4T4C4jMdWHhBX39PpK7YUotMD6k4G4dphZ9PTWKkcaJUtJXhB9QG41xFsbNWkg9Viy/gCpkc4OeeCGMfFiNg1fh5LCf4dSUpcGbs2ikLpY6+mDLy1ubXtHw0GrfYdbqVF4BA3LTCxFmdBNr9/Wk3v+g=; Received: from root (helo=closure.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.80) (envelope-from ) id 1XzW7C-0004YU-Ir; Fri, 12 Dec 2014 19:43:02 +0000 Received: by closure.thunk.org (Postfix, from userid 15806) id 75F0058055D; Fri, 12 Dec 2014 14:43:01 -0500 (EST) From: Theodore Ts'o To: fstests@vger.kernel.org Cc: Theodore Ts'o Subject: [PATCH] common: use mke2fs -F instead of piping in yes Date: Fri, 12 Dec 2014 14:42:54 -0500 Message-Id: <1418413374-17380-1-git-send-email-tytso@mit.edu> X-Mailer: git-send-email 2.1.0 X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It's possible based on a race conditions (and possibly the version of coreutils which supplies /usr/bin/yes) that commands of the form: yes | $MKFS_PROG ... will end up causing the following failure: shared/298 16s ... [23:49:03] [23:49:19] - output mismatch (see /results/results-4k/shared/298.out.bad) --- tests/shared/298.out 2014-10-31 10:13:04.000000000 -0400 +++ /results/results-4k/shared/298.out.bad 2014-11-29 23:49:19.118138099 -0500 @@ -1,4 +1,6 @@ QA output created by 298 +yes: standard output: Broken pipe +yes: write error Generating garbage on loop...done. Running fstrim...done. Detecting interesting holes in image...done. ... (Run 'diff -u tests/shared/298.out /results/results-4k/shared/298.out.bad' to see the entire diff) Using mke2fs's -F option instad of "yes | $MKFS_PROG" fixes this issue. Signed-off-by: Theodore Ts'o --- common/rc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index 692d45c..ec4440b 100644 --- a/common/rc +++ b/common/rc @@ -517,6 +517,9 @@ _test_mkfs() btrfs) $MKFS_BTRFS_PROG $MKFS_OPTIONS $* $TEST_DEV > /dev/null ;; + ext2|ext3|ext4) + $MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV + ;; *) yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $TEST_DEV ;; @@ -535,6 +538,11 @@ _mkfs_dev() btrfs) $MKFS_BTRFS_PROG $MKFS_OPTIONS $* 2>$tmp_dir.mkfserr 1>$tmp_dir.mkfsstd ;; + ext2|ext3|ext4) + $MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* \ + 2>$tmp_dir.mkfserr 1>$tmp_dir.mkfsstd + ;; + *) yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* \ 2>$tmp_dir.mkfserr 1>$tmp_dir.mkfsstd @@ -581,6 +589,9 @@ _scratch_mkfs() btrfs) $MKFS_BTRFS_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null ;; + ext2|ext3) + $MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $SCRATCH_DEV + ;; ext4) _scratch_mkfs_ext4 $* ;; @@ -657,7 +668,7 @@ _scratch_mkfs_sized() fi ;; ext2|ext3|ext4|ext4dev) - yes | ${MKFS_PROG}.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks + ${MKFS_PROG}.$FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks ;; udf) $MKFS_UDF_PROG $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks