From patchwork Mon Aug 17 23:01:00 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: 11719597 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 9B49A739 for ; Mon, 17 Aug 2020 23:01:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E2A620674 for ; Mon, 17 Aug 2020 23:01:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="xeaCnycH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726480AbgHQXBI (ORCPT ); Mon, 17 Aug 2020 19:01:08 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:53246 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728241AbgHQXBE (ORCPT ); Mon, 17 Aug 2020 19:01:04 -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 07HMwRhk062519; Mon, 17 Aug 2020 23:01:02 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=+g2PZx/TR92HVgEKixvinl5tbZKZ0I/HPqbjXHTqpmI=; b=xeaCnycHgyHWFcZpgKQhNlFZJXr66E2pWiChmnaGxuVDT7KpMgko/Cu1YG/p11q65qrj Q8SQdtPFr/IDZ7p21gZwCCk+dlsCSHt6xx2LmiCWgi37NJ+iFLoJ9oCtGCxF8FdOU5Oh PraVH3MVtOAXAv098jgnnvxjnNlbJzfQWf4YmXVpkjW625XH7G6kPY+Gr2f8HtbQKacg rHyz6j6EBrxOiydGq19eoOZuDyWCq6LgCF6JSv4GXa6dqkzYHYFhI8ru6MKryNRfPLmb wAXxc1VhseA7qhJumkQKUFwSO+I959evBtZ6mbBHpyY5ouhebc+gr0Ua+eHAWGYQ4NlC wA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 32x7nm9jxb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 17 Aug 2020 23:01:02 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07HMvjDR113883; Mon, 17 Aug 2020 23:01:02 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 32xsm18ub0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Aug 2020 23:01:01 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 07HN11ms015559; Mon, 17 Aug 2020 23:01:01 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 17 Aug 2020 16:01:01 -0700 Subject: [PATCH 1/4] xfs/122: embiggen struct xfs_agi size for inobtcount feature From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Mon, 17 Aug 2020 16:01:00 -0700 Message-ID: <159770526028.3960575.6276880648755854682.stgit@magnolia> In-Reply-To: <159770525400.3960575.11977829712550002800.stgit@magnolia> References: <159770525400.3960575.11977829712550002800.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9716 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 malwarescore=0 mlxscore=0 phishscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008170153 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9716 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 impostorscore=0 priorityscore=1501 adultscore=0 mlxscore=0 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 phishscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008170153 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Make the expected AGI size larger for the inobtcount feature. Signed-off-by: Darrick J. Wong --- tests/xfs/010 | 3 ++- tests/xfs/030 | 2 ++ tests/xfs/122.out | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/xfs/010 b/tests/xfs/010 index b65dd3ba..a5090316 100755 --- a/tests/xfs/010 +++ b/tests/xfs/010 @@ -114,7 +114,8 @@ _check_scratch_fs _corrupt_finobt_root $SCRATCH_DEV filter_finobt_repair() { - sed -e '/^agi has bad CRC/d' | \ + sed -e '/^agi has bad CRC/d' \ + -e '/^bad finobt block/d' | \ _filter_repair_lostblocks } diff --git a/tests/xfs/030 b/tests/xfs/030 index ebe4c92a..52a43ebc 100755 --- a/tests/xfs/030 +++ b/tests/xfs/030 @@ -44,6 +44,8 @@ _check_ag() -e '/^bad agbno AGBNO for refcntbt/d' \ -e '/^agf has bad CRC/d' \ -e '/^agi has bad CRC/d' \ + -e '/^bad inobt block count/d' \ + -e '/^bad finobt block count/d' \ -e '/^Missing reverse-mapping record.*/d' \ -e '/^unknown block state, ag AGNO, block.*/d' done diff --git a/tests/xfs/122.out b/tests/xfs/122.out index 45c42e59..837f4cae 100644 --- a/tests/xfs/122.out +++ b/tests/xfs/122.out @@ -112,7 +112,7 @@ sizeof(struct xfs_scrub_metadata) = 64 sizeof(struct xfs_unmount_log_format) = 8 sizeof(xfs_agf_t) = 224 sizeof(xfs_agfl_t) = 36 -sizeof(xfs_agi_t) = 336 +sizeof(xfs_agi_t) = 344 sizeof(xfs_alloc_key_t) = 8 sizeof(xfs_alloc_rec_incore_t) = 8 sizeof(xfs_alloc_rec_t) = 8 From patchwork Mon Aug 17 23:01:06 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: 11719605 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 6624F14F6 for ; Mon, 17 Aug 2020 23:01:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4CF2F20709 for ; Mon, 17 Aug 2020 23:01:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="qHmD5s3a" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728239AbgHQXBN (ORCPT ); Mon, 17 Aug 2020 19:01:13 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:53304 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728171AbgHQXBK (ORCPT ); Mon, 17 Aug 2020 19:01:10 -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 07HMvPF8050021; Mon, 17 Aug 2020 23:01:08 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=HrKUevwODpTMU16sd9yaBbJ3yneCdNDu+DPD41i1jk0=; b=qHmD5s3adIXeSF95SEVqEWdab9NAVD7sEYS97p3/n59efyOZYJhFCEuC8DQ7dSOZZeHa ZuvrnujggZfWgn8le26gb2b3VuJ/lDxlU04AJ+qhpd/SoovkRtSKa5foqAnFWQ7g5eHd DKTbz9+Co9KXDFR7Ent5zbXCNZ3q3jH0yBFYS/4R1d9462ZFV4iRKI61Q0cV12CzNXWH 9zqNXUl3LgZYQoE4Wuy7KgdQ+fxzAuKJ1LRGE6IEdAYhZR7mIoDov5ioKUwO5GSd49+/ wuhsXiXJxiNGdvy2WeXivNEB1bexO6AwmSlE7zVwAPxkRaLhMmE/1/HXTTOf/CgOHUK+ Wg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 32x7nm9k0a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 17 Aug 2020 23:01:08 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07HMvjTC113905; Mon, 17 Aug 2020 23:01:08 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 32xsm18un1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Aug 2020 23:01:08 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 07HN17ZV015638; Mon, 17 Aug 2020 23:01:07 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 17 Aug 2020 16:01:07 -0700 Subject: [PATCH 2/4] xfs: test inobtcount upgrade From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Mon, 17 Aug 2020 16:01:06 -0700 Message-ID: <159770526657.3960575.11874406628211391398.stgit@magnolia> In-Reply-To: <159770525400.3960575.11977829712550002800.stgit@magnolia> References: <159770525400.3960575.11977829712550002800.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9716 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 malwarescore=0 mlxscore=0 phishscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008170153 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9716 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 impostorscore=0 priorityscore=1501 adultscore=0 mlxscore=0 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 phishscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008170153 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Make sure we can actually upgrade filesystems to support inobtcounts. Signed-off-by: Darrick J. Wong --- common/xfs | 16 ++++++++++++++ tests/xfs/910 | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/910.out | 3 +++ tests/xfs/group | 1 + 4 files changed, 80 insertions(+) create mode 100755 tests/xfs/910 create mode 100644 tests/xfs/910.out diff --git a/common/xfs b/common/xfs index ce279041..05ed768a 100644 --- a/common/xfs +++ b/common/xfs @@ -955,3 +955,19 @@ _xfs_get_cowgc_interval() { _fail "Can't find cowgc interval procfs knob?" fi } + +_require_xfs_mkfs_inobtcount() +{ + _scratch_mkfs_xfs_supported -m inobtcount=1 >/dev/null 2>&1 \ + || _notrun "mkfs.xfs doesn't have inobtcount feature" +} + +_require_xfs_scratch_inobtcount() +{ + _require_scratch + + _scratch_mkfs -m inobtcount=1 > /dev/null + _try_scratch_mount || \ + _notrun "inobtcount not supported by scratch filesystem type: $FSTYP" + _scratch_unmount +} diff --git a/tests/xfs/910 b/tests/xfs/910 new file mode 100755 index 00000000..3cc5fca2 --- /dev/null +++ b/tests/xfs/910 @@ -0,0 +1,60 @@ +#! /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. 910 +# +# Check that we can upgrade a filesystem to support inobtcount and that +# everything works 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 + +# real QA test starts here +_supported_fs xfs +_supported_os Linux +_require_command "$XFS_ADMIN_PROG" "xfs_admin" +_require_xfs_mkfs_inobtcount +_require_xfs_scratch_inobtcount + +rm -f $seqres.full + +# Format V5 filesystem without inode btree counter support and populate it +_scratch_mkfs -m crc=1,inobtcount=0 > $seqres.full +_scratch_xfs_db -c 'version' -c 'sb 0' -c 'p' >> $seqres.full +_scratch_mount >> $seqres.full + +echo moo > $SCRATCH_MNT/urk + +_scratch_unmount +_check_scratch_fs + +# Now upgrade to inobtcount support +_scratch_xfs_admin -O inobtcount >> $seqres.full +_check_scratch_fs +_scratch_xfs_db -c 'version' -c 'sb 0' -c 'p' -c 'agi 0' -c 'p' >> $seqres.full + +# Mount again, look at our files +_scratch_mount >> $seqres.full +cat $SCRATCH_MNT/urk + +# success, all done +echo Silence is golden. +status=0 +exit diff --git a/tests/xfs/910.out b/tests/xfs/910.out new file mode 100644 index 00000000..83992f49 --- /dev/null +++ b/tests/xfs/910.out @@ -0,0 +1,3 @@ +QA output created by 910 +moo +Silence is golden. diff --git a/tests/xfs/group b/tests/xfs/group index 8ecdc5ba..b144d391 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -531,4 +531,5 @@ 746 auto quick online_repair 747 auto quick scrub 748 auto quick scrub +910 auto quick inobtcount 915 auto quick quota From patchwork Mon Aug 17 23:01:12 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: 11719609 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 5878B722 for ; Mon, 17 Aug 2020 23:01:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3FEF020709 for ; Mon, 17 Aug 2020 23:01:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="ZG/H/ELS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726934AbgHQXBS (ORCPT ); Mon, 17 Aug 2020 19:01:18 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:42244 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727972AbgHQXBR (ORCPT ); Mon, 17 Aug 2020 19:01:17 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07HMuu88136112; Mon, 17 Aug 2020 23:01:15 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=fqdgjjuW2dHrcDJfxI+pqltMAYV2NzAWyCKmmkWGQ68=; b=ZG/H/ELS25qCFYRgCQfgcgx12At0E3wwTGhMDmJ8riAW+dZOIjWO/UJklLQpZ5lXTH9k 7n0xdCvVAWUvd9y0IWEmhAjwYRH44ysShZHb0byanO7nsI46A0psfa2svUMw4r8pplSB YBJGQTYjpv6gRvkLSAPssy138hGjPvO4/l0A256Km2l2p61d5M7Gx/9EfCsvreAJ+931 2woNVXuOajJFw2hUC8T2+tayHdhUbnBz0OFBSUa4RObfPuq1tIxjE6gYio50AHuPrV71 8ARinNCxS8wxNx3daL/bDFO3VUM+dFnbtBNBaffsd4f38bXiV5iBNd3ngLMpBybNGLxN lQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 32x8bn1g8q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 17 Aug 2020 23:01:15 +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 07HMw9wT084716; Mon, 17 Aug 2020 23:01:15 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 32xsfr5c1g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Aug 2020 23:01:15 +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 07HN1Evi026405; Mon, 17 Aug 2020 23:01:14 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 17 Aug 2020 16:01:13 -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: Mon, 17 Aug 2020 16:01:12 -0700 Message-ID: <159770527292.3960575.5093832087395279280.stgit@magnolia> In-Reply-To: <159770525400.3960575.11977829712550002800.stgit@magnolia> References: <159770525400.3960575.11977829712550002800.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9716 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 spamscore=0 suspectscore=0 mlxscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008170153 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9716 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 adultscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 bulkscore=0 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008170153 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@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 --- common/rc | 2 +- common/xfs | 14 ++++++++++++++ tests/xfs/911 | 45 +++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/911.out | 15 +++++++++++++++ tests/xfs/group | 1 + 5 files changed, 76 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 aa5a7409..4f76f18d 100644 --- a/common/rc +++ b/common/rc @@ -2058,7 +2058,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 05ed768a..252a5c0d 100644 --- a/common/xfs +++ b/common/xfs @@ -971,3 +971,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..2e161a74 --- /dev/null +++ b/tests/xfs/911 @@ -0,0 +1,45 @@ +#! /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 +_supported_os Linux +_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..b0408bac --- /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 = 16299260425 +dqtimer.min = 1 +dqtimer.max = 16299260425 +dqgrace.min = 0 +dqgrace.min = 4294967295 diff --git a/tests/xfs/group b/tests/xfs/group index b144d391..0063fd19 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -532,4 +532,5 @@ 747 auto quick scrub 748 auto quick scrub 910 auto quick inobtcount +911 auto quick bigtime 915 auto quick quota From patchwork Mon Aug 17 23:01: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: 11719619 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 0F9D414F6 for ; Mon, 17 Aug 2020 23:03:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ECD302072D for ; Mon, 17 Aug 2020 23:03:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="yMlJdufU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726457AbgHQXDZ (ORCPT ); Mon, 17 Aug 2020 19:03:25 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:43386 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726324AbgHQXDZ (ORCPT ); Mon, 17 Aug 2020 19:03:25 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07HMuvV9136124; Mon, 17 Aug 2020 23:03:22 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=mcnX/8DZTfT0aHYxjsCRxU1nbVmNU5JJmlaauqDgX18=; b=yMlJdufUVBseSWzbxZNKSYeetel9nFlgjj/Hdm7ORD+dwTXlmbVr9OKjEGfJkfk6kmwp j1EMsWJDXEfJB/09obim6v31U3haMuKJuKXgjZFOIL2FwmlOOixea9CIW/Aw68ndb6w0 N/I4mHKzsllE6Djcju/YcpoSDcUIUUjRAueZjLl8u2UK8X6rmlqbS7Aqg2SBsgikdiYf QD37NlNvtryhnde9k33YNqILap36JSNH8pSnvOrN/AEzzm1pDkOVQprzcUu/tiPTV6dC Z/lPBtIihc0OK7XQy9zs8X6eDNV5o5XjRH4QAcLLKRZFoGbIijNijea/8qfZOu9Ro1SO IQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 32x8bn1geq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 17 Aug 2020 23:03: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 07HMw9xT084706; Mon, 17 Aug 2020 23:01:22 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 32xsfr5c5j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Aug 2020 23:01:22 +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 07HN1Ls0026421; Mon, 17 Aug 2020 23:01:21 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 17 Aug 2020 16:01: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: Mon, 17 Aug 2020 16:01:19 -0700 Message-ID: <159770527916.3960575.1560206777561534458.stgit@magnolia> In-Reply-To: <159770525400.3960575.11977829712550002800.stgit@magnolia> References: <159770525400.3960575.11977829712550002800.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9716 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 spamscore=0 suspectscore=0 mlxscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008170153 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9716 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 adultscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 bulkscore=0 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008170153 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@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 | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/908.out | 3 ++ tests/xfs/909 | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/909.out | 12 ++++++++ tests/xfs/group | 2 + 6 files changed, 184 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 252a5c0d..c0735a51 100644 --- a/common/xfs +++ b/common/xfs @@ -985,3 +985,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..e313e14b --- /dev/null +++ b/tests/xfs/908 @@ -0,0 +1,74 @@ +#! /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 + +# real QA test starts here +_supported_fs xfs +_supported_os Linux +_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 $SCRATCH_MNT/a +touch $SCRATCH_MNT/b +ls -la $SCRATCH_MNT/* >> $seqres.full + +_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 some timestamps +touch -d 'Feb 22 22:22:22 UTC 2222' $SCRATCH_MNT/b + +_scratch_cycle_mount + +# Did the timestamp survive? +ls -la $SCRATCH_MNT/* >> $seqres.full +TZ=UTC stat -c '%Y' $SCRATCH_MNT/b + +# success, all done +echo Silence is golden. +status=0 +exit diff --git a/tests/xfs/908.out b/tests/xfs/908.out new file mode 100644 index 00000000..38fdf6b3 --- /dev/null +++ b/tests/xfs/908.out @@ -0,0 +1,3 @@ +QA output created by 908 +7956915742 +Silence is golden. diff --git a/tests/xfs/909 b/tests/xfs/909 new file mode 100755 index 00000000..8d8675da --- /dev/null +++ b/tests/xfs/909 @@ -0,0 +1,77 @@ +#! /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 + +# real QA test starts here +_supported_fs xfs +_supported_os Linux +_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 + +touch $SCRATCH_MNT/a +touch $SCRATCH_MNT/b +$XFS_QUOTA_PROG -x -c 'timer -u 300m' $SCRATCH_MNT +$XFS_QUOTA_PROG -x -c 'state' $SCRATCH_MNT | grep 'grace time' + +_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 +$XFS_QUOTA_PROG -x -c 'state' $SCRATCH_MNT | grep 'grace time' + +# Create a file to force the dirty dquot out to disk +touch -d 'Feb 22 22:22:22 UTC 2222' $SCRATCH_MNT/b + +_scratch_cycle_mount + +# Did the timer (and the timestamp) survive? +TZ=UTC stat -c '%Y' $SCRATCH_MNT/b +$XFS_QUOTA_PROG -x -c 'state' $SCRATCH_MNT | grep 'grace time' + +# 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..70e1b082 --- /dev/null +++ b/tests/xfs/909.out @@ -0,0 +1,12 @@ +QA output created by 909 +Blocks grace time: [0 days 05:00:00] +Inodes grace time: [0 days 05:00:00] +Realtime Blocks grace time: [0 days 05:00:00] +Blocks grace time: [0 days 05:00:00] +Inodes grace time: [0 days 05:00:00] +Realtime Blocks grace time: [0 days 05:00:00] +7956915742 +Blocks grace time: [0 days 05:00:00] +Inodes grace time: [0 days 05:00:00] +Realtime Blocks grace time: [0 days 05:00:00] +Silence is golden. diff --git a/tests/xfs/group b/tests/xfs/group index 0063fd19..93fdaba9 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -531,6 +531,8 @@ 746 auto quick online_repair 747 auto quick scrub 748 auto quick scrub +908 auto quick bigtime +909 auto quick bigtime quota 910 auto quick inobtcount 911 auto quick bigtime 915 auto quick quota