From patchwork Tue Oct 27 19:04:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11861567 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 3AE1114B7 for ; Tue, 27 Oct 2020 19:04:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 189DB206D4 for ; Tue, 27 Oct 2020 19:04:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="C02wiJkH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829282AbgJ0TEH (ORCPT ); Tue, 27 Oct 2020 15:04:07 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:47670 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1829280AbgJ0TEG (ORCPT ); Tue, 27 Oct 2020 15:04:06 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIt31Z108033; Tue, 27 Oct 2020 19:04:04 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-2020-01-29; bh=gVezm0m1ed7kpWxn3ZXIOpq4qDo68sqp/4EFztxgXc8=; b=C02wiJkH6JnyYvAvJZoNExK8N9keEx5Gey3VvS1uY2NrwiHlHzahi/X7ulD/ZDUDKr0R mqcLG3Jmho2MvNlSzPyqTLqQhcI887v1yccBSH9ZRkiNPT/RD1+Egtn7eNUNBGCFD9jr 28pG2T84Z8OEtG33JvYFJ3nsl2b+s7AKSHe/24uncf0MGSNHqz5/mMBii+sJG6MRXvG1 H+uGm4xnv84+hwuoWwedZcN++0U2XHBiXFcEypqH8+618DpLRGELq3x8D/6vwvF4g93w YuoAtVYe9Ccss6UE8nTQEPAqVAPpY/2TYeLk2595Te+e71GPuiK2RFiGyUrtry2kGkHJ JA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 34cc7kuuyw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Oct 2020 19:04:04 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIsPhm076554; Tue, 27 Oct 2020 19:04:03 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 34cwumrkat-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Oct 2020 19:04:03 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 09RJ43B1025578; Tue, 27 Oct 2020 19:04:03 GMT Received: from localhost (/10.159.243.144) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Oct 2020 12:04:02 -0700 Subject: [PATCH 1/4] generic: check userspace handling of extreme timestamps From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 27 Oct 2020 12:04:01 -0700 Message-ID: <160382544101.1203848.15837078115947156573.stgit@magnolia> In-Reply-To: <160382543472.1203848.8335854864075548402.stgit@magnolia> References: <160382543472.1203848.8335854864075548402.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 bulkscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 adultscore=0 malwarescore=0 spamscore=0 clxscore=1015 mlxscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong These two tests ensure we can store and retrieve timestamps on the extremes of the date ranges supported by userspace, and the common places where overflows can happen. They differ from generic/402 in that they don't constrain the dates tested to the range that the filesystem claims to support; we attempt various things that /userspace/ can parse, and then check that the vfs clamps and persists the values correctly. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- tests/generic/721 | 117 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/721.out | 1 tests/generic/722 | 120 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/722.out | 1 tests/generic/group | 2 + 5 files changed, 241 insertions(+) create mode 100755 tests/generic/721 create mode 100644 tests/generic/721.out create mode 100755 tests/generic/722 create mode 100644 tests/generic/722.out diff --git a/tests/generic/721 b/tests/generic/721 new file mode 100755 index 00000000..9638fbfc --- /dev/null +++ b/tests/generic/721 @@ -0,0 +1,117 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2020, 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 +# date ranges supported by userspace, and the common places where overflows +# can happen. +# +# This differs from generic/402 in that we don't constrain ourselves to the +# range that the filesystem claims to support; we attempt various things that +# /userspace/ can parse, and then check that the vfs clamps and persists the +# values correctly. + +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_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" + + echo "$arg" > $SCRATCH_MNT/t_$name + touch -d "$arg" $SCRATCH_MNT/t_$name +} + +report() { + local files=($SCRATCH_MNT/t_*) + for file in "${files[@]}"; do + echo "${file}: $(cat "${file}")" + TZ=UTC stat -c '%y %Y %n' "${file}" + test $test_statx -gt 0 && \ + $XFS_IO_PROG -c 'statx -r' "${file}" | grep 'stat.mtime' + done +} + +# -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 + +# 7956915742, all twos +touchme 'Feb 22 22:22:22 UTC 2222' all_twos + +if [ $test_bigdates -gt 0 ]; then + # 16299260424 (u64 nsec counter from s32_min, like xfs does) + touchme 'Tue Jul 2 20:20:24 UTC 2486' u64ns_from_s32_min + + # 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/722 b/tests/generic/722 new file mode 100755 index 00000000..3e8c553b --- /dev/null +++ b/tests/generic/722 @@ -0,0 +1,120 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2020, Oracle and/or its affiliates. All Rights Reserved. +# +# FS QA Test No. 722 +# +# Make sure we can store and retrieve timestamps on the extremes of the +# date ranges supported by userspace, and the common places where overflows +# can happen. This test also ensures that the timestamps are persisted +# correctly after a shutdown. +# +# This differs from generic/402 in that we don't constrain ourselves to the +# range that the filesystem claims to support; we attempt various things that +# /userspace/ can parse, and then check that the vfs clamps and persists the +# values correctly. + +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_fs generic +_require_scratch +_require_scratch_shutdown + +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" + + echo "$arg" > $SCRATCH_MNT/t_$name + touch -d "$arg" $SCRATCH_MNT/t_$name +} + +report() { + local files=($SCRATCH_MNT/t_*) + for file in "${files[@]}"; do + echo "${file}: $(cat "${file}")" + TZ=UTC stat -c '%y %Y %n' "${file}" + test $test_statx -gt 0 && \ + $XFS_IO_PROG -c 'statx -r' "${file}" | grep 'stat.mtime' + done +} + +# -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 + +# 7956915742, all twos +touchme 'Feb 22 22:22:22 UTC 2222' all_twos + +if [ $test_bigdates -gt 0 ]; then + # 16299260424 (u64 nsec counter from s32_min, like xfs does) + touchme 'Tue Jul 2 20:20:24 UTC 2486' u64ns_from_s32_min + + # 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_shutdown -f +_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/722.out b/tests/generic/722.out new file mode 100644 index 00000000..83acd5cf --- /dev/null +++ b/tests/generic/722.out @@ -0,0 +1 @@ +QA output created by 722 diff --git a/tests/generic/group b/tests/generic/group index cf4fdc23..b533d6b2 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -615,5 +615,7 @@ 610 auto quick prealloc zero 611 auto quick attr 612 auto quick clone +721 auto quick atime bigtime +722 auto quick atime bigtime 947 auto quick rw clone 948 auto quick rw copy_range From patchwork Tue Oct 27 19:04:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11861571 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 9BD4114B4 for ; Tue, 27 Oct 2020 19:04:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A01321556 for ; Tue, 27 Oct 2020 19:04:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="iV8HXAfc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829280AbgJ0TEN (ORCPT ); Tue, 27 Oct 2020 15:04:13 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:47758 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1822827AbgJ0TEM (ORCPT ); Tue, 27 Oct 2020 15:04:12 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIt3Yj108039; Tue, 27 Oct 2020 19:04:11 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-2020-01-29; bh=sj+qu+vI2/5m699ZBpH0ronawW0mrEB0FVs91jkGSck=; b=iV8HXAfc4P6mzQs3354Vr4ThfKlFE40v5/Aehuho6r4C0C/i0WLCj4pUkTCTxF19S/+l xHeYOUnlmBQj+f36BdOmFUWkm+h7KOwZ3khhkqQY0grTteT7xuO7Zhmq571uuf9h83+E 8iGh8puESrIW4nQDJ79Eq0MpMgtIbQBmTl1zaMCadx3Q4jOyzs/q1drXNsVvWXJiJguu vGapDBV+44bGF8DZNTLbS21B78gVH6tXjLaprjoAvCCWwDJBS9T/Rzhn9MskOcuPh9+c LsUB6zXv2XLxtnW4EzGm+B04nqYsktyF5SDyEz2fPIzZc9vwyzgCYSiUtP89gkFlS/mG Kw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 34cc7kuv06-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Oct 2020 19:04:11 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIuMkD091061; Tue, 27 Oct 2020 19:04:10 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 34cx1r3way-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Oct 2020 19:04:10 +0000 Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 09RJ49A3028450; Tue, 27 Oct 2020 19:04:09 GMT Received: from localhost (/10.159.243.144) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Oct 2020 12:04:08 -0700 Subject: [PATCH 2/4] xfs/122: add legacy timestamps to ondisk checker From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 27 Oct 2020 12:04:07 -0700 Message-ID: <160382544732.1203848.9001133589345314135.stgit@magnolia> In-Reply-To: <160382543472.1203848.8335854864075548402.stgit@magnolia> References: <160382543472.1203848.8335854864075548402.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 adultscore=0 malwarescore=0 spamscore=0 clxscore=1015 mlxscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Add these new ondisk structures. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- tests/xfs/122 | 1 + tests/xfs/122.out | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/xfs/122 b/tests/xfs/122 index a4248031..db21f2d5 100755 --- a/tests/xfs/122 +++ b/tests/xfs/122 @@ -182,6 +182,7 @@ struct xfs_iext_cursor struct xfs_ino_geometry struct xfs_attrlist struct xfs_attrlist_ent +struct xfs_legacy_ictimestamp EOF echo 'int main(int argc, char *argv[]) {' >>$cprog diff --git a/tests/xfs/122.out b/tests/xfs/122.out index b0773756..f229465a 100644 --- a/tests/xfs/122.out +++ b/tests/xfs/122.out @@ -97,6 +97,7 @@ sizeof(struct xfs_inode_log_format) = 56 sizeof(struct xfs_inode_log_format_32) = 52 sizeof(struct xfs_inumbers) = 24 sizeof(struct xfs_inumbers_req) = 64 +sizeof(struct xfs_legacy_timestamp) = 8 sizeof(struct xfs_log_dinode) = 176 sizeof(struct xfs_map_extent) = 32 sizeof(struct xfs_phys_extent) = 16 From patchwork Tue Oct 27 19:04:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11861583 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 B9F4214B4 for ; Tue, 27 Oct 2020 19:04:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9510521D24 for ; Tue, 27 Oct 2020 19:04:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="cWr2AzOF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829288AbgJ0TES (ORCPT ); Tue, 27 Oct 2020 15:04:18 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:47834 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1829284AbgJ0TES (ORCPT ); Tue, 27 Oct 2020 15:04:18 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIt2W0108016; Tue, 27 Oct 2020 19:04:16 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-2020-01-29; bh=79MuuFDS1BTCk5xIZQJVJpUrApbqEYZZwrRDqFvo0lI=; b=cWr2AzOFtc+3aOGd1gXoHg3+3ctd/NWqQ1OLnYwxSZoyn8Pn7q/G7P3RwFK/I9tup9FQ Z8PPl7rO1oVzGoauYo7kZMclwsVDJoythlQgnRQ8XjfJZFKQl6bny/nwv9KKBb759COs MwyQ0Ang/66XppQ3XVeTDScCtCD7nYCAIGCi9oWJKOoM6upuxLzm0YkFszH4+JfJIz0J x8dM7o/jj2Z3hv2hU5RUlxV2+Gfkk2bBZaD8wVEK8kamgJQmKsVbGY8LS2NdVs3TeU/+ i64PFNh/3K1w48w+BdCUZpq+PXFEty98DZ+e8F2Xg4PZ6WGW9cL1IPBAkmP2/gJMgBKV nA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 34cc7kuv0h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Oct 2020 19:04:16 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RItJfr019783; Tue, 27 Oct 2020 19:04:15 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 34cx6wbp54-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Oct 2020 19:04:15 +0000 Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 09RJ4E7j025696; Tue, 27 Oct 2020 19:04:14 GMT Received: from localhost (/10.159.243.144) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Oct 2020 12:04:14 -0700 Subject: [PATCH 3/4] xfs: detect time limits from filesystem From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 27 Oct 2020 12:04:13 -0700 Message-ID: <160382545348.1203848.12227735405144915534.stgit@magnolia> In-Reply-To: <160382543472.1203848.8335854864075548402.stgit@magnolia> References: <160382543472.1203848.8335854864075548402.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 adultscore=0 malwarescore=0 spamscore=0 clxscore=1015 mlxscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Teach fstests to extract timestamp limits of a filesystem using the new xfs_db timelimit command. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- common/rc | 2 +- common/xfs | 14 ++++++++++++++ tests/xfs/911 | 44 ++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/911.out | 15 +++++++++++++++ tests/xfs/group | 1 + 5 files changed, 75 insertions(+), 1 deletion(-) create mode 100755 tests/xfs/911 create mode 100644 tests/xfs/911.out diff --git a/common/rc b/common/rc index 41f93047..162d957a 100644 --- a/common/rc +++ b/common/rc @@ -2029,7 +2029,7 @@ _filesystem_timestamp_range() echo "0 $u32max" ;; xfs) - echo "$s32min $s32max" + _xfs_timestamp_range "$device" ;; btrfs) echo "$s64min $s64max" diff --git a/common/xfs b/common/xfs index e548a0a1..19ccee03 100644 --- a/common/xfs +++ b/common/xfs @@ -994,3 +994,17 @@ _require_xfs_scratch_inobtcount() _notrun "inobtcount not supported by scratch filesystem type: $FSTYP" _scratch_unmount } + +_xfs_timestamp_range() +{ + local use_db=0 + local dbprog="$XFS_DB_PROG $device" + test "$device" = "$SCRATCH_DEV" && dbprog=_scratch_xfs_db + + $dbprog -f -c 'help timelimit' | grep -v -q 'not found' && use_db=1 + if [ $use_db -eq 0 ]; then + echo "-$((1<<31)) $(((1<<31)-1))" + else + $dbprog -f -c 'timelimit --compact' | awk '{printf("%s %s", $1, $2);}' + fi +} diff --git a/tests/xfs/911 b/tests/xfs/911 new file mode 100755 index 00000000..bccd1e8f --- /dev/null +++ b/tests/xfs/911 @@ -0,0 +1,44 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2020, Oracle and/or its affiliates. All Rights Reserved. +# +# FS QA Test No. 911 +# +# Check that the xfs_db timelimit command prints the ranges that we expect. +# This in combination with an xfs_ondisk.h build time check in the kernel +# ensures that the kernel agrees with userspace. + +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 / +} + +# get standard environment, filters and checks +. ./common/rc + +# real QA test starts here +_supported_fs xfs +_require_scratch +_require_xfs_db_command timelimit + +rm -f $seqres.full + +# Format filesystem without bigtime support and populate it +_scratch_mkfs > $seqres.full +echo classic xfs timelimits +_scratch_xfs_db -c 'timelimit --classic' +echo bigtime xfs timelimits +_scratch_xfs_db -c 'timelimit --bigtime' + +# success, all done +status=0 +exit diff --git a/tests/xfs/911.out b/tests/xfs/911.out new file mode 100644 index 00000000..84dc475b --- /dev/null +++ b/tests/xfs/911.out @@ -0,0 +1,15 @@ +QA output created by 911 +classic xfs timelimits +time.min = -2147483648 +time.max = 2147483647 +dqtimer.min = 1 +dqtimer.max = 4294967295 +dqgrace.min = 0 +dqgrace.min = 4294967295 +bigtime xfs timelimits +time.min = -2147483648 +time.max = 16299260424 +dqtimer.min = 4 +dqtimer.max = 16299260424 +dqgrace.min = 0 +dqgrace.min = 4294967295 diff --git a/tests/xfs/group b/tests/xfs/group index 862df3be..f61d46a1 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -525,6 +525,7 @@ 761 auto quick realtime 763 auto quick rw realtime 910 auto quick inobtcount +911 auto quick bigtime 915 auto quick quota 917 auto quick db 918 auto quick db From patchwork Tue Oct 27 19:04:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11861581 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 3E455921 for ; Tue, 27 Oct 2020 19:04:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DD2321D42 for ; Tue, 27 Oct 2020 19:04:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="aZ3cfyS4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829306AbgJ0TE1 (ORCPT ); Tue, 27 Oct 2020 15:04:27 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:57546 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1829304AbgJ0TE0 (ORCPT ); Tue, 27 Oct 2020 15:04:26 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RItCvt021945; Tue, 27 Oct 2020 19:04:23 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-2020-01-29; bh=Zn0SQwCErYui6dkoBmRp1cc4mbyeWNN22WEUtcgvKLE=; b=aZ3cfyS4U61vQUlvbrS3r1ezyqGVLlZh5rirDg6KUEr9I4HM6rW5pTDpnX/Deu9p23mK JiW+DF0HEI6U6BuI7guY3UPOGI1OVUWh/nwhAdF6cAgq8oH/NmvH9KZlZHuiZwC46wlE oisnqYZX16F8RKouZB/FOSlcslerPfOZgtvBQX2ej9RvS678YBB54mlnnBGP5GWHHomq l4jvV0ZjlZNZbIEEmXQYvyoORoAWFhKwW8HAJ7XIbbNJiszRXB7IHmYUdOVyubBzExBp 9EGWrYHsDfabAl72IFCLJa0KMC6Zc1uQ8P9Xiabhi3oQQkOMJ9lPc1V3hYoWFpuuPETV cQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 34c9sav0f6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Oct 2020 19:04:22 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIuLgX090867; Tue, 27 Oct 2020 19:04:22 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 34cx1r3wft-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Oct 2020 19:04:21 +0000 Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09RJ4KJZ007111; Tue, 27 Oct 2020 19:04:20 GMT Received: from localhost (/10.159.243.144) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Oct 2020 12:04:20 -0700 Subject: [PATCH 4/4] xfs: test upgrading filesystem to bigtime From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 27 Oct 2020 12:04:19 -0700 Message-ID: <160382545965.1203848.17436126884496645934.stgit@magnolia> In-Reply-To: <160382543472.1203848.8335854864075548402.stgit@magnolia> References: <160382543472.1203848.8335854864075548402.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 spamscore=0 phishscore=0 clxscore=1015 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Test that we can upgrade an existing filesystem to use bigtime. Signed-off-by: Darrick J. Wong --- common/xfs | 16 ++++++ tests/xfs/908 | 87 ++++++++++++++++++++++++++++++ tests/xfs/908.out | 10 +++ tests/xfs/909 | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/909.out | 4 + tests/xfs/group | 2 + 6 files changed, 272 insertions(+) create mode 100755 tests/xfs/908 create mode 100644 tests/xfs/908.out create mode 100755 tests/xfs/909 create mode 100644 tests/xfs/909.out diff --git a/common/xfs b/common/xfs index 19ccee03..4274eee7 100644 --- a/common/xfs +++ b/common/xfs @@ -1008,3 +1008,19 @@ _xfs_timestamp_range() $dbprog -f -c 'timelimit --compact' | awk '{printf("%s %s", $1, $2);}' fi } + +_require_xfs_mkfs_bigtime() +{ + _scratch_mkfs_xfs_supported -m bigtime=1 >/dev/null 2>&1 \ + || _notrun "mkfs.xfs doesn't have bigtime feature" +} + +_require_xfs_scratch_bigtime() +{ + _require_scratch + + _scratch_mkfs -m bigtime=1 > /dev/null + _try_scratch_mount || \ + _notrun "bigtime not supported by scratch filesystem type: $FSTYP" + _scratch_unmount +} diff --git a/tests/xfs/908 b/tests/xfs/908 new file mode 100755 index 00000000..e368d66c --- /dev/null +++ b/tests/xfs/908 @@ -0,0 +1,87 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2020, Oracle and/or its affiliates. All Rights Reserved. +# +# FS QA Test No. 908 +# +# Check that we can upgrade a filesystem to support bigtime and that inode +# timestamps work properly after the upgrade. + +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 +. ./common/filter + +# We have very specific formatting parameters, so don't let things get complex +# with realtime devices and external logs. +unset USE_EXTERNAL + +# real QA test starts here +_supported_fs xfs +_require_xfs_mkfs_crc +_require_xfs_mkfs_bigtime +_require_xfs_scratch_bigtime + +date --date='Jan 1 00:00:00 UTC 2040' > /dev/null 2>&1 || \ + _notrun "Userspace does not support dates past 2038." + +rm -f $seqres.full + +# Format V5 filesystem without bigtime support and populate it +_scratch_mkfs -m crc=1,bigtime=0 > $seqres.full +_scratch_xfs_db -c 'version' -c 'sb 0' -c 'p' >> $seqres.full +_scratch_mount >> $seqres.full + +touch -d 'Jan 9 19:19:19 UTC 1999' $SCRATCH_MNT/a +touch -d 'Jan 9 19:19:19 UTC 1999' $SCRATCH_MNT/b +ls -la $SCRATCH_MNT/* >> $seqres.full + +echo before upgrade: +TZ=UTC stat -c '%Y' $SCRATCH_MNT/a +TZ=UTC stat -c '%Y' $SCRATCH_MNT/b + +_scratch_unmount +_check_scratch_fs + +# Now upgrade to bigtime support +_scratch_xfs_admin -O bigtime >> $seqres.full +_check_scratch_fs +_scratch_xfs_db -c 'version' -c 'sb 0' -c 'p' >> $seqres.full + +# Mount again, look at our files +_scratch_mount >> $seqres.full +ls -la $SCRATCH_MNT/* >> $seqres.full + +# Modify one of the timestamps to stretch beyond 2038 +touch -d 'Feb 22 22:22:22 UTC 2222' $SCRATCH_MNT/b + +echo after upgrade: +TZ=UTC stat -c '%Y' $SCRATCH_MNT/a +TZ=UTC stat -c '%Y' $SCRATCH_MNT/b + +_scratch_cycle_mount + +# Did the timestamp survive the remount? +ls -la $SCRATCH_MNT/* >> $seqres.full + +echo after upgrade and remount: +TZ=UTC stat -c '%Y' $SCRATCH_MNT/a +TZ=UTC stat -c '%Y' $SCRATCH_MNT/b + +# success, all done +status=0 +exit diff --git a/tests/xfs/908.out b/tests/xfs/908.out new file mode 100644 index 00000000..f0f412be --- /dev/null +++ b/tests/xfs/908.out @@ -0,0 +1,10 @@ +QA output created by 908 +before upgrade: +915909559 +915909559 +after upgrade: +915909559 +7956915742 +after upgrade and remount: +915909559 +7956915742 diff --git a/tests/xfs/909 b/tests/xfs/909 new file mode 100755 index 00000000..7010eb9e --- /dev/null +++ b/tests/xfs/909 @@ -0,0 +1,153 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2020, Oracle and/or its affiliates. All Rights Reserved. +# +# FS QA Test No. 909 +# +# Check that we can upgrade a filesystem to support bigtime and that quota +# timers work properly after the upgrade. + +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 +. ./common/filter +. ./common/quota + +# We have very specific formatting parameters, so don't let things get complex +# with realtime devices and external logs. +unset USE_EXTERNAL + +# real QA test starts here +_supported_fs xfs +_require_quota +_require_xfs_mkfs_crc +_require_xfs_mkfs_bigtime +_require_xfs_scratch_bigtime + +date --date='Jan 1 00:00:00 UTC 2040' > /dev/null 2>&1 || \ + _notrun "Userspace does not support dates past 2038." + +rm -f $seqres.full + +# Format V5 filesystem without bigtime support and populate it +_scratch_mkfs -m crc=1,bigtime=0 > $seqres.full +_qmount_option "usrquota" +_scratch_xfs_db -c 'version' -c 'sb 0' -c 'p' >> $seqres.full +_scratch_mount >> $seqres.full + +# Force the block counters for uid 1 and 2 above zero +_pwrite_byte 0x61 0 64k $SCRATCH_MNT/a >> $seqres.full +_pwrite_byte 0x61 0 64k $SCRATCH_MNT/b >> $seqres.full +sync +chown 1 $SCRATCH_MNT/a +chown 2 $SCRATCH_MNT/b + +# Set quota limits on uid 1 before upgrading +$XFS_QUOTA_PROG -x -c 'limit -u bsoft=12k bhard=1m 1' $SCRATCH_MNT + +# Make sure the grace period is at /some/ point in the future. We have to +# use bc because not all bashes can handle integer comparisons with 64-bit +# numbers. +repquota -upn $SCRATCH_MNT > $tmp.repquota +cat $tmp.repquota >> $seqres.full +grace="$(cat $tmp.repquota | grep '^#1' | awk '{print $6}')" +now="$(date +%s)" +res="$(echo "${grace} > ${now}" | $BC_PROG)" +test $res -eq 1 || echo "Expected timer expiry (${grace}) to be after now (${now})." + +_scratch_unmount + +# Now upgrade to bigtime support +_scratch_xfs_admin -O bigtime >> $seqres.full +_check_scratch_fs +_scratch_xfs_db -c 'version' -c 'sb 0' -c 'p' >> $seqres.full + +# Mount again, see if our quota timer survived +_scratch_mount + +# Set a very generous grace period and quota limits on uid 2 after upgrading +$XFS_QUOTA_PROG -x -c 'timer -u -b -d 2147483647' $SCRATCH_MNT +$XFS_QUOTA_PROG -x -c 'limit -u bsoft=10000 bhard=150000 2' $SCRATCH_MNT + +# Query the grace periods to see if they got set properly after the upgrade. +repquota -upn $SCRATCH_MNT > $tmp.repquota +cat $tmp.repquota >> $seqres.full +grace1="$(repquota -upn $SCRATCH_MNT | grep '^#1' | awk '{print $6}')" +grace2="$(repquota -upn $SCRATCH_MNT | grep '^#2' | awk '{print $6}')" +now="$(date +%s)" + +# Make sure that uid 1's expiration is in the future... +res1="$(echo "${grace} > ${now}" | $BC_PROG)" +test "${res1}" -eq 1 || echo "Expected uid 1 expiry (${grace1}) to be after now (${now})." + +# ...and that uid 2's expiration is after uid 1's... +res2="$(echo "${grace2} > ${grace1}" | $BC_PROG)" +test "${res2}" -eq 1 || echo "Expected uid 2 expiry (${grace2}) to be after uid 1 (${grace1})." + +# ...and that uid 2's expiration is after 2038 if right now is far enough +# past 1970 that our generous grace period would provide for that. +res3="$(echo "(${now} < 100) || (${grace2} > 2147483648)" | $BC_PROG)" +test "${res3}" -eq 1 || echo "Expected uid 2 expiry (${grace2}) to be after 2038." + +_scratch_cycle_mount + +# Query the grace periods to see if they survived a remount. +repquota -upn $SCRATCH_MNT > $tmp.repquota +cat $tmp.repquota >> $seqres.full +grace1="$(repquota -upn $SCRATCH_MNT | grep '^#1' | awk '{print $6}')" +grace2="$(repquota -upn $SCRATCH_MNT | grep '^#2' | awk '{print $6}')" +now="$(date +%s)" + +# Make sure that uid 1's expiration is in the future... +res1="$(echo "${grace} > ${now}" | $BC_PROG)" +test "${res1}" -eq 1 || echo "Expected uid 1 expiry (${grace1}) to be after now (${now})." + +# ...and that uid 2's expiration is after uid 1's... +res2="$(echo "${grace2} > ${grace1}" | $BC_PROG)" +test "${res2}" -eq 1 || echo "Expected uid 2 expiry (${grace2}) to be after uid 1 (${grace1})." + +# ...and that uid 2's expiration is after 2038 if right now is far enough +# past 1970 that our generous grace period would provide for that. +res3="$(echo "(${now} < 100) || (${grace2} > 2147483648)" | $BC_PROG)" +test "${res3}" -eq 1 || echo "Expected uid 2 expiry (${grace2}) to be after 2038." + +# Now try setting uid 2's expiration to Feb 22 22:22:22 UTC 2222 +new_expiry=$(date -d 'Feb 22 22:22:22 UTC 2222' +%s) +now=$(date +%s) +test $now -ge $new_expiry && \ + echo "Now is after February 2222? Expect problems." +expiry_delta=$((new_expiry - now)) + +echo "setting expiration to $new_expiry - $now = $expiry_delta" >> $seqres.full +$XFS_QUOTA_PROG -x -c "timer -u $expiry_delta 2" -c 'report' $SCRATCH_MNT >> $seqres.full + +# Did we get an expiration within 5s of the target range? +grace2="$(repquota -upn $SCRATCH_MNT | grep '^#2' | awk '{print $6}')" +echo "grace2 is $grace2" >> $seqres.full +_within_tolerance "grace2 expiry" $grace2 $new_expiry 5 -v + +_scratch_cycle_mount + +# ...and is it still within 5s after a remount? +grace2="$(repquota -upn $SCRATCH_MNT | grep '^#2' | awk '{print $6}')" +echo "grace2 is $grace2" >> $seqres.full +_within_tolerance "grace2 expiry after remount" $grace2 $new_expiry 5 -v + +# success, all done +echo Silence is golden. +status=0 +exit diff --git a/tests/xfs/909.out b/tests/xfs/909.out new file mode 100644 index 00000000..948502b7 --- /dev/null +++ b/tests/xfs/909.out @@ -0,0 +1,4 @@ +QA output created by 909 +grace2 expiry is in range +grace2 expiry after remount is in range +Silence is golden. diff --git a/tests/xfs/group b/tests/xfs/group index f61d46a1..ab98a706 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -524,6 +524,8 @@ 760 auto quick rw collapse punch insert zero prealloc 761 auto quick realtime 763 auto quick rw realtime +908 auto quick bigtime +909 auto quick bigtime quota 910 auto quick inobtcount 911 auto quick bigtime 915 auto quick quota