From patchwork Fri Jun 10 08:51:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12876986 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F68ACCA47B for ; Fri, 10 Jun 2022 08:52:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348430AbiFJIwR (ORCPT ); Fri, 10 Jun 2022 04:52:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241545AbiFJIwI (ORCPT ); Fri, 10 Jun 2022 04:52:08 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6969C240A6; Fri, 10 Jun 2022 01:52:06 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25A7vnbn002868; Fri, 10 Jun 2022 08:52:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=SgThtAhtpq/ArTTm3uxmLn11KnDxMyVP9UN8k3tgRRs=; b=mXJ9rxOL/0rELXPsayvkVZHlGLwfNX5vuwpdAxIJ/bdgFfD+CpvYMuzm6GN8BD58yK5t ILczrcFLMBOWSeE7fPLRqxu4C+kPMs8huR8hmUiHQZDByCeJ5MZFUj/6t9kj1VAD6V7a aDyooBcnQ4YkLXQhkAHF+cDGCS827bpODlj8N5tmXPSdPv8qR5XlIl18hrWv15i9mM9w WNIG/tyHr3c6VfMe95OMh2WZt20tbhZYNraEDM6oXPm3tWFdpBiJsqnhjoyzDP63E2o9 8nUW1UaPDfik6Ydy3nqfEaaKrtJxQMMml3K6Sc+poc9+HYmlFdCEIbG3p12YtAvD1MZi Ag== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gfyxsnckx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Jun 2022 08:52:02 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25A8o6cd016400; Fri, 10 Jun 2022 08:52:01 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2172.outbound.protection.outlook.com [104.47.56.172]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3gfwu5pquh-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Jun 2022 08:52:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hfI3SoZuilx6ngWslaNwcf5m8bzH3h+/zKOIORe02kjBPI9epd65Y1MpOyxQG5ebMZdJWbjr7FbPs96Yq+UzBmO5kxmjQ0sEFrlMvtp6QBcXQLgaYtL8wi83tSyq4C4JiHrtPHIINwPvZSqOzW9MB8L2Oy6H42R56Uey6JjT4ntZkOgrRxeTm1X1iniMTffeTE44wFYTTcmqwn8eJPaK8GIvghY0amumzYNyyyEBC44xiK6IvsUqnxqG66WACMzZMhxoZkZw63Dxlth2OUuVDOXVuneWx9x1ZmOn1RbrZ0GIicQmaC1lVcwtHFNmDw7cTq82fIEK9ZN4HXgX0dDQiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SgThtAhtpq/ArTTm3uxmLn11KnDxMyVP9UN8k3tgRRs=; b=lHh87rZjgwUvqsZhxy5lCmm3dZqm1SHpvckg1yMgzBEz4ZaoK6a04cKcqcf+z1RDaNGX7uhQEsz1eyZLTjFqb40ar8BmT8hRsc+tBtp6jDhIPHj0S0hOtsFHL1ztuRzQNfj0+RZEyWKQhMbAPQEZd58ek4KUSTXxb4fYqGcI4KQubX6qZr5SOIXxMXuMn4vjM78ookMPNtWnU5uMEgcSPR2iw+N+CWneDakxFN2qYudMSvo3wyUAbXU4MNYaDPqgjk62mrLR7iaxi5eUIQQ2IJ98apAARQV+WND3OqwElNhi8RBr71iTz3rqIQGcSEEPW0aMdFcMZfVv0CRki1P1ag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SgThtAhtpq/ArTTm3uxmLn11KnDxMyVP9UN8k3tgRRs=; b=fEaDkCjDMZDTTupG9dVca54jVWzFFk/9Hd6NEcd8U2mWFfWHkLTLqmvsUlEqm0r0Qfu7WToQ6/IE/fNBnn8iU5s/ffhlo67YrSjxu4IQhQ7e4WMA5gL4Za13+4/6dWyAQzSEo2EMHf9cRLQjQejZPxrMMrzd5yOA+gH5Pk01/9o= Received: from SA2PR10MB4587.namprd10.prod.outlook.com (2603:10b6:806:114::12) by BYAPR10MB2854.namprd10.prod.outlook.com (2603:10b6:a03:82::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.18; Fri, 10 Jun 2022 08:51:56 +0000 Received: from SA2PR10MB4587.namprd10.prod.outlook.com ([fe80::ec25:bdae:c65c:b24a]) by SA2PR10MB4587.namprd10.prod.outlook.com ([fe80::ec25:bdae:c65c:b24a%7]) with mapi id 15.20.5332.013; Fri, 10 Jun 2022 08:51:55 +0000 From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , zlang@kernel.org, david@fromorbit.com, djwong@kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH V2 1/4] xfs/270: Fix ro mount failure when nrext64 option is enabled Date: Fri, 10 Jun 2022 14:21:32 +0530 Message-Id: <20220610085135.725400-2-chandan.babu@oracle.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220610085135.725400-1-chandan.babu@oracle.com> References: <20220610085135.725400-1-chandan.babu@oracle.com> X-ClientProxiedBy: TYAPR01CA0229.jpnprd01.prod.outlook.com (2603:1096:404:11e::25) To SA2PR10MB4587.namprd10.prod.outlook.com (2603:10b6:806:114::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0390e74c-f35a-4a99-a4d3-08da4abe78cc X-MS-TrafficTypeDiagnostic: BYAPR10MB2854:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wn0VJa/nG1WKge8u6qIA8AjSwPOGKJb9hcsHHNL7rKGRUj0tSPMkapisWjGnFL0p1wGBoAj1wdXIb9Q24ntA7cgGnc5dJT41FYcXi0limOwG30TrUUm2b1X7/2a/BrYhIo1M6PEYpc+/t44+1ZoLH4+iqLcLdzYqsVO0XUkeJrik5VrWe6jnb68qBuzIfFyY6iWOOWzxmmh18ovXGAeUBauLg5OiECip9mZWB+KFrs/TyTapicEVdRhEzclJ+MQLcE/cywKm17AmZ4YnCNDFRfnHrE1ThrfPRiPWUQUGWUfvv7C0T9FxYjw3nDaASTx0NVL1FUNEdu5rWBX2eN1DtkNrH4ff664q83cpLmj73HJX3IvqIE3z7xiSSjzW6vingIpTjEmpa/Hm4fC/ZkR9nNyP2c4PQet8/dHxcT+7YCYDT82p7gIQYpaGXsCfRg2nCUl4GOJu/OWFEcRByXfdPlo668L+HYElu84DB4dK3a4Q6ZH49SVgsWv+9O5IMl/SVIwBLurlb0g2tiugvbVgM7bZc26DPhvibIaZWzRxvpZxSThYYfdktTv8xf8VEeBzXnklq4/gduwbatywo3OouWVKdMpPf4foOSuouxropCpL5BDiCTUFq69/DTqsBzUZfjC3SnnYOmy/GmWbr7KiojG8hDOwggrxb2K6ILE1ipMJF4rc+AmSkCSVfiHpYp+/rzydShV09Q4tQjuB6ZLNhA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA2PR10MB4587.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(6506007)(4326008)(66946007)(26005)(83380400001)(6916009)(186003)(5660300002)(8936002)(316002)(8676002)(52116002)(6512007)(66476007)(66556008)(6486002)(6666004)(86362001)(36756003)(2906002)(2616005)(38100700002)(1076003)(38350700002)(508600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xSNt13bK7iiSUWTMSzkNogBOczIYZUz6X+/XQG6K/nfaxDUIhjT2I6p7QAjpOS+Xok15DBFYnvoIU85Wcuqlnc0q29HITLwehoY5tNsaYzh+DNwOUDN75b0MMRbWxq+XM0lu08pg6H2/gh7b/hG0n50+ekBZHajkK82Ds43QK/QEZXSOMmQuygUyH7s781XmTkh7/OfogbXs9n4ix1esTNIc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u3dEUP3pqW6Pi09vq8iKLv16eUwDfom7sfECk4aLMhTNCLagohYtDSJH3GeG/5rrrWOw5Gh9M/+kplB0e+xLn/X6jIuQ9T5Txjv6elVL5AaXMYeIJbeABLfykTAwxyTqXny6agmr7ysZa+Fqa5vuPbbO/rKXr5g7CZ8DPrjixua7vWJO94DyvjmBDzSQYYJQ3DDakNlAvde5DoGhdWiFJdf550s5TfQ8Aaacwim3p0KaQPlMcLvW4gvyZJocDKwqKlECTucN804ATtgF/S+aVnA8l+6qZbLuz5IEJ1FBbC4I79C0sybJGFRb/MAH8CdkVRxkQml8JoxDnnDhwjyIRXrXVUyCcRPKmPjorivcuLchkwt33kQByU0fKlqUdvi4auC0mpsH4INi8Cdjd5uHO16o7d+nYtV50ayies7nJR8qLA778tdNcMjIzFqJNXO4KiVC3++yZb9tXwH4VNNahl4nJCvA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0390e74c-f35a-4a99-a4d3-08da4abe78cc X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4587.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 08:51:55.9467 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AyQ1Fqmz0e+DMnPkzDvPiYtIGilJs5xS5WdvL6NuNpbM34rJ10zQeyZlxu5TXceNPlxNTb8zqkup1ox/XTDLOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2854 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.874 definitions=2022-06-10_02:2022-06-09,2022-06-10 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 adultscore=0 spamscore=0 suspectscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206100032 X-Proofpoint-ORIG-GUID: QR95SKAoJmSohCr8uypv87tsMacy2oas X-Proofpoint-GUID: QR95SKAoJmSohCr8uypv87tsMacy2oas Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org With nrext64 option enabled at run time, the read-only mount performed by the test fails because, 1. mkfs.xfs would have calculated log size based on reflink being enabled. 2. Clearing the reflink ro compat bit causes log size calculations to yield a different value. 3. In the case where nrext64 is enabled, this causes attr reservation to be the largest among all the transaction reservations. 4. This ends up causing XFS to require a larger ondisk log size than that which is available. This commit fixes the problem by setting features_ro_compat to the value obtained by the bitwise-OR of features_ro_compat field with 2^31. This commit includes changes suggested by Dave Chinner to replace bashisms with invocations to inline awk scripts. Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R --- tests/xfs/270 | 25 +++++++++++++++++++++++-- tests/xfs/270.out | 1 - 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/tests/xfs/270 b/tests/xfs/270 index 0ab0c7d8..560401ce 100755 --- a/tests/xfs/270 +++ b/tests/xfs/270 @@ -27,8 +27,29 @@ _scratch_mkfs_xfs >>$seqres.full 2>&1 # set the highest bit of features_ro_compat, use it as an unknown # feature bit. If one day this bit become known feature, please # change this case. -_scratch_xfs_set_metadata_field "features_ro_compat" "$((2**31))" "sb 0" | \ - grep 'features_ro_compat' + +ro_compat=$(_scratch_xfs_get_metadata_field "features_ro_compat" "sb 0") +ro_compat=$(echo $ro_compat | \ + awk '/[:xdigit:]/ { + if (NR > 1) { + printf("ro_compat has invalid value\n"); + exit 1; + } + printf("0x%x\n", or(strtonum($1), 0x80000000)) + }') + +# write the new ro compat field to the superblock +_scratch_xfs_set_metadata_field "features_ro_compat" "$ro_compat" "sb 0" \ + > $seqres.full 2>&1 + +# read the newly set ro compat filed for verification +new_ro_compat=$(_scratch_xfs_get_metadata_field "features_ro_compat" "sb 0" \ + 2>/dev/null) + +# verify the new ro_compat field is correct. +if [ $new_ro_compat != $ro_compat ]; then + echo "Unable to set new features_ro_compat. Wanted $ro_compat, got $new_ro_compat" +fi # rw mount with unknown ro-compat feature should fail echo "rw mount test" diff --git a/tests/xfs/270.out b/tests/xfs/270.out index 0a8b3851..edf4c254 100644 --- a/tests/xfs/270.out +++ b/tests/xfs/270.out @@ -1,5 +1,4 @@ QA output created by 270 -features_ro_compat = 0x80000000 rw mount test ro mount test rw remount test From patchwork Fri Jun 10 08:51:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12876988 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C181CCA47F for ; Fri, 10 Jun 2022 08:52:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348436AbiFJIwU (ORCPT ); Fri, 10 Jun 2022 04:52:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348466AbiFJIwN (ORCPT ); Fri, 10 Jun 2022 04:52:13 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63480203D05; Fri, 10 Jun 2022 01:52:12 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25A8IVLW012400; Fri, 10 Jun 2022 08:52:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=3oJ0N30Gm/+zMy5wugWbJOuybwI/vbLLyI3HTBEW900=; b=qMD5lVCeLu8DfwcZecmvtRYoI6DjKt3R+Gz5AVMiMwEcygcPFbdWEx4ctKXJLrcMfOC/ SzuPIlweCS8w1ZRXhMUCTTJv8t6La8IPb8j1uEI2pm81iRgEf3smDp/X387zry3Sv/+C 0iP0xWxVdSxBhsSJsGxwU9qw8dAt2wUdfLnHq46PohaHmM6o7Qylw5R7IvsfvWrasWMn 6pF3PhNfWpasXXqYVvRDabnYg7ZyjqqL67xUXr+Yanhwb0uHTtAM/FGEEc2kFxOFCsBQ hMKeaCTpqtAh7sV2CymWOcv1VhJtZioRN5KDgaT/BngvUHHiKXUOk2If6CENUMdbJfAr hw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ggvxn36ba-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Jun 2022 08:52:08 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25A8oRZ8023935; Fri, 10 Jun 2022 08:52:07 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2104.outbound.protection.outlook.com [104.47.70.104]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gfwu65bt0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Jun 2022 08:52:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i/102yQ3HwiS4r4vx9FvjbuuBKd5O3o0AsgNz6+9T6nEFo3U8Vate/SYDuk8aHEI9jiOngh/jb+Wf+tGFxTY2FwBHyG2jew0Qzpo9y3mt+K3TJMcuy0LSV8SBqBFQ9Sm+wTpxhO/aCY2K+bf4Ta2BO+vvCr0UenIukE7LE7HdBeD+81YOOXLJGxpGnBoi81uVg8cfjBEKrq7ev10pboMXIBBaxnbwAC+JOqfjkk2gOMzH4pXdN7EnGo/11XZBjaX7qPDMA/6nrNLXuSMYTEEpZbqcApGQA4rIXY0Afoe/bT05ktXtA91eEIZKV4NuqE7OL9Dw77QoJIDs+CovVIZYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3oJ0N30Gm/+zMy5wugWbJOuybwI/vbLLyI3HTBEW900=; b=liszfv4EFNkaU04Vctwf6oH4DXjRKB2jWOfKFTxUqy4xDYqNlW2tx0SVCZoOSNAcV4H9Tn5dY1H0yJVj8RznUxuzRBP/S7XT8AuFc1Lt7OOsrQ+DbqiTfivSpH+Fht4fnHdRdMaxysDlhO9nhw6thqLlHZgxtf/Gzl8iDyye/KT/IQcJxJ+p/E3uaUji93uJqKdNuvPtBrdCX7JcU4EPy+Iok0Vg1TGZTqYRfR2FJ9cIAAIkiFgWCjXKqEcfrUrJyzpBy7x1yi6uO8Ql7AYVLSQmrp/rbgzhC+NZHHd5z6LCqpuJLrcq6v2hL0zR4lmEToYUYKk7owjsmMNSlGBzVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3oJ0N30Gm/+zMy5wugWbJOuybwI/vbLLyI3HTBEW900=; b=wlF38/NVlq3kTdClPikPN2Z5fbEprmZ0mRR680FIiYv8ZAnZQ1esuBP3vDk1eORggasQIPV49Pe+RaGA/qZJ5bl+ZOnl++eK/ZHq2+0D4dr6MOKvg5wUCvpOJOVfLmztP+AmaCcOBg+hFhAX4daBZy4mTT46LvxNNRa4Q/e3P8o= Received: from SA2PR10MB4587.namprd10.prod.outlook.com (2603:10b6:806:114::12) by MWHPR10MB1965.namprd10.prod.outlook.com (2603:10b6:300:10c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Fri, 10 Jun 2022 08:52:05 +0000 Received: from SA2PR10MB4587.namprd10.prod.outlook.com ([fe80::ec25:bdae:c65c:b24a]) by SA2PR10MB4587.namprd10.prod.outlook.com ([fe80::ec25:bdae:c65c:b24a%7]) with mapi id 15.20.5332.013; Fri, 10 Jun 2022 08:51:58 +0000 From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , zlang@kernel.org, david@fromorbit.com, djwong@kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH V2 2/4] common/xfs: Add helper to check if nrext64 option is supported Date: Fri, 10 Jun 2022 14:21:33 +0530 Message-Id: <20220610085135.725400-3-chandan.babu@oracle.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220610085135.725400-1-chandan.babu@oracle.com> References: <20220610085135.725400-1-chandan.babu@oracle.com> X-ClientProxiedBy: TYAPR01CA0229.jpnprd01.prod.outlook.com (2603:1096:404:11e::25) To SA2PR10MB4587.namprd10.prod.outlook.com (2603:10b6:806:114::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 05e1209a-f31d-4a60-814c-08da4abe7a4a X-MS-TrafficTypeDiagnostic: MWHPR10MB1965:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9LDi4S9swKpO4+CEtbF3fzWnZ6xybXHa/lYtIG5bbxItkp8e+tGM4DVOeU8rwQhD8acJ38x829zARff48VWKN8HbrwokjKOnKjiTByfLQlOR30WZj917WIviWsfcjrxk/CI00WTVJuLPMBmdTBfCHO4XQcdM6MIQtXmyT5szV3O9mLFjABWL/MosbGD0j6gRtiT5sjsqUFVPLGtjZxMXVbOBU4GYTFAgO8XEJKgL8QbUiW06P0ReWy+ub6NHptFyR0rlNnHhqHR3OUFWtrXgG+uRTnJ8RN/y0aWQNQgCd4a9pYER7VQYHWDCMLc4sQlGE1nfxcAzb9NYAmzcSWbr8iQvlU9F0cT2TIbW0QAkzFJp0pYhVaF77mPK7lQ3Tq7F+lIbRw31eYsQs0ubEP2iDUsl5l2bHU+iGbHRzBye4LuetMaFZiEkKKk0phhKyMUmZDpv57gPlb80oijRLOv9vMt0HeqWxqOi2Auao8v+0WbxStnqFCcmYCUPBspYVMnmegG3675OxqAPM8fUKZlYAbOGIvSRsd+AOZoBIp0kG/gTPAIrCN2vxa6cFXaH4tdIvqejB1j30VvnqigYXat/a4tUev45YkTAzGFVr7Z7xajHw1zUByDdT3p30NW50ApDyEm3myp+eVtMAiMCw8EM/8VcoBFVE1LrOgwTB1DzdP9OKgkBuHbJ35fbcjwWYS7uUQJImuxtMYlV5GSPWVjIKQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA2PR10MB4587.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(2616005)(6506007)(6486002)(508600001)(86362001)(52116002)(26005)(6512007)(6666004)(1076003)(186003)(2906002)(66556008)(8936002)(4744005)(5660300002)(66946007)(36756003)(316002)(38350700002)(6916009)(38100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9cPW/XNd6zu5irEHXkb+4d3zN+LUiyGMSWrkg0GFPGMYv3wYZPrgkvxDgYFedVkTT4y9rCfIZSqFjiL8KzLUU5LPus8/q3RtjC2WIiuKz2fvaP6z2hM1HBJZgqtaNOsoNP9Mc2n0HAgcfmdpr16Xu+WerNuVKf4We0O3mt4Dmwx5Nh3tXm4kUqseVe8sDlzJxKfddwBLNCLAwyHx3iYR+9bFhVqYBz3AfQJarkfRpiz/RJnkYgSQsTBp+PfR7Osvj0F/INrJC1129cit3iezpsyfLVfvYT69/aWHmGdlbXR43a02hPayYOUZ7Y5u4kWejVnhI4JaEl8VYq7qUEI91YNYkNm5ZVDuKVz/hgFmCOGyHWv/DMTctiP7Vb3Lcly5a/n7QGEA1cbnV3fprObh8UoypdnYKymlyVdVQaiIzjtU5Zj+/4uX4hYMK2jd/u80+VHGO+Col+tvAVe6efPDkNuX7+wbrQvfmBU/K2E2No74QqBAS8GF8GOKqJM+CmeA7NadbwKDdtg1JB5+Vvg0gSN72XZ7ud2d3EWOiSzorHiv7PksR/Cul/0WPjNk35fHQfD/tjQ+iMNAtTkf47RIl8Pd3jvKAPeiCmIm9xeQDM2Bh2ELvMGcLQ5b4algMfYxbVZ7axHLgb7GHoZXJvgE1CFrKezLJaMrZ2Aydm9AxWI1L0K/HudQI/GqU9wSBcOv0g+Xk1bcqZtb+xB8kGe44c23AHZf0BncZJ0KzFD7L7HvdBPnDP+usoKQDaHG5lqrFsH/AWrePXZRZ2IFGxLGGOZ4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05e1209a-f31d-4a60-814c-08da4abe7a4a X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4587.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 08:51:58.4634 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HJzG2oiNGA576tyFC/R9SVk0BfK8Ps+a8BwaZW7QWcsx+1X8vK3HP8SH9Z6v0zHHRu4FS33dBl5q3Pig62aSoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1965 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.874 definitions=2022-06-10_02:2022-06-09,2022-06-10 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 bulkscore=0 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206100032 X-Proofpoint-GUID: nyk5SVTv2xxUceX1v634VwJY9YehQgAJ X-Proofpoint-ORIG-GUID: nyk5SVTv2xxUceX1v634VwJY9YehQgAJ Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org This commit adds a new helper to allow tests to check if xfsprogs and xfs kernel module support nrext64 option. Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R --- common/xfs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/xfs b/common/xfs index 2123a4ab..9f84dffb 100644 --- a/common/xfs +++ b/common/xfs @@ -444,6 +444,18 @@ _require_xfs_sparse_inodes() _scratch_unmount } +# this test requires the xfs large extent counter feature +# +_require_xfs_nrext64() +{ + _scratch_mkfs_xfs_supported -m crc=1 -i nrext64 > /dev/null 2>&1 \ + || _notrun "mkfs.xfs does not support nrext64" + _scratch_mkfs_xfs -m crc=1 -i nrext64 > /dev/null 2>&1 + _try_scratch_mount >/dev/null 2>&1 \ + || _notrun "kernel does not support nrext64" + _scratch_unmount +} + # check that xfs_db supports a specific command _require_xfs_db_command() { From patchwork Fri Jun 10 08:51:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12876989 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48122CCA480 for ; Fri, 10 Jun 2022 08:52:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348437AbiFJIwV (ORCPT ); Fri, 10 Jun 2022 04:52:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348467AbiFJIwN (ORCPT ); Fri, 10 Jun 2022 04:52:13 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B283203D1C; Fri, 10 Jun 2022 01:52:12 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25A8DZ0s013054; Fri, 10 Jun 2022 08:52:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=JUKVcP0vWUX05863LP3pbwkNm4BCLg11Ok/fvxH2ejE=; b=kv+Ws6k5FW8oJ5EsqVNuDRoHgZ32do1a8EgNTpX1N6iXYGG5+xnXm63dcuAwcx14laoJ 4eTjtIi23QAMBbzY2on0LZXMAuepR+u4j2I7O1wsFPdHO61mBbd1B0hPpDDZXr9zRZK0 yVaZ8tVbVJIpOyxransts6xhSx+u7qXSNjGaT95JfQ2IwVvk3ZmtfICk2lbcw72DmS3W 4218wFbCqCSS+2Rn4RV6K+mG6IE1p5ku/R6vKXvkfEofKQdTyHC8e1H85S/M8vALMBi2 oRhkLewtngE2lrVGucVcxhMWMqD5z8vfzyC3UgrqMpZhtkWMOmxRH2mcFy5h45VClib+ yQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ggvxn36bc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Jun 2022 08:52:08 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25A8oRZA023935; Fri, 10 Jun 2022 08:52:07 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2104.outbound.protection.outlook.com [104.47.70.104]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gfwu65bt0-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Jun 2022 08:52:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F4bOa/jPjH+WzMcMPJr9qkDqbGYVCJ1fC3fcj0DejL2AS+qBZohvBuDqnYovPUyw4X8ZpUujtj+Ro1Rp2l0gMeRsky4vomXfIkrQarAqaYXbgY3zAUrix/iD522m0yikfJx5VswU76NxZVI1blPiaA3rtOHS8ba+ODpZ1WQA1ihQuZ0f+UReKKQPYZLEAOxq6kWm4FAoyRv+kiTqinLXq6r4CyjofeyBNf6RincfMmUe/t0ojEHLH4ZglZxy55P8d+T1ee8gTsjje0ekdXq80jTXZ1m53JgmmM3qW/U1byNir9nhth6ilwz8Q0Y3lSFv55iNNQ9eKNYySAwyQDHoqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JUKVcP0vWUX05863LP3pbwkNm4BCLg11Ok/fvxH2ejE=; b=hPhjB6hQGHgPZFcL/WyKTojNPL4pC0iJoUP1df+QNXkFdBufyb4fJ68rA8ekAgVXKMx0G2iGj8/FJCKF0BKHzuSX03xPu4/4VXaHY28IhSR3JV7Ikor2+rpqMnUl3RbD1XO8yoGeQ5mTD6xTteIWNVad3lmroifwmdcuiT06lVQdmQv80D4GegxwX1chPmmTQA+VfIPhSMYMncnntQQMN0W9yWH6wkX2y1XAKLVOEXC1IZKCDF+1gOYmNg53hQTHVb3Gy9ncYXj1b8ZWqM6HGDKMBrS5iLxTv1wn6Gp9su6yhBHwsVjoH6S0EUyyxmMg5vKr1U6eLc5sbUbo4XXCGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JUKVcP0vWUX05863LP3pbwkNm4BCLg11Ok/fvxH2ejE=; b=FAIqT3+hUh9SrxJ04TiO1lKsSDDAStdyfwEGV9nN1CiJorZ6ZvlvjNt3DgZ23GcHHivfowSTPBFGh4CM+JPkvef3rnwsTvCyYUzXqlJHPxwf7RRFrvQj52z4hy+soUGZKKryYd2CONZMqJ/bCip3A8SqaElWlkA1ruqaFFUDTjM= Received: from SA2PR10MB4587.namprd10.prod.outlook.com (2603:10b6:806:114::12) by MWHPR10MB1965.namprd10.prod.outlook.com (2603:10b6:300:10c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Fri, 10 Jun 2022 08:52:05 +0000 Received: from SA2PR10MB4587.namprd10.prod.outlook.com ([fe80::ec25:bdae:c65c:b24a]) by SA2PR10MB4587.namprd10.prod.outlook.com ([fe80::ec25:bdae:c65c:b24a%7]) with mapi id 15.20.5332.013; Fri, 10 Jun 2022 08:52:05 +0000 From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , zlang@kernel.org, david@fromorbit.com, djwong@kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH V2 3/4] xfs: Verify that the correct inode extent counters are updated with/without nrext64 Date: Fri, 10 Jun 2022 14:21:34 +0530 Message-Id: <20220610085135.725400-4-chandan.babu@oracle.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220610085135.725400-1-chandan.babu@oracle.com> References: <20220610085135.725400-1-chandan.babu@oracle.com> X-ClientProxiedBy: TYAPR01CA0229.jpnprd01.prod.outlook.com (2603:1096:404:11e::25) To SA2PR10MB4587.namprd10.prod.outlook.com (2603:10b6:806:114::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: addeae5a-6314-406c-a6ba-08da4abe7bd1 X-MS-TrafficTypeDiagnostic: MWHPR10MB1965:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i4ehz7PaK1Tu27oGAaXsc1OOTz7kefb8RjrE5lOdXDbA6/smggOi6wYMRJvSUe76mEWMRZA3PH+0Ea6I3KMr/hDhpukqXmaLNwtFOULOd9ZFf9T26pwnvXQ6qQH2e5VNO94J0ansbOYeXAFtzkKvyTodnXTYlqe40g23YzggdpvMYUcj/jRM66MqCb7O6ICTsBSojI8tiNBnVHJzuRRWSpftTZY6tzInSPMfJVl0epwpiPn5mAyEuIbAkfCOYCiq+5g0wGqnWclnBHLrAEWz7IPrA7b6rNTPvgYw+KqoGnlVb8KtUo/hbPuxtusmUq7Qo/bKa/mcbUD0SrPrJNhnhTDz4ZnbaiuYtcoQTJaOQ9dM5SLoz3lfiP2Ok7eB/gU0taoFYQNnyvZRRIINol3o4a7tIzVDtlDcuj7E/vda/slUVEVqFYYAZeQp9ClV55ShKXrJ5MLe/f1kjrLrRyCLktgX+lrH7w+lKX1QYzl2e8z+Ba2P+CS8Isx1fje71Xte+OlHkHF5PNLpYoRuuv1clsst2UStDjdEzPRV8VNdI34jAsu34qLyBwd8cKMdbU/mZ6bOCYuMILlslPskhMWQ9gKmehx8S18WeswjIZRbW+LY3ktg5vNC3PUG3XPz3XC8yoRA58TQ8MGwiBoVHYJRSUVRJa+LdNxKyfj0aaIKCqTNQcBvUuTtZhK7TYISn5Awg76gy68vrL9ulBvYapYSZA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA2PR10MB4587.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(2616005)(15650500001)(6506007)(6486002)(508600001)(86362001)(52116002)(26005)(6512007)(6666004)(1076003)(186003)(2906002)(83380400001)(66556008)(8936002)(5660300002)(66946007)(36756003)(316002)(38350700002)(6916009)(38100700002)(4326008)(8676002)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WbWEa9DKe3sml7Urxnvdm3MeUeRNRbezb57fA7wNjLChGsHe1khTVLL8PQSGqCQwNiwwKZaRJ5qTanPEJP/PYWEYAZhYebP5EKhPRCccaMNd7ydF71ANfp2BRAKF85zyBaFHandQ5+Jyo9ppmajgNrcu7wQMfYpkfiJsYFleKOWZOiMkNkL61HgCsU4RVPLn4eFxSoLX6j3wuYn0mHiuQeDYm6qUQNqRXbUYoTvqh40F6AOZsPcrQESQvIymvymr4S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DPMZjLV03ZtDbXFhfOYFOt52cOpqVE6KPmMV/LMFi2wu29R1TCQhNO1lOqIhMyDbnV1C89dwy2Jq1FwQRBXwMzA6AN8/jz46wJGCyiGBbxdRbq+RqnISwuUQvV87ZHSIeBo1BNr1uE4EP5Vl9XEuS3h7vYAlkaPZDcrs1ofVPqRFkmlckwCO17tiQOVmRypJndI1yU82rrJGSFl7QhmyviZYaSlFCoF5I3jdgGHmqVNcSjVDKpbkxTkkb+PzUvb3FT/D1vvKhPWsp25wjgVZiL3C6l1uR3foSO7Fp3srLqdtFFgl6xrGCTtl6yA1arvGtrtHtTlnRbt4TDn3GGSlsIe8GgFqwt4f+UU+0n3Kro871qUcty+VlMIsEVpLSGbpKY7kfnJ8PIl6x0BH89dLkgKgqyJs0/ydP4N6O4IB0jnv+sxuA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: addeae5a-6314-406c-a6ba-08da4abe7bd1 X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4587.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 08:52:01.0113 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IIFBH1RTQIKads5j/Sbpwv2o8XiOqKAi+J5jsD6wnpLafR9RIOpSUr130E9hqbCXq2nDn0F7f1b0Tef41kguDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1965 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.874 definitions=2022-06-10_02:2022-06-09,2022-06-10 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 bulkscore=0 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206100032 X-Proofpoint-GUID: KOvLs8cofNTEvqOqYlKHcAEocujDjaqI X-Proofpoint-ORIG-GUID: KOvLs8cofNTEvqOqYlKHcAEocujDjaqI Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org This commit adds a new test to verify if the correct inode extent counter fields are updated with/without nrext64 mkfs option. Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R --- tests/xfs/547 | 92 +++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/547.out | 13 +++++++ 2 files changed, 105 insertions(+) create mode 100755 tests/xfs/547 create mode 100644 tests/xfs/547.out diff --git a/tests/xfs/547 b/tests/xfs/547 new file mode 100755 index 00000000..9d4216ca --- /dev/null +++ b/tests/xfs/547 @@ -0,0 +1,92 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2022 Oracle. All Rights Reserved. +# +# FS QA Test 547 +# +# Verify that correct inode extent count fields are populated with and without +# nrext64 feature. +# +. ./common/preamble +_begin_fstest auto quick metadata + +# Import common functions. +. ./common/filter +. ./common/attr +. ./common/inject +. ./common/populate + +# real QA test starts here +_supported_fs xfs +_require_scratch +_require_xfs_nrext64 +_require_attrs +_require_xfs_debug +_require_xfs_db_command path +_require_test_program "punch-alternating" +_require_xfs_io_error_injection "bmap_alloc_minlen_extent" + +for nrext64 in 0 1; do + echo "* Verify extent counter fields with nrext64=${nrext64} option" + + _scratch_mkfs -i nrext64=${nrext64} -d size=$((512 * 1024 * 1024)) \ + >> $seqres.full + _scratch_mount >> $seqres.full + + bsize=$(_get_file_block_size $SCRATCH_MNT) + + testfile=$SCRATCH_MNT/testfile + + nr_blks=20 + + echo "Add blocks to test file's data fork" + $XFS_IO_PROG -f -c "pwrite 0 $((nr_blks * bsize))" $testfile \ + >> $seqres.full + $here/src/punch-alternating $testfile + + echo "Consume free space" + fillerdir=$SCRATCH_MNT/fillerdir + nr_free_blks=$(stat -f -c '%f' $SCRATCH_MNT) + nr_free_blks=$((nr_free_blks * 90 / 100)) + + _fill_fs $((bsize * nr_free_blks)) $fillerdir $bsize 0 \ + >> $seqres.full 2>&1 + + echo "Create fragmented filesystem" + for dentry in $(ls -1 $fillerdir/); do + $here/src/punch-alternating $fillerdir/$dentry >> $seqres.full + done + + echo "Inject bmap_alloc_minlen_extent error tag" + _scratch_inject_error bmap_alloc_minlen_extent 1 + + echo "Add blocks to test file's attr fork" + attr_len=255 + nr_attrs=$((nr_blks * bsize / attr_len)) + for i in $(seq 1 $nr_attrs); do + attr="$(printf "trusted.%0247d" $i)" + $SETFATTR_PROG -n "$attr" $testfile >> $seqres.full 2>&1 + [[ $? != 0 ]] && break + done + + _scratch_unmount >> $seqres.full + + dcnt=$(_scratch_xfs_get_metadata_field core.nextents \ + "path /$(basename $testfile)") + acnt=$(_scratch_xfs_get_metadata_field core.naextents \ + "path /$(basename $testfile)") + + if (( $dcnt != 10 )); then + echo "Invalid data fork extent count: $dextcnt" + exit 1 + fi + + if (( $acnt < 10 )); then + echo "Invalid attr fork extent count: $aextcnt" + exit 1 + fi +done + +# success, all done +status=0 +exit diff --git a/tests/xfs/547.out b/tests/xfs/547.out new file mode 100644 index 00000000..49fcc3c2 --- /dev/null +++ b/tests/xfs/547.out @@ -0,0 +1,13 @@ +QA output created by 547 +* Verify extent counter fields with nrext64=0 option +Add blocks to test file's data fork +Consume free space +Create fragmented filesystem +Inject bmap_alloc_minlen_extent error tag +Add blocks to test file's attr fork +* Verify extent counter fields with nrext64=1 option +Add blocks to test file's data fork +Consume free space +Create fragmented filesystem +Inject bmap_alloc_minlen_extent error tag +Add blocks to test file's attr fork From patchwork Fri Jun 10 08:51:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12876987 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F56EC433EF for ; Fri, 10 Jun 2022 08:52:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241545AbiFJIwT (ORCPT ); Fri, 10 Jun 2022 04:52:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348469AbiFJIwN (ORCPT ); Fri, 10 Jun 2022 04:52:13 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8CF9203D1E; Fri, 10 Jun 2022 01:52:12 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25A7vnbr002868; Fri, 10 Jun 2022 08:52:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=JmgUli9E0+jNE5VOAjOYaDOY2oGXB+Sxi2jNBpBIROA=; b=j2ejXycepJAxoUSw1tGZR5qq/Du/BHqIcZY5f6GGQ70yABBFMbZ4z+QmdHMkDFnYd3gQ rTamu1lC7kbA63/YJGMe6AgJE1LLC62yYXEuWELEjWkgBH4lz2uuVBFtS3YJdr95Lob2 YM889EylURvpspQcS6dm36SZwNE5dox2r24QnN0ZhVbYMzXQ2FEnYpCi0BUlWNMIYQZ6 7s/NF5rNzyOigGKNwBDCUUyBJVm7hKXVENeJfyRmqgMm3B7JijrtJ96Rdwb3Xh4EaooA fVeei8W0ZLi+nv1rN7K2EGFB/TqONyd8dQgfBoQx+d7g0y0jLwFKzbc9eJ7EQQjTN9o3 SA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gfyxsncmh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Jun 2022 08:52:08 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25A8oRZB023935; Fri, 10 Jun 2022 08:52:08 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2104.outbound.protection.outlook.com [104.47.70.104]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gfwu65bt0-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Jun 2022 08:52:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KTujFr5LKh+hm6fqSciBsSdMCcRqzR51TNnzrkTW4RC/F3w1TGq//fba+LoHX4SwdJGQCQiG+p9CPDoN1P74bdv+i/idUUHAn5CL9AZEmDvGN2oP1FzyOhVVFu1j8MPZ5d7/gyv8/BscwsVeOXm7pMkUfnXAiFh+1kyrA27057Uc3YOrZ241AaKEl087/+KQdk6TyYjNSpgj8INc+TLoGm0m0/tydh+BzH8MI/2f8Pv/UuYODl2S7qE7lOJxJ77skCnAP9oTGm/KpmU5blc+oHF3jxiFXyrDrIeCb9Bt0ikFjYLJrvT1KkNS1Pvx12LaaJSDfzFFJsaHb9eG7mPjjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JmgUli9E0+jNE5VOAjOYaDOY2oGXB+Sxi2jNBpBIROA=; b=YimFw3qcS3FApEK/5iCoLUcv0xkCgkN17/Z1JMHmLxmSOtz241PQRRucDdawThskNcOx3M6JpAmZuzz+MEbTI0kzP5ISRQ+cXghd4KSI0x5qZfpT370/ZYblZ9ZKXe5VZ/jd7IKU1sMPbTLui/38+Zi3U6B4iMyXvXpV1k9O5angygVAQ3pLfUMbdMKPNM+nlyKHSQLxUmqykY85PFSPiMgu4unnmFlhtk6p7zPyBv12bGlqafLxZUeurSZf3pRsmw9rI31X6mhQRbhltSJjC5hiDFhKJjWDXs8AiewrVsq2MvBzt3BqHWiNdBkaORn6dmw4QMFJ5CFLWPZfKrVptg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JmgUli9E0+jNE5VOAjOYaDOY2oGXB+Sxi2jNBpBIROA=; b=owEQwvNdAy9chUOsmcaz5szWeoL3EEb7wJ3ZuMu7cobaFXa0NcmOjmIiFATl+/YgjbNCXCFpCTvCz0kNDM8rSLHBfvj8OkC44RczP0qMAMIeQ0uI9gqEzB53+aGJpJgDZN9HY1Vw3d9v4TCqu3X9mYeWpQzZX74Pz1zLbWnh3u4= Received: from SA2PR10MB4587.namprd10.prod.outlook.com (2603:10b6:806:114::12) by MWHPR10MB1965.namprd10.prod.outlook.com (2603:10b6:300:10c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Fri, 10 Jun 2022 08:52:06 +0000 Received: from SA2PR10MB4587.namprd10.prod.outlook.com ([fe80::ec25:bdae:c65c:b24a]) by SA2PR10MB4587.namprd10.prod.outlook.com ([fe80::ec25:bdae:c65c:b24a%7]) with mapi id 15.20.5332.013; Fri, 10 Jun 2022 08:52:06 +0000 From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , zlang@kernel.org, david@fromorbit.com, djwong@kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH V2 4/4] xfs: Verify correctness of upgrading an fs to support large extent counters Date: Fri, 10 Jun 2022 14:21:35 +0530 Message-Id: <20220610085135.725400-5-chandan.babu@oracle.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220610085135.725400-1-chandan.babu@oracle.com> References: <20220610085135.725400-1-chandan.babu@oracle.com> X-ClientProxiedBy: TYAPR01CA0229.jpnprd01.prod.outlook.com (2603:1096:404:11e::25) To SA2PR10MB4587.namprd10.prod.outlook.com (2603:10b6:806:114::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e099409f-f3a3-4e51-7e2a-08da4abe7d6a X-MS-TrafficTypeDiagnostic: MWHPR10MB1965:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h78up8/Ha40f8fNbT1o4nfbVokty6EG5mrr7Y4feyIE5ZQwbha+xRwh52jcdvX6fOvHFqP0DAvIhHEm/nmM7bowg0jt8bhAsHZbQ3u6v4yeq0Hts1Gem2yohlVGAOE7oS17obwH+F8bMm9xwXQuyhUEc8aYrhbFW+xIftBpsT+a4oUcGbnG5FXFeFmu00Mu7mIVt2Mm3tMzXHzd9ZCuWOP01yjeusJSSFyEzikai42F5MhBEc67c9xB68enLXVO6xnOeNe7xMvsydHcsiu1Vkd+vC9Aui3Q8z6QSaX8bn4X+2T4QVu5biJiBNTbo9UCIlOiY1XBEFmMGx6UsNq9l6oecCUt2Hv6jhnf8z1gPhz4c+uNuoRcnJZH96siCncC2vxA55kaMLpaf71Jl2QRoNjfh5xO0YGLjyhwzPeS4JOoy0kKIjOstxVys2eL1kBg//okoSDO1hvTI1vBg63HzuuFEvCibmTnH7PBdnc95wiV2JvjFlDAkpUzb6/8oUs9m+1lhjO5wrP3SVsNneMevXAWe5ra30jRFSn32hgmyaY0hHL2cMEPAMclHkdnaZs3he5J3kM6aQFwwhpvIJ2IN4LXQCPDFnL1IuEna7jeD8gAuFwAgLLhxrh5QMcJ9GdE9MmCh2h66tZiiPuiLZ3CREJZt/UBzy2KYrtTXrLtyjeKtwuwC8f22ODYIjAVJ7hMDMxn1MNb6nG19lUcmYZIq6Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA2PR10MB4587.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(2616005)(15650500001)(6506007)(6486002)(508600001)(86362001)(52116002)(26005)(6512007)(6666004)(1076003)(186003)(2906002)(83380400001)(66556008)(8936002)(5660300002)(66946007)(36756003)(316002)(38350700002)(6916009)(38100700002)(4326008)(8676002)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8PCiMPKZBt55mkqjt1nGbGFjfrdiEUjVG0gFoeTZ1dia/FrF2uproXzC6nvPS2tGyiYC/VYf2dn7tk60Su0TiHZm9HmxAC03w4Hab7BUmZX26WCr08VvGyh+fZAvD0jgqQvX6eZvOX/N4+usi+SApX6zLA3kj+bHSb48JaxoPsd3ESGT7jmac4id8fU7FcWfUG/CpGwaKmGPFLorVNSEcVQvTwWIzUUNfqk8/+JqKtldFZf5f1Lve4pwnm3+YbjOI/0kwnmzgB+8i1OBYJhlHV0re8MDP0NfTGomIRw3EEsXRhvA664vHaHLiUlg6GznFwebU9jJ5TB3XLm69Ab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hZYYmNpw96r0gTIHmDdDPeXIfksV1Qxud9gMeTjo4BUMdJYEkTN8eRxwlWasvh5BINv+XCqEVvcPi84L5heR/BkcKy6jHY8iMLfLzTEO0DpzeuWJQbf1GifI/6Prl4/sUjCh1yISDVL09dYX1pMUYcjIrQXS7wy0PPBx2+PTHQjsuu/fxoRCIgmgzT5g1RoUVQVNWzxtfyAOKxisyqaAO7LmmEcsQN3BX5+8x3nokp9AAEt9KxJP6R0mTOK6RJQm/KLd0As1mRfjBx+cgtRiYix0ww4KB5Aurn1yJ9fCVCcPfQbksPVdb4GWQaA8qxTuiBOpjfVgfTjt1uJmAPi2zUbI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e099409f-f3a3-4e51-7e2a-08da4abe7d6a X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4587.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 08:52:03.7062 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: R+SoIC/CyJyA98Nnre2CTC4BKMzRqQ/z7mESex5TZ94a0rU+vLx0FG3Np1WeuZ3D8fv7EQMyTiZsGDoJjek3oA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1965 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.874 definitions=2022-06-10_02:2022-06-09,2022-06-10 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 bulkscore=0 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206100032 X-Proofpoint-ORIG-GUID: 5a5sTDWmrZaXzkSKwQp1I-UBvaSlggoc X-Proofpoint-GUID: 5a5sTDWmrZaXzkSKwQp1I-UBvaSlggoc Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org This commit adds a test to verify upgrade of an existing V5 filesystem to support large extent counters. Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R --- tests/xfs/548 | 112 ++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/548.out | 12 +++++ 2 files changed, 124 insertions(+) create mode 100755 tests/xfs/548 create mode 100644 tests/xfs/548.out diff --git a/tests/xfs/548 b/tests/xfs/548 new file mode 100755 index 00000000..560c90fd --- /dev/null +++ b/tests/xfs/548 @@ -0,0 +1,112 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2022 Oracle. All Rights Reserved. +# +# FS QA Test 548 +# +# Test to verify upgrade of an existing V5 filesystem to support large extent +# counters. +# +. ./common/preamble +_begin_fstest auto quick metadata + +# Import common functions. +. ./common/filter +. ./common/attr +. ./common/inject +. ./common/populate + +# real QA test starts here +_supported_fs xfs +_require_scratch +_require_xfs_nrext64 +_require_attrs +_require_xfs_debug +_require_xfs_db_command path +_require_test_program "punch-alternating" +_require_xfs_io_error_injection "bmap_alloc_minlen_extent" + +_scratch_mkfs -d size=$((512 * 1024 * 1024)) >> $seqres.full +_scratch_mount >> $seqres.full + +bsize=$(_get_file_block_size $SCRATCH_MNT) + +testfile=$SCRATCH_MNT/testfile + +nr_blks=20 + +echo "Add blocks to file's data fork" +$XFS_IO_PROG -f -c "pwrite 0 $((nr_blks * bsize))" $testfile \ + >> $seqres.full +$here/src/punch-alternating $testfile + +echo "Consume free space" +fillerdir=$SCRATCH_MNT/fillerdir +nr_free_blks=$(stat -f -c '%f' $SCRATCH_MNT) +nr_free_blks=$((nr_free_blks * 90 / 100)) + +_fill_fs $((bsize * nr_free_blks)) $fillerdir $bsize 0 \ + >> $seqres.full 2>&1 + +echo "Create fragmented filesystem" +for dentry in $(ls -1 $fillerdir/); do + $here/src/punch-alternating $fillerdir/$dentry >> $seqres.full +done + +echo "Inject bmap_alloc_minlen_extent error tag" +_scratch_inject_error bmap_alloc_minlen_extent 1 + +echo "Add blocks to file's attr fork" +nr_blks=10 +attr_len=255 +nr_attrs=$((nr_blks * bsize / attr_len)) +for i in $(seq 1 $nr_attrs); do + attr="$(printf "trusted.%0247d" $i)" + $SETFATTR_PROG -n "$attr" $testfile >> $seqres.full 2>&1 + [[ $? != 0 ]] && break +done + +echo "Unmount filesystem" +_scratch_unmount >> $seqres.full + +orig_dcnt=$(_scratch_xfs_get_metadata_field core.nextents \ + "path /$(basename $testfile)") +orig_acnt=$(_scratch_xfs_get_metadata_field core.naextents \ + "path /$(basename $testfile)") + +echo "Upgrade filesystem to support large extent counters" +_scratch_xfs_admin -O nrext64=1 >> $seqres.full 2>&1 +if [[ $? != 0 ]]; then + _notrun "Filesystem geometry is not suitable for upgrading" +fi + + +echo "Mount filesystem" +_scratch_mount >> $seqres.full + +echo "Modify inode core" +touch $testfile + +echo "Unmount filesystem" +_scratch_unmount >> $seqres.full + +dcnt=$(_scratch_xfs_get_metadata_field core.nextents \ + "path /$(basename $testfile)") +acnt=$(_scratch_xfs_get_metadata_field core.naextents \ + "path /$(basename $testfile)") + +echo "Verify inode extent counter values after fs upgrade" + +if [[ $orig_dcnt != $dcnt ]]; then + echo "Corrupt data extent counter" + exit 1 +fi + +if [[ $orig_acnt != $acnt ]]; then + echo "Corrupt attr extent counter" + exit 1 +fi + +# success, all done +status=0 +exit diff --git a/tests/xfs/548.out b/tests/xfs/548.out new file mode 100644 index 00000000..19a7f907 --- /dev/null +++ b/tests/xfs/548.out @@ -0,0 +1,12 @@ +QA output created by 548 +Add blocks to file's data fork +Consume free space +Create fragmented filesystem +Inject bmap_alloc_minlen_extent error tag +Add blocks to file's attr fork +Unmount filesystem +Upgrade filesystem to support large extent counters +Mount filesystem +Modify inode core +Unmount filesystem +Verify inode extent counter values after fs upgrade