From patchwork Tue Dec 5 15:50:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 10093357 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 D793360327 for ; Tue, 5 Dec 2017 16:50:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D4E529960 for ; Tue, 5 Dec 2017 16:50:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EEF929968; Tue, 5 Dec 2017 16:50:18 +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_SIGNED, 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 AA79029960 for ; Tue, 5 Dec 2017 16:50:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751416AbdLEQuR (ORCPT ); Tue, 5 Dec 2017 11:50:17 -0500 Received: from pv43p51im-ztdg06051601.me.com ([17.133.164.142]:48255 "EHLO pv43p51im-ztdg06051601.me.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751288AbdLEQuQ (ORCPT ); Tue, 5 Dec 2017 11:50:16 -0500 X-Greylist: delayed 3601 seconds by postgrey-1.27 at vger.kernel.org; Tue, 05 Dec 2017 11:50:16 EST Received: from process-dkim-sign-daemon.pv43p51im-ztdg06051601.me.com by pv43p51im-ztdg06051601.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P0H00500VZFKH00@pv43p51im-ztdg06051601.me.com>; Tue, 05 Dec 2017 15:50:15 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=04042017; t=1512489015; bh=xV4Lu72qVhxaETOb/p7nh4FG4rZYzhxYUevFzgYoQs0=; h=From:Content-type:MIME-version:Subject:Message-id:Date:To; b=vVmB47qkR6/2uu2TVMCAjIPlwgWrFk4gPk4Z47QmGvtIm03GgAgw1MXSGIHmuTcNb BZOsVrgzeNNFsrlSm6sP+RfmtJ8MGD5y7l7kdWpeTZQmmFl/uAprJk0XoVfrwKLhTG t1suFS8xBBDtaXJzoI6CGsSCmeGPSa79aMB0QpCCyMk6scUbkHn6Wa75FkgqYdDh+5 +ZPYgGF6MitmNCpdPiHHqRVQhaqAvPbVRb38AGvZR3kRoaRmiNik1lbOlmWAMTMEk6 lb82WNZH+f2OyRGeWN6tiVvu4aAhOQw9o2EakzTJi0FhCwuVtUzCe88n5E+dKOO7QN aF8+WkhndOzYw== Received: from icloud.com ([127.0.0.1]) by pv43p51im-ztdg06051601.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P0H00BEIVZFBD40@pv43p51im-ztdg06051601.me.com>; Tue, 05 Dec 2017 15:50:14 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-05_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1712050230 From: Chengguang Xu Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit MIME-version: 1.0 (Mac OS X Mail 11.1 \(3445.4.7\)) Subject: [PATCH 1/2] common/rc: Add syncfs check and a helper _scratch_shutdown() Message-id: <2D8A66F2-6AB9-4B7D-90B0-D3B6807FB353@icloud.com> Date: Tue, 05 Dec 2017 23:50:02 +0800 Cc: fstests , overlayfs , Chengguang Xu To: Eryu Guan , Amir Goldstein X-Mailer: Apple Mail (2.3445.4.7) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 1. Add a check case in _require_xfs_io_command() to support syncfs. 2. Introduce a helper to support scratch shutdown for overlayfs. Signed-off-by: Chengguang Xu --- common/rc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/common/rc b/common/rc index 4c053a5..e36ee24 100644 --- a/common/rc +++ b/common/rc @@ -669,6 +669,21 @@ _scratch_cleanup_files() esac } +_scratch_shutdown() +{ + + case $FSTYP in + overlay) + src/godown -f $OVL_BASE_SCRATCH_MNT 2>&1 \ + || _notrun "Underlying filesystem does not support shutdown" + ;; + *) + src/godown -f $SCRATCH_MNT 2>&1 \ + || _notrun "$FSTYP does not support shutdown" + ;; + esac +} + _scratch_mkfs() { local mkfs_cmd="" @@ -2087,6 +2102,10 @@ _require_xfs_io_command() "utimes" ) testio=`$XFS_IO_PROG -f -c "utimes" 0 0 0 0 $testfile 2>&1` ;; + "syncfs") + touch $testfile + testio=`$XFS_IO_PROG -c "syncfs" $testfile 2>&1` + ;; *) testio=`$XFS_IO_PROG -c "help $command" 2>&1` esac @@ -2908,8 +2927,7 @@ _require_scratch_shutdown() _scratch_mkfs > /dev/null 2>&1 _scratch_mount - src/godown -f $SCRATCH_MNT 2>&1 \ - || _notrun "$FSTYP does not support shutdown" + _scratch_shutdown _scratch_unmount }