From patchwork Sat Oct 27 01:55:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 10658021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD2CD15A7 for ; Sat, 27 Oct 2018 01:55:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC7E72C898 for ; Sat, 27 Oct 2018 01:55:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB20F2C89D; Sat, 27 Oct 2018 01:55:36 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 7D7002C898 for ; Sat, 27 Oct 2018 01:55:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726193AbeJ0Key (ORCPT ); Sat, 27 Oct 2018 06:34:54 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:36362 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726048AbeJ0Key (ORCPT ); Sat, 27 Oct 2018 06:34:54 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 12A5269F390F5; Sat, 27 Oct 2018 09:55:31 +0800 (CST) Received: from szvp000201624.huawei.com (10.120.216.130) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.408.0; Sat, 27 Oct 2018 09:55:23 +0800 From: Chao Yu To: CC: , , Chao Yu Subject: [PATCH v3] generic/508: fix to check inode creation time feature on scratch mountpoint Date: Sat, 27 Oct 2018 09:55:20 +0800 Message-ID: <20181027015520.7355-1-yuchao0@huawei.com> X-Mailer: git-send-email 2.18.0.rc1 MIME-Version: 1.0 X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP _require_btime() just check inode creation time feature on TEST_DIR mountpoint, but generic/508 needs to do that check on SCRATCH_MNT mountpoint. Let's add _require_scratch_btime() for that, meanwhile handling scratch_{mkfs,mount,umount} inside the function to decouple with caller. Signed-off-by: Chao Yu Reviewed-by: Dave Chinner --- v3: - hanlde scratch mkfs/mount/umount inside _require_scratch_btime - relocate _require_scratch_btime common/rc | 14 ++++++++++++++ tests/generic/508 | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index b4987a9cd7f7..a882fada7d02 100644 --- a/common/rc +++ b/common/rc @@ -3851,6 +3851,20 @@ _require_btime() rm -f $TEST_DIR/test_creation_time } +_require_scratch_btime() +{ + _require_scratch + _scratch_mkfs > /dev/null 2>&1 + _scratch_mount + + $XFS_IO_PROG -f $SCRATCH_MNT/test_creation_time -c "statx -v" \ + | grep btime >>$seqres.full 2>&1 || \ + _notrun "inode creation time not supported by this filesystem" + rm -f $SCRATCH_MNT/test_creation_time + + _scratch_unmount +} + init_rc ################################################################################ diff --git a/tests/generic/508 b/tests/generic/508 index b869b3a9c260..3c2d4aa11169 100755 --- a/tests/generic/508 +++ b/tests/generic/508 @@ -46,10 +46,10 @@ _supported_os Linux _require_test_lsattr _require_statx _require_xfs_io_command "statx" "-v" -_require_btime _require_scratch _require_scratch_shutdown +_require_scratch_btime _scratch_mkfs >/dev/null 2>&1 _require_metadata_journaling $SCRATCH_DEV