From patchwork Tue Oct 22 01:49:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11203365 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D167A112B for ; Tue, 22 Oct 2019 01:49:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF16A2173B for ; Tue, 22 Oct 2019 01:49:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="qFaejWx4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730314AbfJVBtv (ORCPT ); Mon, 21 Oct 2019 21:49:51 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:39976 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727264AbfJVBtv (ORCPT ); Mon, 21 Oct 2019 21:49:51 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9M1mv75029349; Tue, 22 Oct 2019 01:49:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=/d20dlFjpWHInZ/jYJrKIAQNxd2vrD3KSWlT/M+q6QQ=; b=qFaejWx4W2ss+gI+VcPbeKG3N+D3pKoPnyHwWXUEGnh0X1ywDoHt6Mqn6YuTL74Kii8r SIjMLbEiMpEdI3nfvkvmgGfAWf7WWMGRJGx7lfiT+57g8lVf4llRQcHGmoYNH/qgN/CV dFevZV7eWG5PyPEa+A7IpCAPAZDLJ0R1iGVyT700/81c5udOW8RW8eHv3t1gGW8NFW57 J30PDFEog/TT3RMytMVuary59qzvyLH7TKGAyiPou3J5TnBne2Rh8cKJeWr7nPyQ/kgl 6dUE3zT+74eSEazeEfU6GY7bMHaAot+FIkGKoxJtSOQA8US7tg0i5s77uHQ/AqxgDV7O wg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2vqswtbfhw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Oct 2019 01:49:49 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9M1m6Ix113502; Tue, 22 Oct 2019 01:49:48 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2vrc00tn5t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Oct 2019 01:49:48 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x9M1nl6k005093; Tue, 22 Oct 2019 01:49:47 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 Oct 2019 18:49:47 -0700 Subject: [PATCH 1/2] xfs/435: disable dmesg checks From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Mon, 21 Oct 2019 18:49:46 -0700 Message-ID: <157170898616.1172383.6811130003893894634.stgit@magnolia> In-Reply-To: <157170897992.1172383.2128928990011336996.stgit@magnolia> References: <157170897992.1172383.2128928990011336996.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9417 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=771 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910220015 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9417 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=873 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910220016 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong This test corrupts the filesystem to see what assertions and other things to get logged, so don't treat that as a failure. Signed-off-by: Darrick J. Wong --- tests/xfs/435 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/xfs/435 b/tests/xfs/435 index c6c846ad..7af63158 100755 --- a/tests/xfs/435 +++ b/tests/xfs/435 @@ -42,6 +42,7 @@ _require_loadable_fs_module "xfs" _require_quota _require_scratch_reflink _require_cp_reflink +_disable_dmesg_check rm -f "$seqres.full" From patchwork Tue Oct 22 01:49:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11203369 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67A64112B for ; Tue, 22 Oct 2019 01:49:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 461232173B for ; Tue, 22 Oct 2019 01:49:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="QeE+Kxhq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730494AbfJVBt6 (ORCPT ); Mon, 21 Oct 2019 21:49:58 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:50056 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727264AbfJVBt5 (ORCPT ); Mon, 21 Oct 2019 21:49:57 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9M1mwiT008620; Tue, 22 Oct 2019 01:49:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=Lu7IP0aBz5Y0A/T22tizyr9lzpobsdI9Tm4MJfMX8Mk=; b=QeE+Kxhq5KdDsZRN21fdvqGLlZDPT9ZUCPHGsgRCzdKk30ZgOzTGw//wU31XAhtlmkiw +9zJwNvRXh2HOv8sMR/ror4SH0UaEwY7H0zcmdW1Gr1dUljIGpNOt95AZ4RX0ZQohxc7 T+dqiOg09lXkKKxlmvUHCLh36wP6PPhAdNfIA2vWzxd07VCur2ZmYqfFhE6au6KsaUAn sLNeNxa9dSUp0X21vn417CGFhl9fxVtMPpY2T0yUtWKDHLd/EWm+jVfct57tXDFCPef4 JUX4fvX+WRCSZqJJ8IDr60M+gBhZZBHgyf1hsACiZdBHyUWN/k9XCEOYWotNKr0+bJAa zA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 2vqu4qk64t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Oct 2019 01:49:55 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9M1lsQg066501; Tue, 22 Oct 2019 01:49:54 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 2vsakceb9j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Oct 2019 01:49:54 +0000 Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x9M1ns47026596; Tue, 22 Oct 2019 01:49:54 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 Oct 2019 18:49:53 -0700 Subject: [PATCH 2/2] xfs: make sure the kernel and repair tools catch bad names From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Mon, 21 Oct 2019 18:49:52 -0700 Message-ID: <157170899277.1172383.10473571682266133494.stgit@magnolia> In-Reply-To: <157170897992.1172383.2128928990011336996.stgit@magnolia> References: <157170897992.1172383.2128928990011336996.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9417 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910220015 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9417 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910220016 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Make sure we actually catch bad names in the kernel. Signed-off-by: Darrick J. Wong --- tests/xfs/749 | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/749.out | 4 ++ tests/xfs/group | 1 + 3 files changed, 108 insertions(+) create mode 100755 tests/xfs/749 create mode 100644 tests/xfs/749.out diff --git a/tests/xfs/749 b/tests/xfs/749 new file mode 100755 index 00000000..de219979 --- /dev/null +++ b/tests/xfs/749 @@ -0,0 +1,103 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-newer +# Copyright (c) 2019, Oracle and/or its affiliates. All Rights Reserved. +# +# FS QA Test No. 749 +# +# See if we catch corrupt directory names or attr names with nulls or slashes +# in them. + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + umount $mntpt > /dev/null 2>&1 + test -n "$loopdev" && _destroy_loop_device $loopdev > /dev/null 2>&1 + rm -r -f $imgfile $mntpt $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# real QA test starts here +_supported_fs xfs +_supported_os Linux +_require_test + +rm -f $seqres.full + +imgfile=$TEST_DIR/img-$seq +mntpt=$TEST_DIR/mount-$seq +testdir=$mntpt/testdir +testfile=$mntpt/testfile +nullstr="too_many_beans" +slashstr="are_bad_for_you" + +# Format image file +truncate -s 40m $imgfile +loopdev=$(_create_loop_device $imgfile) +$MKFS_XFS_PROG $loopdev >> $seqres.full + +# Mount image file +mkdir -p $mntpt +mount $loopdev $mntpt + +# Create directory entries +mkdir -p $testdir +touch $testdir/$nullstr +touch $testdir/$slashstr + +# Create attrs +touch $testfile +$ATTR_PROG -s $nullstr -V heh $testfile >> $seqres.full +$ATTR_PROG -s $slashstr -V heh $testfile >> $seqres.full + +# Corrupt the entries +umount $mntpt +_destroy_loop_device $loopdev +cp $imgfile $imgfile.old +sed -b \ + -e "s/$nullstr/too_many\x00beans/g" \ + -e "s/$slashstr/are_bad\/for_you/g" \ + -i $imgfile +test "$(md5sum < $imgfile)" != "$(md5sum < $imgfile.old)" || + _fail "sed failed to change the image file?" +rm -f $imgfile.old +loopdev=$(_create_loop_device $imgfile) +mount $loopdev $mntpt + +# Try to access the corrupt metadata +ls $testdir >> $seqres.full 2> $tmp.err +attr -l $testfile >> $seqres.full 2>> $tmp.err +cat $tmp.err | _filter_test_dir + +# Does scrub complain about this? +if _supports_xfs_scrub $mntpt $loopdev; then + $XFS_SCRUB_PROG -n $mntpt >> $seqres.full 2>&1 + res=$? + test $((res & 1)) -eq 0 && \ + echo "scrub failed to report corruption ($res)" +fi + +# Does repair complain about this? +umount $mntpt +$XFS_REPAIR_PROG -n $loopdev >> $seqres.full 2>&1 +res=$? +test $res -eq 1 || \ + echo "repair failed to report corruption ($res)" + +_destroy_loop_device $loopdev +loopdev= + +# success, all done +status=0 +exit diff --git a/tests/xfs/749.out b/tests/xfs/749.out new file mode 100644 index 00000000..db704c87 --- /dev/null +++ b/tests/xfs/749.out @@ -0,0 +1,4 @@ +QA output created by 749 +ls: cannot access 'TEST_DIR/mount-749/testdir': Structure needs cleaning +attr_list: Structure needs cleaning +Could not list "(null)" for TEST_DIR/mount-749/testfile diff --git a/tests/xfs/group b/tests/xfs/group index f4ebcd8c..9600cb4e 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -507,3 +507,4 @@ 509 auto ioctl 510 auto ioctl quick 511 auto quick quota +749 auto quick fuzzers From patchwork Thu Oct 24 00:33:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11208099 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4205A1390 for ; Thu, 24 Oct 2019 00:34:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1FF152084C for ; Thu, 24 Oct 2019 00:34:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="gmZF2i8o" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404152AbfJXAeB (ORCPT ); Wed, 23 Oct 2019 20:34:01 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:54090 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388218AbfJXAeB (ORCPT ); Wed, 23 Oct 2019 20:34:01 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9O0Xxak139370; Thu, 24 Oct 2019 00:33:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2019-08-05; bh=Yp88jRNHDAFa6HkOyrP3/IicedvCpq9E5P+Iukyemnk=; b=gmZF2i8ooE+O4wgzUDzTHmGGjrCcetbyo5y5pyokvSCv/PxKO6HA68KZB46DReS7RPSX 18Q+jLL+YqgTA0UFU8xD/XMM3QbBvKwvbXjcBYf/TI7Lu9T0NCqW61GTjd9VQGmpZfFf gTbxq6baSnNaavK0GCN9VUnfuAhazLe5HB5J+5ghWycynxCaDz3TpS7EA00JivXSPp9g kkzPu0t1YsD4dIzS37FnStb/MlymVBfWo0dxiX3SwjIU7Q0CDYSWzObiIpbMumHJnstW vvu67Mrzbf4T74hENun46gR8qWRAZi8JKRjIzJyE8FxUpb0j5pg28LTep4oRNOvNTKmx IQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2vqswtrn5f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Oct 2019 00:33:59 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9O0XRO0074495; Thu, 24 Oct 2019 00:33:58 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2vtsk36d51-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Oct 2019 00:33:58 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x9O0XwlI011591; Thu, 24 Oct 2019 00:33:58 GMT Received: from localhost (/10.159.148.95) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 23 Oct 2019 17:33:57 -0700 Date: Wed, 23 Oct 2019 17:33:56 -0700 From: "Darrick J. Wong" To: guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, Allison Collins Subject: [PATCH 3/2] generic: check storing and re-reading timestamps Message-ID: <20191024003356.GE6706@magnolia> References: <157170897992.1172383.2128928990011336996.stgit@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <157170897992.1172383.2128928990011336996.stgit@magnolia> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9419 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910240001 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9419 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910240001 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Add a test to make sure that we can store and retrieve timestamps without corrupting them. Note that this is likely to fail on older kernels that do not clamp timestamps properly, though at least in my book that counts as corruption. Signed-off-by: Darrick J. Wong --- tests/generic/721 | 102 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/721.out | 1 tests/generic/group | 1 3 files changed, 104 insertions(+) create mode 100755 tests/generic/721 create mode 100644 tests/generic/721.out diff --git a/tests/generic/721 b/tests/generic/721 new file mode 100755 index 00000000..711d3c5f --- /dev/null +++ b/tests/generic/721 @@ -0,0 +1,102 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2019, Oracle and/or its affiliates. All Rights Reserved. +# +# FS QA Test No. 721 +# +# Make sure we can store and retrieve timestamps on the extremes of the +# supported date ranges. + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc + +# real QA test starts here +_supported_os Linux +_supported_fs generic +_require_scratch + +rm -f $seqres.full + +_scratch_mkfs > $seqres.full +_scratch_mount + +# Does our userspace even support large dates? +test_bigdates=1 +touch -d 'May 30 01:53:03 UTC 2514' $SCRATCH_MNT 2>/dev/null || test_bigdates=0 + +# And can we do statx? +test_statx=1 +($XFS_IO_PROG -c 'help statx' | grep -q 'Print raw statx' && \ + $XFS_IO_PROG -c 'statx -r' $SCRATCH_MNT 2>/dev/null | grep -q 'stat.mtime') || \ + test_statx=0 + +echo "Userspace support of large timestamps: $test_bigdates" >> $seqres.full +echo "xfs_io support of statx: $test_statx" >> $seqres.full + +touchme() { + local arg="$1" + local name="$2" + + touch -d "$arg" $SCRATCH_MNT/t_$name +} + +report() { + local files=($SCRATCH_MNT $SCRATCH_MNT/t_*) + TZ=UTC stat -c '%y %Y %n' "${files[@]}" + test $test_statx -gt 0 && \ + $XFS_IO_PROG -c 'statx -r' "${files[@]}" | grep 'stat.mtime' +} + +# -2147483648 (S32_MIN, or classic unix min) +touchme 'Dec 13 20:45:52 UTC 1901' s32_min + +# 2147483647 (S32_MAX, or classic unix max) +touchme 'Jan 19 03:14:07 UTC 2038' s32_max + +if [ $test_bigdates -gt 0 ]; then + # 15032385535 (u34 time if you start from s32_min, like ext4 does) + touchme 'May 10 22:38:55 UTC 2446' u34_from_s32_min + + # 17179869183 (u34 time if you start from the unix epoch) + touchme 'May 30 01:53:03 UTC 2514' u34_max + + # Latest date we can synthesize(?) + touchme 'Dec 31 23:59:59 UTC 2147483647' abs_max_time + + # Earliest date we can synthesize(?) + touchme 'Jan 1 00:00:00 UTC 0' abs_min_time +fi + +# Query timestamps from incore +echo before >> $seqres.full +report > $tmp.times0 +cat $tmp.times0 >> $seqres.full + +_scratch_cycle_mount + +# Query timestamps from disk +echo after >> $seqres.full +report > $tmp.times1 +cat $tmp.times1 >> $seqres.full + +# Did they match? +cmp -s $tmp.times0 $tmp.times1 + +# success, all done +status=0 +exit diff --git a/tests/generic/721.out b/tests/generic/721.out new file mode 100644 index 00000000..087decb5 --- /dev/null +++ b/tests/generic/721.out @@ -0,0 +1 @@ +QA output created by 721 diff --git a/tests/generic/group b/tests/generic/group index 6f9c4e12..a49d4b11 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -581,3 +581,4 @@ 576 auto quick verity encrypt 577 auto quick verity 578 auto quick rw clone +721 auto quick atime