From patchwork Sat Jun 11 11:10: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: 12878454 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 F06FACCA47D for ; Sat, 11 Jun 2022 11:11:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230088AbiFKLLS (ORCPT ); Sat, 11 Jun 2022 07:11:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232950AbiFKLLP (ORCPT ); Sat, 11 Jun 2022 07:11:15 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F60D25E0; Sat, 11 Jun 2022 04:11:14 -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 25B1VdZO004513; Sat, 11 Jun 2022 11:11: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=0PNaPE0pawrFPLKHZmMxU6GAPCV38K51uZiYFfCkJW4=; b=aLC6Q4apcGC30afTGPbUXdiWrelSosGft8tkua2g3s3dnio12ztYY7Qp9JDG4xRu0BpS GtfltvWQJeQj760AtjdboRIEs+QoqkTyh1BXpdb5gifdoWH9EvUjOTcjT5guT9vvZSh8 jTIctSmloTG/1GILN/uXbtIAXd/nsg3pCfGxfVzeTL5m8F+certHfqjzGj0SdNXsqO5P UXjrYGgC8m3Y0PSSd7Je4x9k5PEf2MPXwiQdGkg73eCfPi5ikyfk2TwlojRTjw0tKxE+ D4lYBhJwBTuC4Z2OcO+0rJdP1Tzy45K2PqBp/LTbCgnvGG+B6eJ2VJIaN4WXb5Au202z Tg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gmhfcge7b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 11 Jun 2022 11:11:07 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25BBAeHw012939; Sat, 11 Jun 2022 11:11:06 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2105.outbound.protection.outlook.com [104.47.58.105]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gmhg0pgff-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 11 Jun 2022 11:11:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WpCpsOZSp82E6ynbKk8oHcMjn5Yl7wfFkiV5mGvjnxMH77RlJ7CuZdzk2xwB2WmqN2XtY3Z+sDo0zmxtSp7ZaAQli9AdIlN0iWxCaRJy0ZFn6d+lhq3+9rbp37qZoICWyTx3U/vPKKvE6mbb7uV389Ez2VbTRFyVggO2CywIrhjER0Yr8p49RCcoQqja0+72AYhO5cfdFGLRlc5e6TybJjpvJNHQKKVh7qDGRI53UmcAk+eHSZK9gCKzHzkSdYPy03Ed5729eIijcDsjeTRFb4+C/ixVVuGs0jENVM5TkwHYzw5Y1pFWWeYsfgWXOqTUXR8wCzG2AGUKGe2U3vxyfQ== 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=0PNaPE0pawrFPLKHZmMxU6GAPCV38K51uZiYFfCkJW4=; b=gxbRipiT7AYSU8aZaBxGqv7IQiUuCTXQ1X1C5DIzyNtDAiXXly0/SZf9hoXK+JiqicjTTcRm7C95ILayGzKtnJCvNrohP8HXY+4rq9PhSRu5VTdSJxhWfkHb2SAnOQ7HfYkiVHmQUTyZPS2WzdDMHHSsaCiaZctI3vQhWxZayYb4fllr+/cRBtcHykitf2nXGosyEX0/KDjTuc91D7uNxh3MY5yr0X+adRvq3bnSENpChgjaWHI2ZBg13xRtlhUO+8W9HgUTxHEgbGlr8plsqEZjPAxNW+uCg+FjNqY8bJgvPSYu/GIWwpQ0oCgZ546P9J0kpBTu+8ZD1e4F5ftxIA== 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=0PNaPE0pawrFPLKHZmMxU6GAPCV38K51uZiYFfCkJW4=; b=hpPL5DdnYYJvWVz/36Kd3hc5NmUSnNMoHfydESjKKIQCeGLo2Mkw5hU+iSze1j0DI2ClvXULaZp0LWWg7gKZG86YMiNfuhk6STc6yC86hiyUisD7JP8RkMLww0RC/autYJHIvQipKN3OCra7lGZDJ2pUH+Am6CvwyHrrlTHoYgE= Received: from SA2PR10MB4587.namprd10.prod.outlook.com (2603:10b6:806:114::12) by BN8PR10MB3313.namprd10.prod.outlook.com (2603:10b6:408:c1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.17; Sat, 11 Jun 2022 11:11: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.016; Sat, 11 Jun 2022 11:11: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 V3 1/4] xfs/270: Fix ro mount failure when nrext64 option is enabled Date: Sat, 11 Jun 2022 16:40:34 +0530 Message-Id: <20220611111037.433134-2-chandan.babu@oracle.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220611111037.433134-1-chandan.babu@oracle.com> References: <20220611111037.433134-1-chandan.babu@oracle.com> X-ClientProxiedBy: TYBP286CA0014.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::26) 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: 097a6b2d-f27a-4a9c-34a1-08da4b9b13a2 X-MS-TrafficTypeDiagnostic: BN8PR10MB3313: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: 2D3banXemBi84WxRXKKt6Vx9AU80FHayvlE3QC/j8pWpJUOiVXPTLW2WgzS0uZo/AswcCaeoIK2up95ZnBURD1XJsSH/I9DyWnCLzE5L+1pMjlNndjQUbP3Opkn80wqY5OgpF3yKEVqNMkHvwdvEBw23Tt4Znrpybfd34wXrdAiG5vX+0wTIuvs/lb6ZBixyXIYTH3T0z4rRgA04QppwbVaeeLwSQpC2iTzMSa0OShF6RfOp3VmZN2g57P9g/k4agR7NFPGPVgOKlZBm0rGA4tSzljvVxpAti47Vi37xXBp3L1q/UPXlk+XGICn7fuvc/H8LMfgynWW30zs5CimCo+/QIEUFzyS5hSSDBhLbt4xulangYfnFbrspyjB1dHC8xvYFNaV7Wepk6bMBHl7rWEVeg48u+9N16QvEU5hLpPcPzOh+JEOj0+Q3XZ8ZeolGi9AF72JC6QLc1Xvmcw294Kb1aTtvPD32oAFwoWs5mfY3VNOca01txUdo9oGO5Z2ATSzDV7gENPj4Rjj1bn+P4ppjjFONikj4S8rc+cFj95Kf4C3ZxtWqS6T6OIhzi+4PnLoPRp+I95aj8xD+6PtDsLjqPx+p5g4Ayi46/2bfrJTf0rREBhHC96ZWwHM+UxcI4ToqLe4Sth2HzSpZSXy4UtOo2FrofuBTdbBIEQr6MGoZyv48z4jU900a7pu8iTdR/AY6GvxzIyF9UX/KH4oodA== 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:(13230016)(366004)(316002)(186003)(2906002)(1076003)(83380400001)(6916009)(2616005)(36756003)(26005)(66556008)(8936002)(6666004)(508600001)(8676002)(4326008)(66946007)(66476007)(6512007)(5660300002)(6506007)(52116002)(6486002)(38100700002)(86362001)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6DD2UFThec7D2i9m6D2DLC0GyBhTCJjMX38Q9NdKnOLnh41Ps0Rnc8cp5d6ml77kauN0O0VXnCfFoStbhhfAxqznk6U6YOpzP5YpAiupd5nIErNcJ7MOCmR0m78pfbHUARlV1aupDHnkjKtH8IAo9Hs7wnk4B8D9+3V58+o6z0gs70kD4jF5sENM+2wdYRYEouu38Er/74X01qmX5u7kPHFOBZGtxQdUPQ5C7mXB0X7SQs2DoJLtyuSzfuDcXqbGiHFES1tRo/KWR2+MRL1lt++paxr9X9KWf1IIwmojOFKAzWJt2SL6n5RUVrM5uMjVrrk/SXDjoBmN2jBxOs+YDi7DyQo5hCeJupeLCcorNRwm8qtdWuSXICet8C7TF6D+GPBsY63vSd4iZbWoW9ik4jRwkUzgPTiEH9h7/+lS3FgAiXBzqFf6OEu9Os8pqBfJMuQhfKROvy/qrnNZ2kvFv+xi9x5PxMNRq/tdiuq+5P1C1LlcMpAzmIVeKt/bgupIpIexBrAN5tVeMVn3wnMQ9VMUKThHgtENE77KTZpmREA33iLt5wDBAvucwtLOJVAjD71HWROWF1uKbGzXOsisE+RZfh6XIklayLDuQrjVbIVsg6RVPgXzflw0Z2OZkp8IRmbtX+lWF7dtsdGiYrAx8AeHSsDI8OZ2Us17r6lDbm9QzDIVJUlzqWQajsVEdK0q3QIcy6RPmNo4mGp5kUmS8STdDusRV8tnjcCS+Zr/GglrnGL/+9K7wkTKlq/nnlYQrmgmwIrcYA9zxC+HMPC8OyNGroADyTLeBuF7D5YcgL8HEyAL/e2vsZ6zFvhWtBz2EkE9iL5z6yyigd+wthivOYwg+j9fR4D2GPJyLUYsr0NFt0x4128M95399z+/utqJSS7T6xeBluQ2LQX13QkLnVbx+RuS+vflUgKq7Alc16xJKHa/gHfmMRsjagR4d8t2OfPuXMC+bA8sMAfjEpMW86MCxJHpZPnoSDgzzE+yKl699926gDxU7ft15X0WC9zIjWFC2ezWkHEsu+3kcGhmpp0zS66NNB1OwDFoVrQnboSKWdt7RfQXEQ/7+HrFItUcFv41CQtKnqiuHI4fhFhlXpIxEFzkHNkFI+6PC1D287YCIs8zxAVuv1s/KadYtT1/HB6Lf5g1imBjD/1G9x4NAMXub9QKmlG1pcQRmglZ6ARN4yggE14IAQJREbEXh55GZr8VxWszcu87A1rfpEFBt2TZZg/6lkgJqKA9YLE4uGYZ8lUGPOpdwzVuwurjU05H/xqRbJcrWcclAgw9Njfp4hR+4zyelOw3UiTLwNdzmS/l84Ft4aCYmHdrQOFRDeTFDu0fx/G842Tu13PCgrkwjPmtDEpKMAjM9J6sy2rAnM8IK5OZ8cU1IJPqbI1CnvZjC93JyWtpXZjQ/pKhG25bIG3gG3RBhOrIpAZr//L3lYCek9583fYVhIK5htVAPlneh9PS0p+MJYXxgnE26ovUtsV0zH09sczd+1t1HhBm7ePA2GbVSY8C7kvwcz7TfnOIR4oIeq0Rvi7komuuDCDemIl6yf4Dps9TuVHPgdKsqPg9Sx7JnCTzzC1l+e2sxU8zeMXVlJxtXlD6aisAV8erlVsqvBic/8aWUUsQWJpOQs4cB+LX4Tg83R1doESibgZTjM9wB6JRlgqUpHf7PkFd2uhGenelGdXIFGTRNTnyCjSDVAYYmaRU0IW3FAlNdmQlUIisNZLIzdqgjtu3/IUpIqVKVVKUJPU5KqneJ9WRZRo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 097a6b2d-f27a-4a9c-34a1-08da4b9b13a2 X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4587.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 11:11:04.9946 (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: IaHLhGCG1bly9eE67v92uyAK6YRpsgDjpPR5Ldsed/xv50NlnuxmG5Yd/3/yg5qjHxiFgCE+Gvm81DUzGUTzWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR10MB3313 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.874 definitions=2022-06-11_05:2022-06-09,2022-06-11 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 spamscore=0 phishscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206110046 X-Proofpoint-ORIG-GUID: f43iSZZUrqbRTmX3div0HRlinaUnSUuZ X-Proofpoint-GUID: f43iSZZUrqbRTmX3div0HRlinaUnSUuZ 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. Signed-off-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- tests/xfs/270 | 26 ++++++++++++++++++++++++-- tests/xfs/270.out | 1 - 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/tests/xfs/270 b/tests/xfs/270 index 0ab0c7d8..b740c379 100755 --- a/tests/xfs/270 +++ b/tests/xfs/270 @@ -27,8 +27,30 @@ _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") +echo $ro_compat | grep -q -E '^0x[[:xdigit:]]$' +if [[ $? != 0 ]]; then + echo "features_ro_compat has an invalid value." +fi + +ro_compat=$(echo $ro_compat | \ + awk '/^0x[[:xdigit:]]+/ { + 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 Sat Jun 11 11:10: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: 12878455 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 BE67DC43334 for ; Sat, 11 Jun 2022 11:11:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231642AbiFKLLT (ORCPT ); Sat, 11 Jun 2022 07:11:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233016AbiFKLLQ (ORCPT ); Sat, 11 Jun 2022 07:11:16 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25E6F11153; Sat, 11 Jun 2022 04:11:15 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25B3C29g023987; Sat, 11 Jun 2022 11:11:11 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=Bben4WFcMgmNwBxWJHG+HKAL/4V5NxgijURqkN/s7dg=; b=zOOH//gzm0JRCfIxvVuFHSz9FkRZuDAiAX2f0UoVvalCWlyJFW45gwHyPpgiYfjOG7tc 1p5N9RFh+mJVUxmQ2rvt8x24oWxLG+H3aPZxejgwBKrnHkoAq2wp7xPhUClxBW6HfG86 OdYH8zQiEVFdViAZhDqaYxQhTyrhQ7m3eBAsz4z7KAs0YLkRWb8V7AX1NAs8H1YGb3Uc xQPKhofoiHM7WLhwfqkxy+TtZTtLSMQmQyvggY+1Kv2AKK1ziJ3GTGXoGEhbLZFhW1qr rAy8hl9wilR4RSq5Io9QgMsFQTyE+E08WPHh6jylO2IWVD0Gi/5LcQ0MwXIPdA1WujPF OA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gmjx98cka-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 11 Jun 2022 11:11:11 +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 25BBAS4R035419; Sat, 11 Jun 2022 11:11:11 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2106.outbound.protection.outlook.com [104.47.58.106]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gmhg0734s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 11 Jun 2022 11:11:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IM5VQgXufVL5BhMDmSWm59gTlIStRCmhVyl7tXiVy5mDQNfZ6saWNAe4HXii5F6bQH6ndCr1EQrjHLF2Dq/YQT1iBDwgu+LU3XFTYSPeUY1Lb6PRL6MNb+SvBfJjJlLJ3A2uODxAkp66uQMPHVi9790jnNuHGqOePXLQsn3fOkfxOqhk2v22hTYzqRa+kdYr/NZ9/ijiGLe0LFId8pX1ajSxm8igr6GP+LWAl6Mm3bxIqFC3HD4IguVXhZdCP0QGfGc6GPZ4mQ3Vs2vuK2rbw7poSwhSbHIAL63ChwhTigDXBuQLQyZSKq7BSNOIuxrtNWdmGG3yhOS+WvejN9zA+A== 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=Bben4WFcMgmNwBxWJHG+HKAL/4V5NxgijURqkN/s7dg=; b=D4q0jVhliMgyoTtZbJUrOR72ycSr9Tr9ig+oLD5D5SyyhlgyD8MFTg7MCjrb+bU4Z5W7INiBbMvUSlA0sqzofYRsPyzfpi74HM6rZEo/J1DOjcanVOWIVugHO/t9sa24qUHHE1XrbYWWuMAuxkz5Yit/tsjSb6Lo21jdRwbD0KwCSFxMnH9UpQPL2fnQHboxq9q2O7s3Ijg6WwetTXAvBfv5KFBLIB5RPhzYOiMJnTThK/+L5bnneAiB85e+787JUWV11pTxikQ7a7p1knuilYrzWc50ta5I4fd1FaZzFUsTx4oKgxp8fLhs8jtphfq57LkQzxwnkA3lKZx+0ecUXg== 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=Bben4WFcMgmNwBxWJHG+HKAL/4V5NxgijURqkN/s7dg=; b=i1Ek2bwFokP8DHSKGbcWv/BMzDEg5lHPoLUzPm3cnJSSNa1GS9cOYCepByuR9hmSc8M9Zxzavxr3jQXsF4gXjWbn8C9R8haFdW7BJBLyMKWuy1EGW3z8oM4bB6O394pWxSAjpI7GBEo9Um4NWPlWhSPfy01jR/WxDG/l7POqT50= Received: from SA2PR10MB4587.namprd10.prod.outlook.com (2603:10b6:806:114::12) by BN8PR10MB3313.namprd10.prod.outlook.com (2603:10b6:408:c1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.17; Sat, 11 Jun 2022 11:11:08 +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.016; Sat, 11 Jun 2022 11:11:07 +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 V3 2/4] common/xfs: Add helper to check if nrext64 option is supported Date: Sat, 11 Jun 2022 16:40:35 +0530 Message-Id: <20220611111037.433134-3-chandan.babu@oracle.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220611111037.433134-1-chandan.babu@oracle.com> References: <20220611111037.433134-1-chandan.babu@oracle.com> X-ClientProxiedBy: TYBP286CA0014.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::26) 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: d0aea795-9f92-4c81-486b-08da4b9b1554 X-MS-TrafficTypeDiagnostic: BN8PR10MB3313: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: BOyMMoG2hq3RYUyPYFdBB33UfX6URuu0FhWmKTBrHxUyAjbuhm7ZTVExWdSTLe9QFIiSoGI++adlffpx7XcTfoqJ3H/PbrbDiZ/3Jjkzuq3j2y3jKyl4o2/RoDoif2z+lJsKOC02s8fkzFU37LKU7dSXW1P8T2UUHbVkKFtyj1QSuMOFUg+qb5YRy/sxCCjOngj6YSFQfsorrB1h/3owIDhQN0/e2qb5DG8Yum0yZiJu2EMjSrzKQd/+uLNEf5wwyyqzvnnnai3kyWytwLNP5lNHRV05fbq/MnptGyr618GdcnZg+F4z3twykheRoDMxK80N+692LSFXROko7p+xTsF+OReR43dOOQyvHe2yM2dxJE3vQ9lS/1qKRAjS8NKV55aGo9NhnMndvugZgY4c1j18FEvLL03mt/3QydWrAe0gqnXfxR/OAL48P5b5t953NvPB4ZUuiaWYBnWna8OK8ftGVCLzMbT9jqjsHj1/Wf6mgvJ0iUa6fEs+of97Tli/1nRn/GeT1eGh4vS2Wn9VIMNNy0Om13wprXy815Asffb/JzSTRd2sbDu4qPXSAocfhh+uDBNzY0050hz/bKCHHwartxFojuS3m1mnGEzBfOjvbcmsyqo38mAIGZCpbVkoIBSvDOzey2Xd7IIagXKliFKffz7PicuXDWVctiDf8RuqS7CvKj0OqRdf9Q3X72AMx4/qcz7i5Dt2cN6tu1uugw== 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:(13230016)(366004)(316002)(186003)(2906002)(1076003)(6916009)(2616005)(36756003)(26005)(66556008)(8936002)(4744005)(6666004)(508600001)(8676002)(4326008)(66946007)(66476007)(6512007)(5660300002)(6506007)(52116002)(6486002)(38100700002)(86362001)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VicRZNqLUqfAgEowGW6pm0MMCe9i9pfpZHmd77n54/DRx84QeR99pdh8IC7VQHbnq90HFKD3ygoPIvjq+YBzc0Zu/Y6Uzgoqn7BPbqDF8MtgailT6qo3o9wZZ+2eTyiBxkjW287nspettXcZAOCGkajIyzoYf2Q0Z7yU1sz8O7soAaNKmfYhoaHUBcnhNZY1VnN/6i/ml2u1G7b+KwLg7T9Q6d5GqWrriwNmHXkdhIe4d4qurfu+el1Df6DZ1WaBmxY9ME1neroptLByIH2IxjUQnQDaXUwDZ8d3GJvaCe7wog0Y3wsMutNFOHxVc6AXzmTxOVGTDnGLhW+ZM4vLuFaXXwU7zE+VoBoIV+RFD5Eu9Q3kRRWTl6MmiIwjv+6BB4qMbjk+y4GbqGUZiKgDb467ANbnk9DJrZwnpI72XhU8Q6xHxwkc0rJUqXSFmr4bjet5BW1tgCQErAFckgIJuVpsOc+8csJ/CtUDpKuCNVbCCIrL2ZqZLMj/rCSVh6oUDGKswkNwDLHB0rIDV5cAJTsUN1Yx3/vXFvxQC0pavLDrZ7JbHziY7YQ8jITL/A/yp+CpVy6HCZVy+8jMyUeCemnFYhF4dX8BpSGezrFQh+cNkbUqnJSpWEirzkoyqkFrjiOjCQBZylQvfPZo1pYfxkhobM6nAyw6RsBvHN02Q67QVtjL7fj+t8Ld7tZsf6t36zuaPnwZiqtG7YMUjK9XsnfzKoIYreTAjRqGNTJNaP8Q8HtIl20VlarB6stIrnr1fBzToCaIK7EFUKMe3NAoX6BHKco1O7FuX6SAXSxLyS0VX3JDgHRa3URR9hWeDwNpkghKwvZZsXKs+iZC1afXHLZrQpvxNO5+aibxEDZAzKMViF5xfzne6mYoTbA3ZLFqbU2JF27Zbt5L67EmJ//aLcj+8gtzynZx6bZTis56wJRC2xvch1Ca/5weJf9F4fUT6aclUxQbXp0tXfxTtpTtzNN6X9uaWEL1YmPdlNcd6NsBLdK6NKtTGjlxF9HS0hfkjQWb1NFaXyGb8CO2vaJoo/Z9WX4q8m7ucWnBT4OJf2X5VOdjvLRvsk4UXpYRrXt8OXZrqaiK/JTv+yPlytGkPePN1Ea/FA62JnSad/Z6YccsCZNHeyB5vswxKTdUsJ9ST/HdJkGGGtjbgnWX+2Vds6LLhoDSzMjuplsN+PFkigq/JPhWbzuoJqF4gIjkn5THMP7VPW+kUpaKGJhgQfRNRafw3ekVyqTUZ1khgsK6Q0RL3AenJmdLxPr74PVH+MusQKhlOC+HWKPdBpryVuMho/uP8KSuDLk2dMOvs7y500oiuX9SGObmLOildhfEB6M3aA5ODYR2tHyInD7zG503ejq0qoOjga/eThEPfxsFM5lTNfnx70HuwaC0ZgClfMqo0G93SQ5dcZ0+5qtYtG3tB3gq0oXNe8B/zRIP5F1YMt2DJGSgSRkSbIickqH0NUxhNx8JEYGcjMTvPtTE+kSWx301ePzd5NezFEnB3r45WZZbSdLsM3WuViRjiExv7Nl9wFiY1paGWxJjl4e7BQfzv5v/DOeLrJRaeKxiphQzuQ2RR8hxpKZhDYkAHo7PTgNQXmYyr8Ncq4eJACWnHwIhAYLod8wtl9Rjj+SimhtqkJHZEDex0YFf4KEvMm0COCP75GRq8yQd1pPTvmdBJiYqOQmgSoquTQwEGPW3KEPsc9ShFvU9VsdkOHY2YtJKSCtM+eqMcD7y+hyAJa/d3ia016WxtPSbsWN5MWKircQ+g+4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0aea795-9f92-4c81-486b-08da4b9b1554 X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4587.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 11:11:07.8861 (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: wxyXtVOHAnQh6FBE8sDGrx5gkgZImC+q+i1AiSvLaRzcByC4lhaWDjq3NBOLWoWyFWBESWy7OQDIY+46aDOd0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR10MB3313 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.874 definitions=2022-06-11_05:2022-06-09,2022-06-11 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 phishscore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206110046 X-Proofpoint-ORIG-GUID: YgS9KdAQsdckHD7ipMMh6VPvAgsJFcWY X-Proofpoint-GUID: YgS9KdAQsdckHD7ipMMh6VPvAgsJFcWY 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. 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 Sat Jun 11 11:10:36 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: 12878456 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 855CDCCA480 for ; Sat, 11 Jun 2022 11:11:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232801AbiFKLLT (ORCPT ); Sat, 11 Jun 2022 07:11:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230298AbiFKLLS (ORCPT ); Sat, 11 Jun 2022 07:11:18 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 435F625E0; Sat, 11 Jun 2022 04:11:18 -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 25B3vwus029675; Sat, 11 Jun 2022 11:11:15 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=H2VIIw3vfVmlLGiHA49NgaWkWHM5/2h+hSqGYvvRmPc=; b=c4G0iyY1EhWphDsVxcUn2ecX6p7Hly81c7AMsncyHS5Co7qDNrijnoWnd70w5bckLf+B +bJu35k+8xS8U/08qfIC1uvSQFxKNC3GGsgsq2uhai/mfpQ0F+yO8l7gd4OpeHMrW+1U OtVIMqFgfD9ZtBUXnBx/29cOD9/fsynKCusQu1xUQ8KatWgVzw1OJHdpGxxj/OhSJ8y/ kJRV8uylfFR1f2Fw6p3YAmwNI+/zLAp4xBADJSMboBehT6a83UhKUCprKa7Yilm+WBUT XoYmhgObOV6McoFtI+6bt7tqXTm7Jpo0RvYxqeCjL2S6rDJRcOTNHbQ/Z1q3SSXRNgEI lw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gmkkt8bvw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 11 Jun 2022 11:11:14 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25BBAipM012639; Sat, 11 Jun 2022 11:11:14 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2106.outbound.protection.outlook.com [104.47.58.106]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gmhg0q4mk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 11 Jun 2022 11:11:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m8ZPbULZn/CnAdWsonsbX0SmEA5EjJk+vaxGr+4qEAmymfSEMjwEnAxaDTC9kcnebniX3fwYg2CcMVNNiNxq87SqMSpSGpbnu+MEr0SIQNIwiT6Fyeot1WSEv1vFm7wDsnWB4i5DVdqiXeqLtlF2EmpbHb8AbvU4IzA3deH5lKgQelVlsAfIcHeoCfjjv2h0lClVcd6g3k2eNsP8l/a/A0zDhvY3va4TfHBCiMJByzy86jLxeSpBDhjoRSSE3G7i1OWFZmTSFF2SJ11pdCkxE3Yx1M7dZ/CauisX7X1mKS3DB8OXJI/J+lmsgO9nL9HwVoYPakdLIewwefD8sBXt1g== 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=H2VIIw3vfVmlLGiHA49NgaWkWHM5/2h+hSqGYvvRmPc=; b=OXEO8o6Oc/oy7uNMUFQKZFCq6vikRfPUvcVt4ZWxTkRt+prz1+gpq6c4hsvR+Ew+2KWjan7a/aClACmQXYdAwuE5huIfxY2QR97OTf/UqHnVsz/hQXAOfGwKywtWHn7j7AS+Uh2kDrwCxfdSNJ3uvj99541VRa3CjF1BbJB6Za/p+UefvDp5d5IKqsMVwSzU9x4+NIzV8o++sml49698RYIDcQ52rX5LGY+/8o5rqaI4SZL4s+NczW6DC7xJ2G2XdSol2fJ5FKDg1V56He0bpeyo/U80iJ68KdNC5PDWNm6eJGn+1R6Qy89q9PObAth5PZP0k3zHM166/55ajWc2xQ== 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=H2VIIw3vfVmlLGiHA49NgaWkWHM5/2h+hSqGYvvRmPc=; b=Z99Np6jFG17C5FnNcjrNFf92HiRZUtHeMLvvaOuJCeVQMhUVFpffRqud4xDHscaZApbG0X5E7eBRgd5/qr157xxNu/y9/kaitbV1U/C4hFbs8yOZsW/y8r8j6VLw0xlbJu0ECk+V/Z9KH8U3FVYDhRIAjwR3lZSm+0iBA9vxS4U= Received: from SA2PR10MB4587.namprd10.prod.outlook.com (2603:10b6:806:114::12) by BN8PR10MB3313.namprd10.prod.outlook.com (2603:10b6:408:c1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.17; Sat, 11 Jun 2022 11:11:10 +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.016; Sat, 11 Jun 2022 11:11:10 +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 V3 3/4] xfs: Verify that the correct inode extent counters are updated with/without nrext64 Date: Sat, 11 Jun 2022 16:40:36 +0530 Message-Id: <20220611111037.433134-4-chandan.babu@oracle.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220611111037.433134-1-chandan.babu@oracle.com> References: <20220611111037.433134-1-chandan.babu@oracle.com> X-ClientProxiedBy: TYBP286CA0014.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::26) 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: 394e393c-1a05-4dec-9563-08da4b9b1719 X-MS-TrafficTypeDiagnostic: BN8PR10MB3313: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: 7yZK3F1+Z+OtvGVu2sQtkRMKaDqBSsauIO4KoGWJa/yUgJn96KA5DdHJ+SQllO357BxMyk6ghVGU0xsC6HdBJQ57GJCw9EP+FeZqw06rMHNW8y9UczkUDTYrrS4JMHv+p+HT/EGot8TQmQ/ChnbMvy0e0ej5yWNFSA4bOQu32+kmidA6FUZFPDL0636feO2Oh6D5U2Y1cAcXhBxWnAh/rwKd3tFs8e7lYq4ehLNkQnsb1iUmmZZF9ShEdfU2ER3Pvzl5JJSABZ92l0ODxllctdaNuOKnk8AFWH7c71uQ7uOfL7tOQlxzbzI3iqgw3qVGquSkSBqExAwJyVmQdAm+q/yeQsw2bExjoUU3m3gnttcAUkC0m4Hxy5XEfa8DQ/nYCBpPP9RdMaIpF3KIcFGSF1Or2BIsPrN9vgPRS16h7xRv2lpCCDN+If7LdMD09XEYOYtgUV6N7ecLUVsdyHhqh9eiTsqDjItd5kPhDisSO3MWg/a8uyG6zBcKXxczIPTwtA1yTeJ221uzqUxbhrPN8tUJZnIrl3eF005k9pDVjKDY1hJIt70v2r5TweuCYXzLqbbv8yXUdHz8PsQ3hXMiHlJTuf98vIFdDTriM+v9lXtctyv6vzSMymPKhUO5GA/J7yi38uvDNtBNjtHio3yWO8wdhFIkRttUypAzJ0/Uk5Vk9CcrzTMAt+v/3c6Rfh64nDHP1yBAHHSTO4+MfsVdhQ== 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:(13230016)(366004)(316002)(186003)(2906002)(1076003)(83380400001)(6916009)(15650500001)(2616005)(36756003)(26005)(66556008)(8936002)(6666004)(508600001)(8676002)(4326008)(66946007)(66476007)(6512007)(5660300002)(6506007)(52116002)(6486002)(38100700002)(86362001)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1OffKz+FROy1JFCl/kOfuCt+JTki50szruUVUqaPWioSIMgWa5uBNXLU8aGlbVbfRPpQpZ/k/yGqOvpxS0JNn/r9Cl1XkkbnS5J4KZR3V8bNAg9FNbqT1NO1HPnUoF+IDbdM7FTbCaH6d54GaLhXPQy+82us+FO8NcZvOzreGFlfqezcWVUiDn44lnzkTTDbWffwlNdGsBp62oI1gefUSPfTG1+527fn6m1Zdt+Hzx3kRMOlz3k+ZSqXupf3s9UNxI+dds61ASEpUzp1YUjvBMf+9u3NNRYhRtU3kuRw9MW6XmbPD3zc5jqhxYKKsNHRJrdp3z1TQLcJd8l31POPNt0ym/K3IwlQMCNpkfcSU1rUs+PIhHRBUYZr8plmnmTEDLaPHqxJNf3NNBNGKmzMBN1hwYIhDGqdk5QjvjrH/eLNP48jcLK6SW4Y/lL3AcAVwXTDnuI06c4pPJKYPRw8Rln1mXTRB311tXqO0XrCju0F4nmglX/zxXx2XGg+h5RJoTLsEWYgP9EvFMRKI2SUrgPoKaXQGitWOZUc4Ike9S5BXmSeaEhen6dUINpCoDQXkXTg189LMWNY71pKhUj+J0goKyH1WH1aaqpWBhog6xaGNTc4lFKDLoEXsXWM93evlS0fMCtuEAW2qvJp+9fQu0DQ8UM/Oq+4RIfQ575qH2BtdlCnG8sqpz+Ed4DjX749xlGjdUdQobmvKTppZnZN4H1creOpOMZTRJyWo8tXqrrsgViSvjvy8AdFjJGvfVIrzQRzDN1V48nmnYehtzQMZPR1NuOYJsr8EzvQ75B+/VaJ25eHrZlIq3ldFheXg9jBw8NfvIgQGzXfjwl3d6naUvGHMkyY9XnDs30almmUrhgsVXb+e6frnDqqYrqPp+6el14JjTN88aHwIgbMsN+fklEKe7+XUCTz2mX/nKBxy2aslX0ovkQzzGMozGnxFL2FlVdIYP61aznvgIxj63c3QEKEnROUhCMKGyTlVDOgsX8RA1pTcQrGXXlNOTzPhJCrWrNPEdN9IJx7w0VYkBsZbedth0qQsX6U1qzQhbEHV7/BUxDDprk0Swi60eOTmjI5lIJGHA4femjhWILmtl+whWFqRzymkagqOV5vgz0hhv3OR0Om9ygr82IS9WBmcitBzYth9XBUn9Ggm4vOV7t+wj1gWTn+NlV6cfKIhDYvjQrceGsV06YzaSV6z++m1YCJLvdcXpZLzuvPn3jIF/L1ExlUdqo+TQf+zYLxQ6UQusvmAVkOPz9LAOid57lpCrBLOs7cX7TGEiQ/u09asdb9tPjGICHQGMn4pP38d8StXvuCyzKnLysJvBQINyGrKDMc8X2yDK5fsAm6jH/CN54ZwevCwOJalGp6pdv1P5aXUxL0mZIeYHGz6vKOsZYIvDLb354hqYueSXjk8mtHQ4gtQt5X7ofWffzArJMoVa1yvxHKn/LpMT3qna/1QnBAwKAxpQp+sbl27ddjfOAwrqSQNiAYT8hNx0e8jp0lmIA6dXp/b+oI6Cf3UGoIyL2U2iv89H1KVZ2/xNy+pgsU5bHe+i+Pmp9/QHwjEQP/sloB2/eXboPxYuQyUUPF+CWaF1YYEny5/stZ9oNgDs8kakxvOjjOs5Q+7/tgMgEf8IX36SolaDcZkYl+xhZ/rPRF8LyJ8yMmnePGD6X40BxraxEeLCqv83k1Ozbf9VYSqpAnK6CEDbO3S+YlxQQsiOCUbB+E08ougIEbsziCTCXEedPDpZHHWbXEfsU7kKxvwpE9uV4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 394e393c-1a05-4dec-9563-08da4b9b1719 X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4587.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 11:11:10.7930 (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: GsUkuQUDomk1L+T59zzpIOXpaMJNRFAaVY4Na2ztDHBKLud6TVx6UHae2HrgUfC+gfpHffQ0IhtwHvqDRfk9Sg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR10MB3313 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.874 definitions=2022-06-11_05:2022-06-09,2022-06-11 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 bulkscore=0 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206110046 X-Proofpoint-GUID: fauko6Vg9NnmB203JAf2PbRjfDOw_6lY X-Proofpoint-ORIG-GUID: fauko6Vg9NnmB203JAf2PbRjfDOw_6lY 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. 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 Sat Jun 11 11:10:37 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: 12878457 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 DB350C43334 for ; Sat, 11 Jun 2022 11:11:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233085AbiFKLLY (ORCPT ); Sat, 11 Jun 2022 07:11:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230298AbiFKLLW (ORCPT ); Sat, 11 Jun 2022 07:11:22 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BB5925E0; Sat, 11 Jun 2022 04:11:22 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25B1hoUU021293; Sat, 11 Jun 2022 11:11:16 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=/edaxxTxfVmDvup0m7uiLWYG4r6SWz3OjcGSz2WwaLg=; b=V+5NxQaJfHWJjxJqbGUojmb7nwxh5Kk7tlqwMQfQNGIP9y/gps8jQjnmVLfxXeUshRN5 t/fYIaBaEmbDosIzl9nfNIplVkugtb7JX3bNA68wgbNSNMCeyQhF6rcFBvXaygBvOyNq cPe0gmyBzKAJMmVmV4qMthfA3FhmhjKVLjko/ZpQp8eDDMnZqNnfMYudaVT9gcEB3cmt xC3TqU6c3u998QXiDzvzV+KoTgDQnn25v3Usah3zaiQbkj0Nhlr2xydPzZ4Yeb9JZ2+Y ErHHEG4C0skavaHlqQJda7VR+if/xeQQRaeQj4TFGpStwHUgKbJXszOcZq6TYWrFG71E gg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gmhn08e73-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 11 Jun 2022 11:11:16 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25BBAinM012617; Sat, 11 Jun 2022 11:11:15 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2106.outbound.protection.outlook.com [104.47.58.106]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gmhg0q4n8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 11 Jun 2022 11:11:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ItC/iColtK7nCMLhs3NS83troOGKG9bf9h9W8sTgcg2hzTJoUu7a663cX/kXBws2X3FF+jNt1BNDYulqaJP/izEpZ3bOyJdvLJqcpuDCBYXoqzBHGqOfTANDB5PhBEh7AgBPxk0++yLJkypO56gMARf42JiLBtbxTNfb6jYR4b/LmK9k7NWj9eWa7DVy2BMM5gw7uPmzm5LFV6ntulNlI6nZYzg0doO5yaq1KD6qnWXZeg1LfGoaQvTIee87ZMpI8GTQn0j/JGQVoc0FImbPEWDqteHAqwffDxWMAzY17PbmIeqFhEhUsK7sRKiYFu3+3NYSweuyY8Q/AoskYEcLbg== 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=/edaxxTxfVmDvup0m7uiLWYG4r6SWz3OjcGSz2WwaLg=; b=Ies7QqnO0fDsUs7Pldz8z+oTg2DQw/UApcudelTVsfsOReGXziL6CmHjzoRHYVdcqV0ZfSvZp3J3J35Eja8RaVwi0bMhbIbTLY1dVTmg1/7CoU6dWqLNoAB+C+x0RAyDjeOcS5t6ehOIRHOBA/hu6epmgCTsr/BvdGBZgmMwTSnv5rfhBi7sJF0svFZreMh1sYZoUt3vQ4mNsYOS+quMNzgPnIlpJ33LZZgdx+H6KxPfjGwLL3pIhAt397iRyndZvI3QUIm9HL30eb+btEfSPJOyHxyu033zxnBR7lTlQ77jAT1DReaZW842CLRLoKNQqDpkjoYms8e5TZM0lE/TxA== 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=/edaxxTxfVmDvup0m7uiLWYG4r6SWz3OjcGSz2WwaLg=; b=nzo65ut6jA8tvr56sFDn0ABDCBHDqpNh9KUvjjXD1TDbyZO2cOqOFvI9yKRqVUntL4CAisXeO81ReqwkR7MrCYUdvrjf6sjaq4qd1uQgtUDLjnmf2TOgaO7B+jDgj/ZH1tpAzhoR9uCs9xQwCUsKlA0s6VFpwfuSQoj4w/WzJ60= Received: from SA2PR10MB4587.namprd10.prod.outlook.com (2603:10b6:806:114::12) by BN8PR10MB3313.namprd10.prod.outlook.com (2603:10b6:408:c1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.17; Sat, 11 Jun 2022 11:11:13 +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.016; Sat, 11 Jun 2022 11:11:13 +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 V3 4/4] xfs: Verify correctness of upgrading an fs to support large extent counters Date: Sat, 11 Jun 2022 16:40:37 +0530 Message-Id: <20220611111037.433134-5-chandan.babu@oracle.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220611111037.433134-1-chandan.babu@oracle.com> References: <20220611111037.433134-1-chandan.babu@oracle.com> X-ClientProxiedBy: TYBP286CA0014.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::26) 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: 53e1fb49-f0f7-4609-d2d7-08da4b9b18cd X-MS-TrafficTypeDiagnostic: BN8PR10MB3313: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: 6Txos/KHWS5zwJ0IgfGbPD59r6ec8+HLFIVuFuCymsLLqZRFOi6D/iAh1ES7xfre8qIjqEiSe0kSPIufN6vg/ml0ooBKGh04cZziqE5FNdmWLyugfhrM4tLl7uZUkn7o7H65MHUYYC+g587h3UkIfJdepQ5CbR4hGLcZSAoxaQE6rZjv7aLcM2XKLdV7dv58eYzewSZNIlrKVG0qC3nINgZmUheTawfp90uR0zqQqMzn0ioDTyPqrgSeaTQMPMXkzuLMUuUssYnhZn+Q9IRAA6UQLlI2P9zjncifM1HLrJ/m39SmcTBUiO0ICpIACKVhF52WlfoloPLNRvoqUdmYW7VQEWI23qJuhW73jUQdLm3+DisDkGfJ2u7XH3u71Q7LWLwT97/YZjTo2BqYGjTjOCg7KV1xVl1VreNwrzA7EVnAZ1lUwHJ6VstrJVqJ3O2+JTudD6QPnbeqt7GKXrMKJ81pr0Cm7b4kgYPs6oHbifn9co0aSkBrBeKPgiiG2mMcSqzJllx5jazjUsa7XNxhkiZ+mlAB7V/ohu1u4jd1KZWZkcIWjA7hlX9623LBgjop2NtbiK4T09o1LzsNMty2QuBq7xg4k6styverxOJ4v4RddkWDvZWRJ+dI/bYSfqlHCnSjy1XRcYO1uuhnUm26dE3htf7FRz8YpXA7nENGIo7a3/9l+oOvKGMM/woxvud2x8Vlh7oS3Qn1TR8xp7jqiA== 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:(13230016)(366004)(316002)(186003)(2906002)(1076003)(83380400001)(6916009)(15650500001)(2616005)(36756003)(26005)(66556008)(8936002)(6666004)(508600001)(8676002)(4326008)(66946007)(66476007)(6512007)(5660300002)(6506007)(52116002)(6486002)(38100700002)(86362001)(38350700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Kf8ZUvZ7iND8S6SPizNmjAPonb4xaIomwenp2Y+xxi6ykbXTiCRIjsBJYOhRHygyPbK+0F7Oef4wok0ir10Qfl5v6QliyEd01MjCzFjyKVMEdXByq+VDbrf9IREE1uUwXeVLQYC0LRPTDOFzGtOfpiWdWsI78i3AhgyQgP2Xawc7wpBgMWHxfGxwjMTyMg+0+6oyiR2Bq445wUL6v5gvlzl1iHpo0mTp0/DH5UboKRjQPEF/NxP2IdZzerKWWdveVmCy1L++H5u/h8q3zCVMOOiG4DFUT3qCxYViRIEBxDQu0fo6+1Fgdl8PBpDv70OfSbfBzaVKSPk6Le+mhrhi5IAkqKhqUPZLxvyZzPgpVLK1l63Lwsv0MoIxqX00JFIhv16LIxyCX5FrVE8Hgqilq6nRS93wxO3lFwCFy+NE78+vjiasl/9/ZdtQA+HwpylIpAHvGR6ot8XI9hrHL4c9U2sVlA7JJJSfUlEZKrl0+mJ2eYcikRrLnPMgwnLcuk+Z4BFmIW94VtMmVF8MBou9ipGWc6Ju2HqQT9F7q4nEB5j3SJ3vKI/IntYfK+GSOF0FdOx9e6jJCDrahUinv4IdEr/Zwns3iWqxbbSRROgAH/29sKdkmPjEc5M1JGcPOquoSv/t49a5LynI3U7bf19aslj5rHu9a2NAYgdtWPEY8vat4qSkfLTEFJ1EkS+dTrZ5Mk0H7kBbH8qbp98X8zfTX+g9LWmmWMBTeKeJFAV4KLQYHQ1t02jLSPyEwVqUZXL0ZzZL/ZDtZX+p+4tJ+BLgSD9WHYqeRAwnlSi04PL2JeETbu+ymoVjNhvloFkoOz1PWoQoVQC7kUCzOrpazgzvGo/VwfLXViILrE/bW0S5raFqmvyE5L3aC0mc5S0M1rqyEoWdzd+WkJIuVtmHMgHo5dg4LqjJsuGzr0GzylvGbDK+KmP8B4RfkO2BTqWDFy4YdSNf9c8AiBcEf/K3sSz4KzkeWhZnc0AJQkJQuLWlqFBRXYImMUH8EtfdJ9DWBxyjL7Y1Xij3lZDXV1+oJ2IdgDaO7eOq6y4+EkAEqoBuEY//kEpBL7vfubLNCJ3+F3jxkilZnc9S/IXzytvRRYJVhdKDnZmltPB/pbOpF8TZulafwDBtCpkRjeCxDvwNqdb9p9JAxIw6X4K8P2IVEZNvFTfe+hLBvt35MANQh2HEtjga+fSxpamw2bRYSHmK44yvuvFMXLtms57OQAOLOR44igTcp4f1zi8pAk4UZBmbVqsCxu3JiETFXtSchWtOmsiS72mwUr0I6uXfUT8qLGHPcVQDfwk74WaEQGZ3mnwRAUN4rFGV5Ck2O1xg+CY+ZPnSf0/EtE7uhI5gicJgtUZ3ZR91/gjmd994Uky5iwVJN/ckPUnnQrggNh20SbOFypDAaAzK2UC8oAGgxxybhoTGTmxn8uLLG2ltcoo25HJcC5Hle1zU+eYEKYPYE/WPym+TdOzv7cUrGSNohVqt+rB3m82jvAkG8bI5DISFUwYVosac2D8cH9IUEyR3c31X1O4k9SVaKlEZMPUxFc0y+oOhTVZWCc87c2SAnw4UCD15UJpX2HrwTmPIoeo7/ECeseJH3VocMjjWkNjbih8c3nadYjaFPwinVcQccmAbiMiYhR2dTNUOkSURULNrAOymvaAqP48GylK5LlBL1FhzrzW+3k7uRQblSzhOmXekBgTKaZevduVS5AMEJkxGBPlBvHu5J+7EUsvqCFEBv4edA7zHbBUc2utQwwiRLkpKK6a/CCQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53e1fb49-f0f7-4609-d2d7-08da4b9b18cd X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4587.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 11:11:13.6533 (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: ABPAEoGR5fYTx3oH5i0W5YrOHd2OF8E9Nxr64Sd5VY7Re2EbIan+8pZGALWj61/2BBzDXI0XJvvb/l3ssbQgfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR10MB3313 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.874 definitions=2022-06-11_05:2022-06-09,2022-06-11 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 bulkscore=0 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206110046 X-Proofpoint-GUID: 8YOzFalHcchffX8B5UuDCS1TecLsU08g X-Proofpoint-ORIG-GUID: 8YOzFalHcchffX8B5UuDCS1TecLsU08g 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. 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