From patchwork Mon Jun 12 21:15:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9782801 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CA5B6602DA for ; Mon, 12 Jun 2017 21:16:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1A152864B for ; Mon, 12 Jun 2017 21:16:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A675228652; Mon, 12 Jun 2017 21:16:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53A7C2864B for ; Mon, 12 Jun 2017 21:16:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752258AbdFLVQM (ORCPT ); Mon, 12 Jun 2017 17:16:12 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36211 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752065AbdFLVQM (ORCPT ); Mon, 12 Jun 2017 17:16:12 -0400 Received: by mail-pf0-f195.google.com with SMTP id y7so17681392pfd.3 for ; Mon, 12 Jun 2017 14:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=s7vOIGJR0T6Bxhn6jSOSiwWGfyg/Gg48nTnSj69IkoQ=; b=NJ7B7ek7veEJJhUQVj7kDY2ThbGlqNGb9vl8KZbcgHAPQ/GzB8rZanlox2Vp2Mu4Jo ZC4OIUzle8k4yXf3Xy/x3SDY6okPYWgVUEvAq6Mq9bdr7xc/HDaBMtw9Eabb5hwSRqqJ hCwDBvJVwkAtjVWVdKO8A71p1GysCC9S3UGHeQ8bRmrFTkNGyXm7nvZ4/73ITHsRxwgu KbenmiHU+XmZfgEmEKhhAQu22se/QJ9jsFR34dHXCCLMl+IWXYlanDFP2dyvsSDPdXEt jJgZ6GVWceSyGg2JIHPEv51YgCOc5RAjDij2RJm2d25VKaTTuP+7E4Ap0WJobNSA3M1l Ikgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=s7vOIGJR0T6Bxhn6jSOSiwWGfyg/Gg48nTnSj69IkoQ=; b=FRAHkX6HCNkZ2ECAos8D+GKTmkYDYvhGEArIzpUw8IHLSkvF7o+x3rQ/7qTb9fsAKD RPM7/P/H884zZCOUFSOSk2dyycUSxe5aU9R5ZPAutTq6jBTux/UPYzii2XQXWMS1bDfs FmS934X1NdrWgjiuO/XaDG/AgLQgPtbSuTSxJFeoRrgLeKI/5j37xjxQzLF//77pf2V+ hqWjUsGTv24hG+6Uq/TCzR3uW2dyv/TZ87kR7ealSAgya58MmHAoMcwmEeaTUWUEW+mS oO6P4ifCNTZJxMeLco1qv9aP9ErdOcNkTFeH0Ni72O8a7W0TZH3dHUghEvVoC2YwWTSu kYhg== X-Gm-Message-State: AODbwcDIz8JOgOQbRXxx53KLuLtOXkeX1QXPqhjqGKjX4WxGVyUz+rKQ qmfQcIWe/mEF3Y4rEOA= X-Received: by 10.99.100.135 with SMTP id y129mr30009289pgb.5.1497302170982; Mon, 12 Jun 2017 14:16:10 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.66.174.81]) by smtp.gmail.com with ESMTPSA id l4sm19025067pgn.34.2017.06.12.14.16.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Jun 2017 14:16:10 -0700 (PDT) From: Eric Biggers To: fstests@vger.kernel.org Cc: Eric Biggers Subject: [PATCH] generic/397: be compatible with ignored SIGPIPE Date: Mon, 12 Jun 2017 14:15:28 -0700 Message-Id: <20170612211528.45666-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.13.1.508.gb3defc5cc-goog Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers If generic/397 is executed in an environment with SIGPIPE ignored, it fails because the 'yes' program prints an error message: yes: standard output: Broken pipe yes: write error This can be reproduced with: trap '' SIGPIPE; ./check generic/397 Fix it by generating the string of 255 y's using just 'head' and 'tr' instead of 'yes', 'head', and 'tr'. Although it's not really a good idea to execute xfstests with SIGPIPE ignored, this is the only test I've noticed where it causes a problem, so it might as well be fixed in the test. It would be much nicer to prevent this problem for all tests by making the 'check' script restore the default SIGPIPE handler. But that isn't straightforward because bash's 'trap' builtin doesn't allow un-ignoring signals that were ignored on entry to the shell. Signed-off-by: Eric Biggers --- tests/generic/397 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/generic/397 b/tests/generic/397 index 7077d048..ba920891 100755 --- a/tests/generic/397 +++ b/tests/generic/397 @@ -69,7 +69,7 @@ for dir in $SCRATCH_MNT/edir $SCRATCH_MNT/ref_dir; do touch $dir/empty > /dev/null $XFS_IO_PROG -t -f -c "pwrite 0 4k" $dir/a > /dev/null $XFS_IO_PROG -t -f -c "pwrite 0 33k" $dir/abcdefghijklmnopqrstuvwxyz > /dev/null - maxname=$(yes | head -255 | tr -d '\n') # 255 character filename + maxname=$(head -c 255 /dev/zero | tr '\0' y) # 255 character filename $XFS_IO_PROG -t -f -c "pwrite 0 1k" $dir/$maxname > /dev/null ln -s a $dir/symlink ln -s abcdefghijklmnopqrstuvwxyz $dir/symlink2