From patchwork Thu Dec 8 10:52:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9466139 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 6A340607D3 for ; Thu, 8 Dec 2016 10:52:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A38C283E1 for ; Thu, 8 Dec 2016 10:52:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E44528536; Thu, 8 Dec 2016 10:52:45 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 E8F1A283E1 for ; Thu, 8 Dec 2016 10:52:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752098AbcLHKwo (ORCPT ); Thu, 8 Dec 2016 05:52:44 -0500 Received: from mail-wj0-f193.google.com ([209.85.210.193]:33654 "EHLO mail-wj0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751987AbcLHKwn (ORCPT ); Thu, 8 Dec 2016 05:52:43 -0500 Received: by mail-wj0-f193.google.com with SMTP id kp2so53911620wjc.0; Thu, 08 Dec 2016 02:52:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=gfEszcoYa8b2PICWMmXI+obxWW9MzKDw0IvnZ7qsI78=; b=JUWpjnRGeGH/eJbhzJ1KRuBG9h4GKpJ+ISoI5cvTDjXOPw7ZN5OQUrVs8jVNc3ep8D rk2+av/bgX2Qdxz7r+FLFiVs7ul+EPIIpP4L/oJ1C/me0itfDNEieX/eSEvOWLVbDXoS I466zO3OOkGuYg24tqSzH12XKyj9hSWTaoLrtNPpqGiCmFppqprQBzxrZc9p4FvqFlm2 fkgrf64O6radDDvm2q/XUFXZj6Eaub4u7Nh3u9F7bFnByRLyCI6FnZYHaNoHjGionbMC +P8iXGCFsAgrcUEWACMhRooLRIGqGhCK7o0NQrnLCOSovEKbvxFeAT2dX9uW6VAVJu45 KpLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gfEszcoYa8b2PICWMmXI+obxWW9MzKDw0IvnZ7qsI78=; b=T+WmFvwTW1LJqysn4/XH+Pb3HXdrUOP/jAK8hNVeRatgi6b8MDuAGMqtYJX6mQZ/A9 t/RKMvU5ZENxwP+e/rdyM+VEFtJAU37eHiHGisQxG0xM2LA8+d4Ejpex/21crhZWChHr dFw7L/wt2aUTKx9wDRsrc8xKVXhvPgZE/O4Nr2bxm8xgzmH6UxmVZ+c0BGwkIdQHhYco ifH4hxOcTXB5MnX21ieUMNKWXJwyScHhCqH6BNSMTDv0Oee0MfVNBLPCX9FxKRwZ1AHv ttPOJLS+Aczw9R5PAoCyrkVDE7lLNhWf1+4hrJVPElNVr1pocsGaP+L39VleghuFYT6k oLjg== X-Gm-Message-State: AKaTC038AyYeCrOyhcUGD0XIZUu+RPJNaqvWD03Q11v4RR3Z4+zjXskL2GNmE123Q9IBdw== X-Received: by 10.194.96.164 with SMTP id dt4mr63166413wjb.28.1481194361669; Thu, 08 Dec 2016 02:52:41 -0800 (PST) Received: from amir-VirtualBox.ctera.local (bzq-82-81-193-202.cablep.bezeqint.net. [82.81.193.202]) by smtp.gmail.com with ESMTPSA id vr9sm36301406wjc.35.2016.12.08.02.52.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Dec 2016 02:52:40 -0800 (PST) From: Amir Goldstein To: Eryu Guan Cc: Dave Chinner , fstests@vger.kernel.org, linux-unionfs@vger.kernel.org Subject: [PATCH 1/2] common: implement _require_xfs_io_command "open" Date: Thu, 8 Dec 2016 12:52:20 +0200 Message-Id: <1481194341-3592-1-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP -c "open $f" is broken in xfs_io <= 4.8. Using it results in an endless loop and xfs_io exists with error EMFILE. A fix for that bug makes "open" a 'one shot' command. Along with this fix, a new -C flag was introduced to explicitly request to execute a one shot command. Check for -C flag support as an indication that -c "open $f" is not broken. Signed-off-by: Amir Goldstein --- common/rc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/rc b/common/rc index 2719b23..cd2e8eb 100644 --- a/common/rc +++ b/common/rc @@ -1757,6 +1757,14 @@ _require_xfs_io_command() echo $testio | egrep -q "Inappropriate ioctl" && \ _notrun "xfs_io $command support is missing" ;; + "open") + # -c "open $f" is broken in xfs_io <= 4.8. Along with the fix, + # a new -C flag was introduced to execute one shot commands. + # Check for -C flag support as an indication for the bug fix. + testio=`$XFS_IO_PROG -F -f -C "open $testfile" $testfile 2>&1` + echo $testio | egrep -q "invalid option" && \ + _notrun "xfs_io $command support is missing" + ;; *) testio=`$XFS_IO_PROG -c "$command help" 2>&1` esac