From patchwork Wed Dec 18 02:13:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912897 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6C87481D1 for ; Wed, 18 Dec 2024 02:14:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488062; cv=fail; b=H8l80fU8Bxrsd0eFi+9ZcKreWSpdmWO6Q1Q1z8b4iRv4ZQyWnjdq+8JBnPWbkgQlx+Ftgod3+6Kx9PHsKvWz8bPtO75MRvj05fgHQwsRTBFRFJSYu2X0b1rAyH508mMg2rczXrIY8RHXd/2SjFlwzxq4smhV8oAXCCVJlTRJoPs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488062; c=relaxed/simple; bh=2cjpo2LfyFnzeF2sisky0KQD4T9j4g+Q4NqjWDu0Kp8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=BnAmuD9uavs0JstiWn7GlhFEwBf9aCmN8/gUEMdRFckUZ43UhGWw55uZnpNbX1UtNoKLqbclw1Ex0C8vvM+egA05JA9DGxZ94r8r92kMUxQiV4DSElr+9y1six+942q39ClTbA75iNEvy8m19pu3TNmmt6V8UTXigCSLBMMUtdE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=cbjKhE6f; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=t+jOcpUW; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="cbjKhE6f"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="t+jOcpUW" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2Brhr001151 for ; Wed, 18 Dec 2024 02:14:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=oE52qi+pp1DoN1z8xxel+gd64Oeq6v7M/oaGdGe5Yl8=; b= cbjKhE6fv92JKEWP0NEKfATd8iZdy7gWOEI3W8V8oqtejVi8+SnwFe8/2IsZyqIl ip2twWliKfh4xrGnqCQP2hs8lzr3ojbotoEnv0zMmMfq//HO6InqVI8fRai1bH96 I/9ANfWhJQ+dU0VGDyJM4vneZWwepnUYoeHz+KSk0HDAhpTnxXlwHJer3FD1j25N FMdrJRKhMSj9FhV2noIsQYkXmQMW/y/BDeftAYOc9MXp9mu1wYyCNe7SA5btF4If nXgP2aZt0R3Eg55Cl/SXBInn99M+xOxeVccTDqGzmddIath5SqRV/nnqzvzlnk5v RteGdrNZJWqUclNXEc3Brw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0ec7fm8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:17 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI1gVP5019266 for ; Wed, 18 Dec 2024 02:14:16 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2176.outbound.protection.outlook.com [104.47.59.176]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f9fbqk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=loEWaPjRTPG8c6lRw+EDW2VSQpl9nUaPUbzcnTPwiBwSl3g5pOeu1RXfezNk4H0gqSLDdlU43qqjvCsaBm84xqizzP1+ykFIfLtvmjUj5e/ve6xeVtGrm/HqtMdQa2A7oF4a+uKo6Ez2ADrOp4mHXIQ1s4FW54UrWYnKN0yiUW9v3LR6tqYQ2CT/Ri1nArDU6V0BuPzsdZxDcdmkP9LYejzTL0netaXReb1TVEmpdF60F/tRk1H21V3KqAoWtu85KsKUojiNGPTEpZlAzex7iQRkeE6Izn3fmhYHhNPvskZ9jptxkYAbSmqam3tJgSP4KAT855DrCE8MM4JalVAIXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=oE52qi+pp1DoN1z8xxel+gd64Oeq6v7M/oaGdGe5Yl8=; b=kkLGN+zUvb7lmdiF1LqChrEP0DwKYTA5WtPxpYNgM+E+ad459m/JEgF0JMP43gBaG2S7G8W8juu+1CM95QgeAafSejzWXAOkKIcq0P2kfKALi0TqnVUMaTjTL2E4eTuJdfUwRXRwGA8e/ij4cgLUgWqA54hTc7FRO2afj03nayaWsUXusogS9LoXjjEIn0QFfMKsizpl3YE82A9X/Tqd86E8TFwuaxy3IvUFf2/cKzm3/FuWTgw39Ahwx4h0jyYK+JmLO0USsvsgQDbEwft8KyujPHls4v9UX7ulBizF4tjdK1T9L1jobZUZDsQA/DcVSuVYOFvGgMLBLN7w/o9eSA== 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=oE52qi+pp1DoN1z8xxel+gd64Oeq6v7M/oaGdGe5Yl8=; b=t+jOcpUWzlpIynROT657gxPQcDBKwXglweLlIqPp/CV51OoGir7/7zSEFZ9WvRPyuX/YPhc9ARtItYFoabmjJHABDcJeuvKwk8ylXhcdsOeGZq2sJ2TTbjpUObikcdnCuYQvxPSOkchRhQ0k1ae3TVScYg0Wcq4zy4xlm4boq8A= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by PH0PR10MB6959.namprd10.prod.outlook.com (2603:10b6:510:28f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Wed, 18 Dec 2024 02:14:14 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:14 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 01/18] xfs: fix the contact address for the sysfs ABI documentation Date: Tue, 17 Dec 2024 18:13:54 -0800 Message-Id: <20241218021411.42144-2-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR11CA0037.namprd11.prod.outlook.com (2603:10b6:a03:80::14) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|PH0PR10MB6959:EE_ X-MS-Office365-Filtering-Correlation-Id: 5988f939-0cdb-4d16-c2c5-08dd1f09ab3d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016|7053199007; X-Microsoft-Antispam-Message-Info: 7tmnC4Cu/izvsV2aTJ0olUZMxYHg8UIrieC1uLaTO4cGdtDdGEjEDlmZDWfcg6AyLHuYS4shK396tgVZfC9Jy0qHm9EmSGhtGW5q5vnySvkKUvwfuvlDEtua7PefuAttN1eJTlm1W6CvmuxTj8PI+eGComli1x/pfXzUCV2xHmoDR6KRN1TAdii5SO2kvVvDEy+SjwqTJwi41sdN93cTTDwB3WXZ9x3pJV/fCva43IYvGAH4J157DCqQ+lYstAddTBJCdI5a5ItjA0Q5o+WR0uzVZlmHkm44W40kbHr8XlKg8WC4bfbpZxZ9IAmJJcAHq44Qm+9tpHGE/DeIb9XYvcy7j+IxG5/61ID/Ew+wVPEEwQZCx558aEHDcNE/VMu4KkKXZ2AHnA5p6PX6Nt15iZbvAf0gOh52IKcGN1aQfMu4yralS19Hq1p02A5Q/qS++/BkL5tOK/3SlJJtWC+qT9r8mwPhE0ABwnZ/lwobt4UGf8H1La7TVbTU4rSmVfUtnGbb4o9hznDUP97KsrMEw/ne1BvKw+qxII02/mhojgHRKGCPED06ZqU0P6rTshQfjcHkVtqvn8LpLG2xeRHEnNoZtxagXOyS2QddxZbjEDGSVssdX4uiMJnpRyVT8Jk1yHEVaratrl03w5W0SErUySkphOp9+zumJClsufd6TudIk1FXH4Ht0iQMe+QJQ9nRMF2HrbWAD8LrppGRlS4R0zzVVvBh0hNeRchOkmFqyXPV/YmrW5w/k3s3uoHqDkfWmGV0M0zYaXldN8BS16gbz05xoG9juwD2SJ10iYUFM4lTo8KIggjGUZkmzpBr0O8eJbWeV+a9qo7c3MmxjRY3D9vbmC9/oM4GRnYBeZceX65Wfbi8K4/jJp+MY2wXFbqjklXr/4GiWctKLIV7O1ulR07ZAQKzWpUKxPVAheoZy1tgSsuxSrQ8FUg4K5S+7LNfXTsUlF+bWJwM71UdnJvsaxbBizrvWCfEQ4dwjsgxeROnoUMM91LApk/Rxmb0xBmb4qHlKfx2q1JaX1FEDHZf7WhkOCK/tJlx6DqzC62bphnoW/zqldfZdCrbWxPDyplaBJm+bap6R40VU3fQzMotsJYmIMGWKs+DwhmmoNElwzzkfIYG/ASseijNtzLIA9D71It/RvTRZzDIxIa6EY1Ed32EBoUrDHum4LBDukk66TlSrKIeKxPAfke7PoZoIbfn2LJEbExqLDRBt05dl1dcGxiKFedjxOCwjKcDE3WUudcqk4eD7Ge+36fWFvFU3eQpEfI8uIuk2p6bcvWUntpnfSoZ2MIwQiVLxsEPc9uy8nBlxafR4w6C4uOTuR0HnGeLHmsAnZFqv5LUtUvcdU9pl5GOIGl9M5G/eqIU7ym58gd+xeE4rciwXn00qCm98UbI X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016)(7053199007);DIR:OUT;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zJcUCHWxW/oKmYAzdQZ/LcI0CAAXGgjSxFBlnhJbbb6SrjkW0vFlMPqLEWKRgL/qinLBrMChdlzmlmWnWqfNttizZMs71dhSxQLNmzZzFs60FkY7Pe2niLmt53pZgVxFNZ1+tuYJVqLe1/uMVczIyzrxqkzL0ovwo5KBiyB2i4Ma+TtFADPmHvZZof+w2DYwMqsKzO41Mf899tCx/cMHwNdG6U+/7nwVP7pzS1dQjyB64mxjjyHMECwLsAwnWwwQCoybjDcOm3cGOIbMWYMxIOSFVmvn6mCnYiM1gx7WIJ0M= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5988f939-0cdb-4d16-c2c5-08dd1f09ab3d X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:14.6347 (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: lFuXkpGKmHlmPd8Fx7yM7KzihSbVtS49KYQlW8uBAwlJWL4LdayIY45IYS/yuOLachg88C8ZDCbXl/qgUgYpsYc09a/R9ZIVYvwYCv17BWg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB6959 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 suspectscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: K8KL08tPWMSPxy1fEbLjpV--zQrkHY0n X-Proofpoint-ORIG-GUID: K8KL08tPWMSPxy1fEbLjpV--zQrkHY0n From: Christoph Hellwig commit 9ff4490e2ab364ec433f15668ef3f5edfb53feca upstream. oss.sgi.com is long dead, refer to the current linux-xfs list instead. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang --- Documentation/ABI/testing/sysfs-fs-xfs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-fs-xfs b/Documentation/ABI/testing/sysfs-fs-xfs index f704925f6fe9..82d8e2f79834 100644 --- a/Documentation/ABI/testing/sysfs-fs-xfs +++ b/Documentation/ABI/testing/sysfs-fs-xfs @@ -1,7 +1,7 @@ What: /sys/fs/xfs//log/log_head_lsn Date: July 2014 KernelVersion: 3.17 -Contact: xfs@oss.sgi.com +Contact: linux-xfs@vger.kernel.org Description: The log sequence number (LSN) of the current head of the log. The LSN is exported in "cycle:basic block" format. @@ -10,7 +10,7 @@ Users: xfstests What: /sys/fs/xfs//log/log_tail_lsn Date: July 2014 KernelVersion: 3.17 -Contact: xfs@oss.sgi.com +Contact: linux-xfs@vger.kernel.org Description: The log sequence number (LSN) of the current tail of the log. The LSN is exported in "cycle:basic block" format. @@ -18,7 +18,7 @@ Description: What: /sys/fs/xfs//log/reserve_grant_head Date: July 2014 KernelVersion: 3.17 -Contact: xfs@oss.sgi.com +Contact: linux-xfs@vger.kernel.org Description: The current state of the log reserve grant head. It represents the total log reservation of all currently @@ -29,7 +29,7 @@ Users: xfstests What: /sys/fs/xfs//log/write_grant_head Date: July 2014 KernelVersion: 3.17 -Contact: xfs@oss.sgi.com +Contact: linux-xfs@vger.kernel.org Description: The current state of the log write grant head. It represents the total log reservation of all currently From patchwork Wed Dec 18 02:13:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912898 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E40C9450EE for ; Wed, 18 Dec 2024 02:14:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488064; cv=fail; b=fPGznCAR1Z2j+7708K2aYgtG1wlmyS9A8tmAST2FdFo+N/BopmnEE8Ipp43ADEkAMCYr4SqsqNYQWcpVT4aM90G3hAUHmiaTefCGZ1z9yOr6WRHDym/GPARcc1CPtMpvBSbrASzbs/uWN3Ev8LyMqEJpHs7xjT8y3iXX5C9ZNjE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488064; c=relaxed/simple; bh=0eJXo7iF4mSU873YEJvnfI3EmoSFhnMj0YMi1CLy7TU=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=J3PG5crilADSKh6MXzM83S/Ef49wxYU5YkeBaDadYYWVHKaZTHtzFm8j8zuEj/KueKg33ImSh5FWFPB7NfjD+XSer4zNfSWEhQkvuM6//CMXKl0+jKKphhR2rBCPqW1HHzskSx1a4FLKGu/oL5/qT2pRsgYgxhwcGn7UAV6NT3w= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=EPq49pTz; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=cDvlN04C; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="EPq49pTz"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="cDvlN04C" Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2BqQl016231 for ; Wed, 18 Dec 2024 02:14:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=6CTIbb4k2UNORXIL+fUJc74QeihLPcTbUOpqx+94UK8=; b= EPq49pTzIbTtXDj3nwfCNqBNrdu38zq6LeU2Px9ncuAnvZRUoH6NPt6OXZkqx491 Q8h/Q1GNaET54rkDB/pZ3/iooiy1J5eM6iWO7F5u4mC1rzuM3epuXKsWpOI6rVL5 p/EhfEbVqKp7tUiOyRPrdsNjhzPvCUPkkDyVlb4uLv7dLlsbSknl8E6mnn7uLxdV du7bsj/ZtoeImGG3L3Q0HAQaf89e699soeRl5pEaDJHhSA/vgWcCaHyfSOpzEoya S0n6D69QEYbxuaAyYOZcYFtAT448V8ixjJv/UiN0r+QdJAUGw5EdzZp2CbrnYWhT AA6qJmCv8Llh207MUtjW6w== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h22cqhdm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:20 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BHNK4W1000913 for ; Wed, 18 Dec 2024 02:14:19 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2172.outbound.protection.outlook.com [104.47.59.172]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f9dc1v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fHTcxCuac4XcraFPBUQHQZQuL4EniZUjeqsrizPASX/L/TFlpX7rpQ/ijFGZ74kb0qfv3IrRUeujESysDzJwPrvBIblAvHgYIhACqHURmzWcxylCqWPfbBu6n2Kdbs3Iv1LLpF7IWAVTPLvUE5Z/EMmw7eL64CP0Q7Dyrt9ESYZytG5odEIAw+70B3758MJPOdh4Z4xW7EYn4oAGRf3eFfZBkeBWBivX0slG4MwEn0nSOuohKv1I/YTisqW098o7m2TaCHdoETaFtALyrg/9ZmQ7eO6VLYRg1jGC/lyMEUGo3sRKAbWcdXtKLZthgnlc/bxX1ay8fiQXgXBcFNBzqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=6CTIbb4k2UNORXIL+fUJc74QeihLPcTbUOpqx+94UK8=; b=BNL54HSD+rZDj6Whrk7jpzwl4P9obWtPNKvz6PrJ+gcLmHNKLYeVEqV/syiO/XL63q5NxqNSBvrYB+Lr8aHZSFtlwXZoHfv6qfAD5BFgtSzXDRzJOOOZEkQGfE6yweGAlfoNIbpwVeWMdLL8/evBUzV5bLdIQ3PyDc5j94lk0967bWGtjrNBTuuCOue8LkjS9TbUJhhxENa9nq8/8dBfshEvetGLXO7s4k9dSsgMZomH2lg66G9kqdrrIYKnapWuiUgsEQmEIokmkgdXmkWVvs8hStYTTMUTbfB86ps4futeniplXhtWsWaHC63cr3HRLzc5/tawKV04a4N9skDfPA== 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=6CTIbb4k2UNORXIL+fUJc74QeihLPcTbUOpqx+94UK8=; b=cDvlN04C5RWsLurn6qrBCvKuKYaVCrG9XX4X2k1qIRRtaJ45smn5GE1LQOeJcn6x+KA8qeZkg7wU70EofFznk0E7v7qnUbt1TRvV+vpzu62nHhK/oHoDiTibg3jCmBwQUPFcEKxt5lh6YjldA0cDXaSz6fWk6li/d+1U8q4BQ6I= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by PH0PR10MB6959.namprd10.prod.outlook.com (2603:10b6:510:28f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Wed, 18 Dec 2024 02:14:16 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:16 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 02/18] xfs: verify buffer, inode, and dquot items every tx commit Date: Tue, 17 Dec 2024 18:13:55 -0800 Message-Id: <20241218021411.42144-3-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR11CA0044.namprd11.prod.outlook.com (2603:10b6:a03:80::21) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|PH0PR10MB6959:EE_ X-MS-Office365-Filtering-Correlation-Id: f7d4e741-67d9-4b97-a855-08dd1f09ac68 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: xmjI1jse6swdoGrCmufOrOyeLWqy0IgCD89SnIt2FVlY8vv+w7FOApNZVLNYmu0lUpvLx0hLB+5aUEPL86O/ysQFuuKYYXSN8DxwRpGRwjPRJyCugEeE9jk+rKbWYR2Ocgftg88YLQWrp5Pfg93HY02afeNrlNShZCqR65CpurOYPvYNUScDBl3cTjyNbz8ojJatTjq4+lAAvQR1Hi6hPQudLjCVmJWpkHxySrdxf+BOc4htdI40xOmtYgJct/0rr3DvgTU7dOqTD0efb49m6eJjmJeDe5dkUVMgOtidV1xrl1rja3/7Pg6VRjB//utmcH7IeTbTz6Xmj6KOoEPRQKtfe1G3vpxLVNY2W8f1IKgK+dibFXF6s69xl42X8M+rVG24l7ktwQtT85OWwNjG/KO0JEZnGkokHmkxSbsXQ98qWaO3dDlY8D5K7v5oEpe5TzGAufb4OORiPTjcrnhRI53R7p6VZsiWJgyQAShW857qPdrpC433rR0qqZ3r8ASh3Jn0kEWU53ydU9MUlULYXsBea1ZicDfubj7exzBZHoJ9n4zOPQduiPy5mL13Au/9s44igODjUuRmzXJYLE+vBNViM0Fiow8UDI9ofayKSwOKMNZY0Xt/GZKZW9ydgcQAGLNUZ8S5UDOxe4jK8iliDBMdIMNvkhjTyWBtO9rFrsS4wUTZF4qhgkfcHuUKAM55yZOlQeMOjd8HoqdMqzxvF1gx9xS7sO8/5R0xiG6+HXAPicMuHNM99FPkheO7IDIp6FXZOANBgv1zzS6MzZNRqSVwbRxYZaRKNHcKgQKREKP+U6U9OYtLyPRz8Rb5xN4LitPsIiPXGmLg1U6VEKtvLYIFK6oUqSVhEzWWjLBJB7KRS1PwRQANcSC7tlwEf5IyqSIvTgsU80CqlnsHrLbEwVi42EqECL5IvJp+q400gPdquN+HbNbbhv7+NjRy8znYncwy+cNBbBU4uarB4yOF9DrEQS/sNDRqIO8VyQDAut6T+wIuH1iYLMcvRoJx2dV/NqK2KyWlpo6hDu5i+lNRj3qRx1JnJSZHlvZhBMvFpIMi+4fKb6VpxNI8axPRKK+obrXkbB1I/XrIv63EmSI865XZakG7iVqTOHlSCqE2n9Z+D0GWJKq5B5whzBdJ/PiLpWuhaKeoKvbhay9F+TUvGd6i78aMDs1SVRe+mn8z9tjDa/zl0TuGRKOTYMe6eZ1jWSu/mV4WAUybYMJNuESeKctJbq4oAYypEQMd44hUBIkc/RNTLwDSgP9S7TczOovKB4MlbW6rtLD5B3bHHFMGN8gDoiCNPykEzmJTpfMkkA4PzS8OAAHdYfJez1gp6qutbAXudOr032JIykyHV5uz9NSDB1GmyyFLFAc8MSL/RXAznPha5y7kfCZS6ENNequY X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ly5PafFLlbC17k9nWYtdNOrf9abJEqeXeSvYiuKe1VtCVDXyBR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mUCZAo3ZZ2Qjrca6FYM2gSkloMK2LxNviNudt8JyHbmmxgBe1GsMWC3JZrJ8dSI0F/l/RfuIpEbJA+xZqaSZH7RzpgT7ZuYOGuVTZi/dllOaTBK+ivts0DIjjCYw8zh2tW98fzZZqnAn3N8QGJIDdO98fHJIUyRPxH5wM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f7d4e741-67d9-4b97-a855-08dd1f09ac68 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:16.5794 (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: Sn3bNq2R0VKxa384IJFKM7nepbsq544WLVuwVfBV/+v/ZYPtVH8l7HFSWqOdKEGGJxPyvEkiS12RFog4zuXcmEcxkEdUrX+daFPyFhc1D6g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB6959 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: -qYP8GaSCPDI3qsPQlkDZijRTbWP0zB6 X-Proofpoint-ORIG-GUID: -qYP8GaSCPDI3qsPQlkDZijRTbWP0zB6 From: "Darrick J. Wong" commit 150bb10a28b9c8709ae227fc898d9cf6136faa1e upstream. generic/388 has an annoying tendency to fail like this during log recovery: XFS (sda4): Unmounting Filesystem 435fe39b-82b6-46ef-be56-819499585130 XFS (sda4): Mounting V5 Filesystem 435fe39b-82b6-46ef-be56-819499585130 XFS (sda4): Starting recovery (logdev: internal) 00000000: 49 4e 81 b6 03 02 00 00 00 00 00 07 00 00 00 07 IN.............. 00000010: 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 10 ................ 00000020: 35 9a 8b c1 3e 6e 81 00 35 9a 8b c1 3f dc b7 00 5...>n..5...?... 00000030: 35 9a 8b c1 3f dc b7 00 00 00 00 00 00 3c 86 4f 5...?........<.O 00000040: 00 00 00 00 00 00 02 f3 00 00 00 00 00 00 00 00 ................ 00000050: 00 00 1f 01 00 00 00 00 00 00 00 02 b2 74 c9 0b .............t.. 00000060: ff ff ff ff d7 45 73 10 00 00 00 00 00 00 00 2d .....Es........- 00000070: 00 00 07 92 00 01 fe 30 00 00 00 00 00 00 00 1a .......0........ 00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000090: 35 9a 8b c1 3b 55 0c 00 00 00 00 00 04 27 b2 d1 5...;U.......'.. 000000a0: 43 5f e3 9b 82 b6 46 ef be 56 81 94 99 58 51 30 C_....F..V...XQ0 XFS (sda4): Internal error Bad dinode after recovery at line 539 of file fs/xfs/xfs_inode_item_recover.c. Caller xlog_recover_items_pass2+0x4e/0xc0 [xfs] CPU: 0 PID: 2189311 Comm: mount Not tainted 6.9.0-rc4-djwx #rc4 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20171121_152543-x86-ol7-builder-01.us.oracle.com-4.el7.1 04/01/2014 Call Trace: dump_stack_lvl+0x4f/0x60 xfs_corruption_error+0x90/0xa0 xlog_recover_inode_commit_pass2+0x5f1/0xb00 xlog_recover_items_pass2+0x4e/0xc0 xlog_recover_commit_trans+0x2db/0x350 xlog_recovery_process_trans+0xab/0xe0 xlog_recover_process_data+0xa7/0x130 xlog_do_recovery_pass+0x398/0x840 xlog_do_log_recovery+0x62/0xc0 xlog_do_recover+0x34/0x1d0 xlog_recover+0xe9/0x1a0 xfs_log_mount+0xff/0x260 xfs_mountfs+0x5d9/0xb60 xfs_fs_fill_super+0x76b/0xa30 get_tree_bdev+0x124/0x1d0 vfs_get_tree+0x17/0xa0 path_mount+0x72b/0xa90 __x64_sys_mount+0x112/0x150 do_syscall_64+0x49/0x100 entry_SYSCALL_64_after_hwframe+0x4b/0x53 XFS (sda4): Corruption detected. Unmount and run xfs_repair XFS (sda4): Metadata corruption detected at xfs_dinode_verify.part.0+0x739/0x920 [xfs], inode 0x427b2d1 XFS (sda4): Filesystem has been shut down due to log error (0x2). XFS (sda4): Please unmount the filesystem and rectify the problem(s). XFS (sda4): log mount/recovery failed: error -117 XFS (sda4): log mount failed This inode log item recovery failing the dinode verifier after replaying the contents of the inode log item into the ondisk inode. Looking back into what the kernel was doing at the time of the fs shutdown, a thread was in the middle of running a series of transactions, each of which committed changes to the inode. At some point in the middle of that chain, an invalid (at least according to the verifier) change was committed. Had the filesystem not shut down in the middle of the chain, a subsequent transaction would have corrected the invalid state and nobody would have noticed. But that's not what happened here. Instead, the invalid inode state was committed to the ondisk log, so log recovery tripped over it. The actual defect here was an overzealous inode verifier, which was fixed in a separate patch. This patch adds some transaction precommit functions for CONFIG_XFS_DEBUG=y mode so that we can detect these kinds of transient errors at transaction commit time, where it's much easier to find the root cause. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Catherine Hoang --- fs/xfs/Kconfig | 12 ++++++++++++ fs/xfs/xfs.h | 4 ++++ fs/xfs/xfs_buf_item.c | 32 ++++++++++++++++++++++++++++++++ fs/xfs/xfs_dquot_item.c | 31 +++++++++++++++++++++++++++++++ fs/xfs/xfs_inode_item.c | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 111 insertions(+) diff --git a/fs/xfs/Kconfig b/fs/xfs/Kconfig index 567fb37274d3..ced0e6272aef 100644 --- a/fs/xfs/Kconfig +++ b/fs/xfs/Kconfig @@ -204,6 +204,18 @@ config XFS_DEBUG Say N unless you are an XFS developer, or you play one on TV. +config XFS_DEBUG_EXPENSIVE + bool "XFS expensive debugging checks" + depends on XFS_FS && XFS_DEBUG + help + Say Y here to get an XFS build with expensive debugging checks + enabled. These checks may affect performance significantly. + + Note that the resulting code will be HUGER and SLOWER, and probably + not useful unless you are debugging a particular problem. + + Say N unless you are an XFS developer, or you play one on TV. + config XFS_ASSERT_FATAL bool "XFS fatal asserts" default y diff --git a/fs/xfs/xfs.h b/fs/xfs/xfs.h index f6ffb4f248f7..9355ccad9503 100644 --- a/fs/xfs/xfs.h +++ b/fs/xfs/xfs.h @@ -10,6 +10,10 @@ #define DEBUG 1 #endif +#ifdef CONFIG_XFS_DEBUG_EXPENSIVE +#define DEBUG_EXPENSIVE 1 +#endif + #ifdef CONFIG_XFS_ASSERT_FATAL #define XFS_ASSERT_FATAL 1 #endif diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 023d4e0385dd..b02ce568de0c 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c @@ -22,6 +22,7 @@ #include "xfs_trace.h" #include "xfs_log.h" #include "xfs_log_priv.h" +#include "xfs_error.h" struct kmem_cache *xfs_buf_item_cache; @@ -781,8 +782,39 @@ xfs_buf_item_committed( return lsn; } +#ifdef DEBUG_EXPENSIVE +static int +xfs_buf_item_precommit( + struct xfs_trans *tp, + struct xfs_log_item *lip) +{ + struct xfs_buf_log_item *bip = BUF_ITEM(lip); + struct xfs_buf *bp = bip->bli_buf; + struct xfs_mount *mp = bp->b_mount; + xfs_failaddr_t fa; + + if (!bp->b_ops || !bp->b_ops->verify_struct) + return 0; + if (bip->bli_flags & XFS_BLI_STALE) + return 0; + + fa = bp->b_ops->verify_struct(bp); + if (fa) { + xfs_buf_verifier_error(bp, -EFSCORRUPTED, bp->b_ops->name, + bp->b_addr, BBTOB(bp->b_length), fa); + xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); + ASSERT(fa == NULL); + } + + return 0; +} +#else +# define xfs_buf_item_precommit NULL +#endif + static const struct xfs_item_ops xfs_buf_item_ops = { .iop_size = xfs_buf_item_size, + .iop_precommit = xfs_buf_item_precommit, .iop_format = xfs_buf_item_format, .iop_pin = xfs_buf_item_pin, .iop_unpin = xfs_buf_item_unpin, diff --git a/fs/xfs/xfs_dquot_item.c b/fs/xfs/xfs_dquot_item.c index 6a1aae799cf1..7d19091215b0 100644 --- a/fs/xfs/xfs_dquot_item.c +++ b/fs/xfs/xfs_dquot_item.c @@ -17,6 +17,7 @@ #include "xfs_trans_priv.h" #include "xfs_qm.h" #include "xfs_log.h" +#include "xfs_error.h" static inline struct xfs_dq_logitem *DQUOT_ITEM(struct xfs_log_item *lip) { @@ -193,8 +194,38 @@ xfs_qm_dquot_logitem_committing( return xfs_qm_dquot_logitem_release(lip); } +#ifdef DEBUG_EXPENSIVE +static int +xfs_qm_dquot_logitem_precommit( + struct xfs_trans *tp, + struct xfs_log_item *lip) +{ + struct xfs_dquot *dqp = DQUOT_ITEM(lip)->qli_dquot; + struct xfs_mount *mp = dqp->q_mount; + struct xfs_disk_dquot ddq = { }; + xfs_failaddr_t fa; + + xfs_dquot_to_disk(&ddq, dqp); + fa = xfs_dquot_verify(mp, &ddq, dqp->q_id); + if (fa) { + XFS_CORRUPTION_ERROR("Bad dquot during logging", + XFS_ERRLEVEL_LOW, mp, &ddq, sizeof(ddq)); + xfs_alert(mp, + "Metadata corruption detected at %pS, dquot 0x%x", + fa, dqp->q_id); + xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); + ASSERT(fa == NULL); + } + + return 0; +} +#else +# define xfs_qm_dquot_logitem_precommit NULL +#endif + static const struct xfs_item_ops xfs_dquot_item_ops = { .iop_size = xfs_qm_dquot_logitem_size, + .iop_precommit = xfs_qm_dquot_logitem_precommit, .iop_format = xfs_qm_dquot_logitem_format, .iop_pin = xfs_qm_dquot_logitem_pin, .iop_unpin = xfs_qm_dquot_logitem_unpin, diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 155a8b312875..b55ad3b7b113 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -36,6 +36,36 @@ xfs_inode_item_sort( return INODE_ITEM(lip)->ili_inode->i_ino; } +#ifdef DEBUG_EXPENSIVE +static void +xfs_inode_item_precommit_check( + struct xfs_inode *ip) +{ + struct xfs_mount *mp = ip->i_mount; + struct xfs_dinode *dip; + xfs_failaddr_t fa; + + dip = kzalloc(mp->m_sb.sb_inodesize, GFP_KERNEL | GFP_NOFS); + if (!dip) { + ASSERT(dip != NULL); + return; + } + + xfs_inode_to_disk(ip, dip, 0); + xfs_dinode_calc_crc(mp, dip); + fa = xfs_dinode_verify(mp, ip->i_ino, dip); + if (fa) { + xfs_inode_verifier_error(ip, -EFSCORRUPTED, __func__, dip, + sizeof(*dip), fa); + xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); + ASSERT(fa == NULL); + } + kfree(dip); +} +#else +# define xfs_inode_item_precommit_check(ip) ((void)0) +#endif + /* * Prior to finally logging the inode, we have to ensure that all the * per-modification inode state changes are applied. This includes VFS inode @@ -168,6 +198,8 @@ xfs_inode_item_precommit( iip->ili_fields |= (flags | iip->ili_last_fields); spin_unlock(&iip->ili_lock); + xfs_inode_item_precommit_check(ip); + /* * We are done with the log item transaction dirty state, so clear it so * that it doesn't pollute future transactions. From patchwork Wed Dec 18 02:13:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912899 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BA7878C9C for ; Wed, 18 Dec 2024 02:14:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488064; cv=fail; b=AwFvNcBLGr0dBKY1UMMy7mC7uY/GGEYZpSi2uvjyYx2/Ytt5FGu4ZPphqxQIN/2WnbTDrpcVn2M7lJa4e4UsvL905uyJR9Hz/j4EJnzoL5xcd1p7h53mv32xaDH8Hakzy77yIK8BK7lKhgrKM5xFYR1tW8BDehRYwLsA7J5J/YI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488064; c=relaxed/simple; bh=qIqSzJAq29MWp8dek0sVLznFNLOkI3dzS4kjOND/t6E=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=gd60JpDxSOjsXFar8vS8gbUQSjqX2oUxyckoPAaUqxcx5XOhveMdxMHub1vKzdiEblP3CwzPvNsy1KcsM59hQfLAlG1LZlY+k1OgOeHW5JhiuxPyT9cXmOZmahx6n9nWCiaj2RjZ6UxbyOeU/LHpyvocSPHf64Jr3DRwCJcrueo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=FavGU8e+; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=L5/Pz6Du; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="FavGU8e+"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="L5/Pz6Du" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2BqXn001112 for ; Wed, 18 Dec 2024 02:14:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=Ua3f0smNr5h1BDd1Vg+jHnX4EhR/HH3kV+RAzDzETE4=; b= FavGU8e+J3R/sUTcqRoqzpngJm1hHrthJc1QMxtpSsggGlFWGqL3vCRsWCr852DL vn30MUjzMAlfZAT4mfBY46JuLCpoyYiBu3ah3FWunuViPBHZdEI0ccgC8C9POuJr 77w6NVkTitq3wuxwehstkayGO44TwcUb/CXUHeXZ9rnAbQ77EKh7PyP/5Tnkxeqh SwGm51M8OvD/9U2a1YOXP0zCq+h46H3sl/8h2Vo2W/sWjs6mIbsHpBtskzt7qtO6 fw7o0/2MxEC3SK7EAYtYRcILr6Xrs+f6o6oq/uYRAPtzhYqKKouBPSyEN3K4YnJG 6DfigHvcfgaTLyBTvApTHw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0ec7fma-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:21 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI0rJ9H018984 for ; Wed, 18 Dec 2024 02:14:20 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f9fbsd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zNSe2j8Xz3d/wcYRvQvPRZoRsN+I0jw4qVvwaXNTmEpzr9RjwFeH3RdLYQ/fLjttFLvtYVGANV60DOBRU6t3+LKnlkkZVQKHGEic1Gbxr3k+pmzVLCywN6s+zbRSugIv9wheTYK1+ecaSCRL37YD+fEk0Sc+cZ6sx+N88vUAMPEZUpVRBhgzUA9RgWnPYJsu4mMHR0J/Met1WWhLjpSRDi0ruZ2C7p76/jEVDv+jFPx7uwCpjRe/UNm/hHZ16ZHg8Ojj7NurBNaLeu0Lyn76OlUp5vqGP79SqyIBSwwCLvgkUUj59lkKA3QVcNKWKx/468DJCwGgx2A3y4zMR1BnjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Ua3f0smNr5h1BDd1Vg+jHnX4EhR/HH3kV+RAzDzETE4=; b=SIzXp0tHMMsdARjsA10lq1+BR9RABXVwaLqc6fKneyqZwZ7O+EnbIf+Oh5VjZllpt0zpaH+BMYqt+8HS7BrTT9B+ihKrK8xV6bqNt1PKwBkXv2xdxPSNYMBgHP16p6aRXW5aIbXn5gYohzy7TYSWivfIPK/ta54OIzJB683DMulx2XxguJwVNJHPxjZo4WKfiTkRAtayqJc9voD+Nwqij8R5XoF6+XZPIXglkQ0KfFyPNoJ05CvrqvZHrghAe3DNRTYPEzuitWfBuud202LmkHAgbPz+MlHUTO3JGE/wPXI492bxmw+1t4i+HfTy751dM1kkJwjHZCkVrGV0/EFcrw== 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=Ua3f0smNr5h1BDd1Vg+jHnX4EhR/HH3kV+RAzDzETE4=; b=L5/Pz6DuCsqDqsl+J340dL/D6bxHSjpEXr2pKAi5sooWOR2pjccfBV+yyje2Yjw9lwhLm1JfWqwJErfxyTTOUPDjIeXv041WYA1ibAKIg5biXRRYrlw50N//+Uq/lHH7UkUmAX+RYr1tLA8J5BN5b18CWHyJBSISi2hV9BQyZKM= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by PH0PR10MB6959.namprd10.prod.outlook.com (2603:10b6:510:28f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Wed, 18 Dec 2024 02:14:18 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:18 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 03/18] xfs: use consistent uid/gid when grabbing dquots for inodes Date: Tue, 17 Dec 2024 18:13:56 -0800 Message-Id: <20241218021411.42144-4-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR11CA0072.namprd11.prod.outlook.com (2603:10b6:a03:80::49) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|PH0PR10MB6959:EE_ X-MS-Office365-Filtering-Correlation-Id: 15b4c74d-c2ad-4ab1-ebe3-08dd1f09ad7e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: JocM3+PW00PzR0KuVMsZ4EhGWnpNhk7dwrclNHWkFK9AwfX0LISlx7+JN/Vktt4YoInEYyLr9LLonWgv8xZ9wrj7yhjvyZ8S9qTO5/meGV99l8sK2ORzyTtpjjfHN6+d075PXoa4GtQ01Lrq/OyrpX1RCFu7rBEWZQBI0IOoPs352SgMjnLXBm/IUC/0nxPEkKMupT/PP1j2X4TctUBDRxuKKjHjbSfI+JV0FsyPMLz/4jfQ3g+jNGgE2X+zRw6bPMoNH9s+25D3hX2ja8ulTEI7+eOxUaMdYL3dol0mA+s0F3Udd7IkiG1UGIu4nY/+0FC7VDGLWk1geczmx5tO1mJyhP7acrvEUvAe5yDBP8VHT+TJkaMcouYvfGUN53LmFms8fP45q/Y/HzGAZS34710WSXe/WQs848qusuF8B2T6+jbJvzjdl7QNv9cX9I7bHKPTGiPT6RqYd3lTX/uD8XGVFzbSSPK4oTszdUNwqfyn5YrLoINDEeoTrBqqO46DsZQbGkKod+byhyLwREestedCTBG92ygBsFHPHXWzZs6Bd68RQVRTZPKFuw9kvuSy8gENgaTg+2aBGvKyWRhk7zLqQI95jsvmF76g6Kk6xUT1FxPLMoLP/5zFbrfHUrrD+ACb8opGhJPPpddT3ygnRhiIu0QpJkZzXl2M0muyxop+2iEORSA4m5eSddkZ+5IguIcmqUGQ4OLDtkBA7Zr7ZRvyvreH9iN2M1LUnMsqrLFlAhUa6EJEj6PRk8v3krK1Ft8scRjvTJRVkZMgKcMObttSVdOGgEOUXwTS9VBlzSsPfQVOKFtam3qAOCicejQoERSFaKp3oh8I35srOO6pBJ0DyX/KPCRfNbFD+hE1BZdYH8NkMJntbMbcyzhlTNugtUN6rltloE7t9PJYGHvXgmw7ZH1VyAnnPmUC4rW20lktiSKAgWQPuzonmKfklojQTjJvXQazmNMJNkj2WnTxmT7fgS2WCo8nZZCxgzU4kBzNrB86lO2Bm159dSR0uDA9GNsGTva0hb+ch1JMBsu9aV+HiCWdL5AJSEbevFf0b2xPsv8h/gccEuu6ZtfxYFEXtUZS4F6V58h+pshH0SN6fdMrLMBOFY5jxZdFxsk+1cGeIf+5SaWJnH83AQny78u7FjPXGA9Ls6felFezqhju9RJA4FEBqOrFNMZ2cniv2hwNNTV8nx9jjp9ztnawfArz5aI5TFzbays4Ihp4XMM642uvFoz769ru7awWejGx+cvm7ZqYuKXTLM5vNh/Yzu1ftB3n6gJnWZ4b3YFVa9In3aFKG5SVPsAwd+JXNZAdA1JmnUpPvQR4NpH/g2/1Ur2Bt2Ls29PWBMYFiaSSN0h/fquuT0/qWaZoJ1l+gn+syZrrSN7dISXwxDw78eiMDxtR X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6guMGoz2+OPRgj+fJtd46l4jHXnRhzRpOjRZQSbhIjbTG1pk3WBwu/GZYO5fYhAPQs6EGjQemxC+qll7y1X/dlEXgDRGEp7Rx9ZRvFayMz5i879G0jXDmQ1VGY9C29IDxjBBQrxzE81EwzM8nBRj7Bd+BU5KsF6C710vmUUI0gS59PULQGDLfipS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AlDpugehoBkt3+i+AWaAu8bw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15b4c74d-c2ad-4ab1-ebe3-08dd1f09ad7e X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:18.3897 (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: aQm4gPXfscw/ICMDWcx0gmyHH/o+VX71HuQV5GFTcpa9GmKlw8B8sNJRG5Yy4jMEISFJp3BFy2hOeZX5UIYjx444zb+HQ5C3onsWZNUY4wA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB6959 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 suspectscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: _pWTKrCxjcEtrI-6ccrSmIWmQQhSOfZv X-Proofpoint-ORIG-GUID: _pWTKrCxjcEtrI-6ccrSmIWmQQhSOfZv From: "Darrick J. Wong" commit 24a4e1cb322e2bf0f3a1afd1978b610a23aa8f36 upstream. I noticed that callers of xfs_qm_vop_dqalloc use the following code to compute the anticipated uid of the new file: mapped_fsuid(idmap, &init_user_ns); whereas the VFS uses a slightly different computation for actually assigning i_uid: mapped_fsuid(idmap, i_user_ns(inode)); Technically, these are not the same things. According to Christian Brauner, the only time that inode->i_sb->s_user_ns != &init_user_ns is when the filesystem was mounted in a new mount namespace by an unpriviledged user. XFS does not allow this, which is why we've never seen bug reports about quotas being incorrect or the uid checks in xfs_qm_vop_create_dqattach tripping debug assertions. However, this /is/ a logic bomb, so let's make the code consistent. Link: https://lore.kernel.org/linux-fsdevel/20240617-weitblick-gefertigt-4a41f37119fa@brauner/ Fixes: c14329d39f2d ("fs: port fs{g,u}id helpers to mnt_idmap") Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Catherine Hoang --- fs/xfs/xfs_inode.c | 16 ++++++++++------ fs/xfs/xfs_symlink.c | 8 +++++--- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 7aa73855fab6..1e50cc9a29db 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -982,10 +982,12 @@ xfs_create( prid = xfs_get_initial_prid(dp); /* - * Make sure that we have allocated dquot(s) on disk. + * Make sure that we have allocated dquot(s) on disk. The uid/gid + * computation code must match what the VFS uses to assign i_[ug]id. + * INHERIT adjusts the gid computation for setgid/grpid systems. */ - error = xfs_qm_vop_dqalloc(dp, mapped_fsuid(idmap, &init_user_ns), - mapped_fsgid(idmap, &init_user_ns), prid, + error = xfs_qm_vop_dqalloc(dp, mapped_fsuid(idmap, i_user_ns(VFS_I(dp))), + mapped_fsgid(idmap, i_user_ns(VFS_I(dp))), prid, XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, &udqp, &gdqp, &pdqp); if (error) @@ -1131,10 +1133,12 @@ xfs_create_tmpfile( prid = xfs_get_initial_prid(dp); /* - * Make sure that we have allocated dquot(s) on disk. + * Make sure that we have allocated dquot(s) on disk. The uid/gid + * computation code must match what the VFS uses to assign i_[ug]id. + * INHERIT adjusts the gid computation for setgid/grpid systems. */ - error = xfs_qm_vop_dqalloc(dp, mapped_fsuid(idmap, &init_user_ns), - mapped_fsgid(idmap, &init_user_ns), prid, + error = xfs_qm_vop_dqalloc(dp, mapped_fsuid(idmap, i_user_ns(VFS_I(dp))), + mapped_fsgid(idmap, i_user_ns(VFS_I(dp))), prid, XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, &udqp, &gdqp, &pdqp); if (error) diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c index 85e433df6a3f..b08be64dd10b 100644 --- a/fs/xfs/xfs_symlink.c +++ b/fs/xfs/xfs_symlink.c @@ -191,10 +191,12 @@ xfs_symlink( prid = xfs_get_initial_prid(dp); /* - * Make sure that we have allocated dquot(s) on disk. + * Make sure that we have allocated dquot(s) on disk. The uid/gid + * computation code must match what the VFS uses to assign i_[ug]id. + * INHERIT adjusts the gid computation for setgid/grpid systems. */ - error = xfs_qm_vop_dqalloc(dp, mapped_fsuid(idmap, &init_user_ns), - mapped_fsgid(idmap, &init_user_ns), prid, + error = xfs_qm_vop_dqalloc(dp, mapped_fsuid(idmap, i_user_ns(VFS_I(dp))), + mapped_fsgid(idmap, i_user_ns(VFS_I(dp))), prid, XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, &udqp, &gdqp, &pdqp); if (error) From patchwork Wed Dec 18 02:13:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912900 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C3A67C6E6 for ; Wed, 18 Dec 2024 02:14:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488066; cv=fail; b=nqVq1SQPZvKd70zHP9rJksDUJoMo4wmpRogTQd83AJk+AKPlGyF/YfYM1ie1R7g0U071VukZV1O8aFyMxnJ+lrh1Qyp0dX7buxKx9pvH2naaozlwwZy9Xp7zUtrVUOiEPAg9/P18PV96VfiBDdlUVEdq48LtWWX5KmGY3GXQkt4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488066; c=relaxed/simple; bh=V/mrKO4/iMUOKK1PYe8q0wwkvsJhO9MrartgigGUEWw=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=oMrBYq2PpHnkqBpP8SQejp6SDtVlMZHsUOxO3LHxoXiL2seCK591qpaUwjdH9SwsXFaI8F+QDEt334zi0NhZQOJEy1/LhUZ5znb6g9kx993jYVyw5LOJj7spnJTREVbD55JziwFrmYebzOr1yNEOMM4Kjd4zewQtkX6DU0AufY0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=T/ecXbLj; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=argHo+Iw; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="T/ecXbLj"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="argHo+Iw" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2BpGG029196 for ; Wed, 18 Dec 2024 02:14:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=j87wi7t0jyXYdH2XMlhSEjqKE9Er+Pf7sNpEKYECBP0=; b= T/ecXbLjR3eYkAwyYxZj6eerQBBU/sWFen3PTfC4m6fm2cd+x5IEuRIoD8WuDMkJ uy/KA3kDRA28EuVNB7Tb4oWjcnAXmVCzdqCWVkekqFrIR0SHt37LXmZh5UW24F6r ITKTW49mFMDIckUvf2BrkE1/XPcqGNlRaEYBJlLvzcgxFXa0iWSFNsh1C0YRVpxR LOYiSqpE/hKtE17IYgvYKqO0rgjOQTsF37LJIeIhULk7AJld8m18nLDTmkCqmYH7 fVye48eemt9VpN5/nhsIZSO+seWnNNP53j2GL9DEHy3Tr3QPCd0eXc7ZUgLYOyMA SZdqWsL2mjVdlpMNwIp30g== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0t2fgbv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:22 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI0RLPu035386 for ; Wed, 18 Dec 2024 02:14:22 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f97ycr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i26oDj/beDOg8uGj3lxWh5eeY5X7pY/5K5pRLvwZgSNdM26eSUWvCxKIEcCwD/wIIkAPCwlNzbyOq4Of1XQkzJgcCNuMFPOX8gHmDBdd0Hh69B4GGws1cJvYGBWEUbrXw2WIPgflrug8bFJaAb1A+WqcW475TUyjVJ9eaoyT2+2FQRL9dXG8tpnpDVgAN9BIkNbk1vH7zKTY8mNxOJrNGbyalm8lRDymw+rd0SmazD1FUbsIbEUF6SlcUO6mx//VKy9OM8xEUcSL0WywZBsVEBIQEHSk7zAH6L196xuxEiBobM8KhZIO1AHYPVeo74EY+KlLa4LCjyeN8IS5xgrcVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=j87wi7t0jyXYdH2XMlhSEjqKE9Er+Pf7sNpEKYECBP0=; b=eje3CW5PiUapX8jmnObEvyqPhI1ol0sbfmvWPeW3HLAufKIk4pbMvVh5/N1qg/4N3Ex0Vosn/CvNqhocopV+OBNFE6Q3sg6W8ENjSYU6BEqQwfRZpiwyLaD7X8j0KjCMpI5rTaH31r153FXcaCh7EUoeeRmN5J0cAXO9YVttqSeWbtfJbo84aHoFOiahG0AlKxhsMPZ2qH7a581E8WmYlgYlNRsJsUwlwG/dXrBK+SRssuWLJmewFzXViki/GW5ARofE5stHeRodpFrbeccqCU1Ul6ua28JLGjU8n16mEzw/4VlZM0MpLxOvIzec3N420r+ZXtxHCIWr8qHAsdaVdQ== 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=j87wi7t0jyXYdH2XMlhSEjqKE9Er+Pf7sNpEKYECBP0=; b=argHo+IwgytREHSZVyRZIu2ZMepGmefhqmpZ6B6fj3G7IY4X/WnVAIGmg5J/v878cqOMXztwEihuVBQA2vzAOB3vuaE0yDb8M2JPVSsSW3A46lNxlvrtsKUdRligXY/wgv6BeP05/lLSpkQhcAHCaL1oiRK6VOhZPB9Q9aoZ4Og= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by PH0PR10MB6959.namprd10.prod.outlook.com (2603:10b6:510:28f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Wed, 18 Dec 2024 02:14:20 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:20 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 04/18] xfs: declare xfs_file.c symbols in xfs_file.h Date: Tue, 17 Dec 2024 18:13:57 -0800 Message-Id: <20241218021411.42144-5-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR11CA0072.namprd11.prod.outlook.com (2603:10b6:a03:80::49) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|PH0PR10MB6959:EE_ X-MS-Office365-Filtering-Correlation-Id: 290a6838-0280-40f2-5bd8-08dd1f09ae8b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: aVTfDAoCJG8umwESNUwR6STku9VO8KBLMB4sCAq6VUrwL9C17jj4uz8Drv95XZhNR7jFkLQayo8jcKW/lAW6ZKFmueD6rv+7Rjkse4jVP6itha+rEmwTzqummHvNJcbL1JSGqKoxTd4GkupB3+LW93tKEoqci1lRNP97xRUfl9CK27GAsmxvnOqX5yhsLzfSAW+bXlZpMG2/yD6Q1HA023CFbYDr2PNe9qH79ZIh5LrHIfmVxCBuy5omsPJS0tyrQ4Cz0TpaTe+a+Byta+ElNmLFUbbGKk/rn9FgmBdZ2IaW/Wl2W86lB44Ymon0PrjPedbGbGjesnF2UvyLd0a7XEcVAKah3bGklgZ/t/Wsb1uGCxv1c+QYjEVNNqCOWt4rOvColfrNS1nlWneKdOC3v1/RtEh+DKLEaNrNCHJzMDRUywOUSnVBoP0oN/jd3Pv7dousV8CPg54/Vts4I8aTvxFgnmpgJNvWBUnzjNdWIA7MKcUmvzdAkS8Ss4BJCgcBLTFL78wkYqzR5wGRooI++Ex/Qt2ojVNpbjJ9jqf7s++od5ko+2uSe6n7TZXNPHw+Fn2ZfUGe2FJt8O5+w8vm61QFbOiI+AbsHAn30HEKWS4dzJmTeSwJAQsZEN3FIg43IT5UB7jkcwbQ17lyPoQA3DoLKfbr9V4i9+iqeRy40/JyGHtOjYEjzZP8KYYiv+lr210LZQ+V9lyYlvp0vlxhZeoEC/6Ni9mJwFEALeP6LYUHbLF07iDM2KEcvBuWnN3gfNYXxToGwCKJ8XbvOFjQX7OdFscoGtiJis6u0lJRaTisYyIV1oRFX51kVPhsIW2Aj2NbdSxxWh/6IyEay+FKBF/hLHus5tXnygp/pK0vpGyBMHCDO75Od8vcPF9M0JMyOLTShD4+xNbJNmQ73apm6S3TMsPdgdjBPcf9bTayFYyeXZFAlI+zCVGD64QYdeL3Oen8JMtfX9YqoX+GZ+Q/UMOmJmJyWjODLXKUOOTCpfwJeR97fcvB+UZpb5Lm1r0PRzdNvWNKnmyGvcyVZbgaFwjYi8Gp+coepUrPDO3Wg2rT3lXwvPJGWgsOqAWmTl+hIx51vsEbjBI7zQvX2JoOoK28DsbtdqBlSqjmtYVMMByGnedSqOFVe3xVEY5qbg55ls6coFDS/RbFVqWHVUvmbRo1WBZiWKS0UCzPcFB9xJtvS8bRjXQSZJFxuRqsJKoLcotHrXMVWNxcwur2F6jkznZSAWzQpTAfOrnAeKIwOtW5tf0LnXnyVIeIBnH9nutAPSDdxMJORpCQeoytnrxX2hG3wHbZ8cEc32ffb3Y3gLiVCNQUogcW2+8Unbt8vrdsPTJgn05zbAfji+XHEr3+gCa5GWaTGD31jiFIT7NBytw37GKcE7mIRtfIijHvYZVn X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5HqQ7oZLfHCDHqiNICJ7JWNU1Cw6KeumvKxDGLgi3hC366rzvP0zjnpw6dJ/KMJEBV+giWivyqDir5t0gtMthFBJitzpfqjeKaFuYsn8N4h6U8dXPMCCSBZhGVsXp9AXlYQYbePZl+yyk02+F29saG8KaEKqWN1n48gncvFI/DrtVX+U5X739+Sb2IhEl/fF7yS9EQPJX1JurjPIsPT36TCWarY40o98TlZn9/HmGxubC6kXBL0JRZxgLioHtAm2/ekl0yaPxe0eG6pI2E1EmrEummwqNsibP2Wic+5GeHvemZcaTMECkLNRsRpgk2M+m50KHEOWlDaokOXUNHa4j0ucUPYaWlQbuDmd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ZpBFVDG3RDdEDGoS4HHJp+MgZjU00vkazPbtepWAGtvmLIUDXcqocomDfOK43Jpun/nlcxG+QzmgGsybX4QEHnnE2YKbi3WOPFzSVY7KBHwON2pQqOnhYqSSwHgEO1eMEUKPmJwenPKCPDcDaepnZ6RkBYHpfgKUdCKkp03/C+XrAuONGPSksNgOf28hsYw/GAoAAv3dXmwhF09FhHgvmVh9vxigc82tAlku2E9rLfLErTay22atNA2w== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: h7SSDAw9c24iwQEO0CPrOpIgwVLGPKgAjliv6jIhDNlZ4/q1aeFQpu8wyvC7bw4mbLSbV64G18JldkMCMeeE54yjKJJvxuJ/4koYnbKcFEHtcJXUab1vGI78dcqSoZJfmtSK6QpxQDhOdMO1E0b7fxEDEnXKPCV0GXw/YDer05bZlcZ/pSRyz5cOxVQ+0s1X+bGuedbVorHWkfEN3YE1Asw4mGSprW5FZYo5gHC8ia9m+ztmiElSWIcLIAO1crKoZ1+OIRNpfEnnJeuQPOk6axMBdliin3tXvku8taj8950n/6KXOF80zZ0b5Q9goc69Em3dD6tyuxXQRHnNKKY2Bkztok8mpuHrKecsjh3cHEvMlhQtCa1dBOemDwGbCPM6hxOUMGTl0sTR7YYLp9Ykui7AS6UK78439dZxVnMW/e4Fs8dZPHxNPJaySPz4qL0/iA5uPFh43sNR45CC/igWTJaYwWZYasWcYCxLQt6hBPN4sDmHIPWYIzNng+nto3bs8hRZeK8hJp1pCBa2J1z2gfHsdc7aHOFS9DiP4d8FFowKJUkhH+bdcaOMdE5inScy9Sl8ATywPdD70S9rost5xSp/wTz/19cV4ZRzmhVnrSM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 290a6838-0280-40f2-5bd8-08dd1f09ae8b X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:20.1583 (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: cT95hLFJ0JzgfJ1d6QTJP7/n+k1+Rq2TqBNzbGjOldVdZcb2bXgafL/3GaS/H0h3BL8Z0aItdVLJfv/0yOzIWI102OyUXVli2Sr6PyLYj0s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB6959 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 spamscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-ORIG-GUID: s4DjVPgT6bTSzAR1cE65-gdK0L_L0UOe X-Proofpoint-GUID: s4DjVPgT6bTSzAR1cE65-gdK0L_L0UOe From: "Darrick J. Wong" commit 00acb28d96746f78389f23a7b5309a917b45c12f upstream. [backport: dependency of d3b689d and f23660f] Move the two public symbols in xfs_file.c to xfs_file.h. We're about to add more public symbols in that source file, so let's finally create the header file. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Catherine Hoang --- fs/xfs/xfs_file.c | 1 + fs/xfs/xfs_file.h | 12 ++++++++++++ fs/xfs/xfs_ioctl.c | 1 + fs/xfs/xfs_iops.c | 1 + fs/xfs/xfs_iops.h | 3 --- 5 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 fs/xfs/xfs_file.h diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index e33e5e13b95f..b9b3240a3c1f 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -24,6 +24,7 @@ #include "xfs_pnfs.h" #include "xfs_iomap.h" #include "xfs_reflink.h" +#include "xfs_file.h" #include #include diff --git a/fs/xfs/xfs_file.h b/fs/xfs/xfs_file.h new file mode 100644 index 000000000000..7d39e3eca56d --- /dev/null +++ b/fs/xfs/xfs_file.h @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2000-2005 Silicon Graphics, Inc. + * All Rights Reserved. + */ +#ifndef __XFS_FILE_H__ +#define __XFS_FILE_H__ + +extern const struct file_operations xfs_file_operations; +extern const struct file_operations xfs_dir_file_operations; + +#endif /* __XFS_FILE_H__ */ diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 535f6d38cdb5..df4bf0d56aad 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -38,6 +38,7 @@ #include "xfs_reflink.h" #include "xfs_ioctl.h" #include "xfs_xattr.h" +#include "xfs_file.h" #include #include diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index b8ec045708c3..f9466311dfea 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -25,6 +25,7 @@ #include "xfs_error.h" #include "xfs_ioctl.h" #include "xfs_xattr.h" +#include "xfs_file.h" #include #include diff --git a/fs/xfs/xfs_iops.h b/fs/xfs/xfs_iops.h index 7f84a0843b24..52d6d510a21d 100644 --- a/fs/xfs/xfs_iops.h +++ b/fs/xfs/xfs_iops.h @@ -8,9 +8,6 @@ struct xfs_inode; -extern const struct file_operations xfs_file_operations; -extern const struct file_operations xfs_dir_file_operations; - extern ssize_t xfs_vn_listxattr(struct dentry *, char *data, size_t size); int xfs_vn_setattr_size(struct mnt_idmap *idmap, From patchwork Wed Dec 18 02:13:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912901 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98ADE6EB7C for ; Wed, 18 Dec 2024 02:14:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488070; cv=fail; b=u/CMs3Ipaa1ZuYTxMpcj+iKOvGD3yUUi0grDhN3iO+DxOnf/KNoRLFIVAEKkKIB6PsZ4RYdH5y9GDxCpgJEt4HOi5rTirWTp1uxq48qeD4UkGjKlqb2IfUBMjA5zv9g9aRW5RrcHWtEFYeW4V0wGR4IIIPbfn2TV5SyOdyLe5Bs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488070; c=relaxed/simple; bh=eAkRDIfdgNvY7AtV87QwAzHyjRXDcN99Tror+mD3NmM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=oCDkXesmTNVmptsV+3xuobHeT3vUB8doAX+88S5Vg0VEKYl3tYypkh+vPc9Jl1Zbosy9696EcDzUx2qyDkKI5L0foN8ApfaeItFp6+qfsAEJYu5Q0vyb6HhxR28Iy//XSm2Pe/Jusa6smwTtVZEBxmQhZMyREo6V2nKSqQCoUik= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=R8D+4JU8; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=d4Ni1nzA; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="R8D+4JU8"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="d4Ni1nzA" Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2BqnO004593 for ; Wed, 18 Dec 2024 02:14:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=2b1SBqUb7RAVjjDr3PKL+unEbw+rufvv4HkLyA+M2QE=; b= R8D+4JU8jU2K2zFU+qwxVyRyM60PARpk/XS2xRZb77KpPo5QHgO82VVzdXnbHJKt j+tOezrIf+sp8QaFZf29lSA+LWhi6ECcKYySiZeT7UwQL0y2nyhl8Ud/wjJBJ9Vp tvVd31FXexMw/cgxfFgOTOexpN+GkpOiKYHmT8Y0/XkgM6860yxR7fITcOYOG4Kr v3y94sHAaM7fNDv27Wn7azBsOlrWnQhKH//Bf6wDXNhKG8MLWmwoZpZ0heHVbMjE LjEa//1bqL6YC7sUdcbtThU7ghblYoQdCYDnjIwgqGFaTaBopilMMlj94cHUeTCM 7odjoxAOmRjTYb4EIqZUXw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43jaj5db99-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:25 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI1JLxF000565 for ; Wed, 18 Dec 2024 02:14:24 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f9dc3p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eLkHF8DCQT0KXvuNk0FGbhCR0y8u15Q+0kJAjqnqdU96LwxKd/50aqtORwU+jaPkAvKshL+xUII+Ax3UIGFjeM+GWJH4OLkaUVYKKmqaLiwCXvGKRItCrDq/LB5/xH1q7pLPFz1Z9kLP3Pep78EnFqV1x58+KSUG0ZiQBtXA1T9qfrEhRzND0IxMgccJGvTsC8N3r5El8y9oHagadH+msaf1ReLY9/ToJeKygpSS2bE2anLtqGwuTb8F4WRYDcpPwFljsZgdzZP2gleS7kyj5BLWW/fy4h/R+7BsSjHBCItaSMoVJxN2KFNyK6Rj1uYVMwM1sIrqDiq3hYGBMAcFVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=2b1SBqUb7RAVjjDr3PKL+unEbw+rufvv4HkLyA+M2QE=; b=nMa8/wplmmoD8kGAs5spOxiZ6bUk3sXGV2YWDl8pT/mJnAMl8ekAIQevc5VBCGobNkMpzw9jBjFr6plzva7jAebXdqGhXf7Pu1VkiO2/8r4hjlvqvl/tlmJ/fZvb9xp29pewm3/Lui5j4/3y+8bqzR1GIJu5GoAFRsvSnj2e0xCojXTYoihSrkjUyEFqXhI0VIbsMg7W8vmWESo5NiPs5OjCjLaZyBgbol8fpxxC4sUSsGB6rHn5my5MAQ1OtZnAaaf1x/gJFujQhObRfXe58KriA8kfRrqnfpV5JrYG8Uat4j8vw+99k4l/FH8l5ivKW2dDvwZ7mUReZVCi2akzhA== 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=2b1SBqUb7RAVjjDr3PKL+unEbw+rufvv4HkLyA+M2QE=; b=d4Ni1nzAkqAp4qYLN+kY0iuTMtRGPxhu2xDyEGvtusl2D9aGmYRkNRCU2EF/vADN51BOsjDaU5bOBlEyxKLiaOS2qkDlqVnGLmzC/cfKJJOAWBBehXKFiEUA3XmQeI0WlVujXTpByos6wtyMhBD6cIU691Ad7jDdeiJ/PVScGMg= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by PH0PR10MB6959.namprd10.prod.outlook.com (2603:10b6:510:28f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Wed, 18 Dec 2024 02:14:22 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:22 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 05/18] xfs: create a new helper to return a file's allocation unit Date: Tue, 17 Dec 2024 18:13:58 -0800 Message-Id: <20241218021411.42144-6-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR11CA0071.namprd11.prod.outlook.com (2603:10b6:a03:80::48) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|PH0PR10MB6959:EE_ X-MS-Office365-Filtering-Correlation-Id: af30b3db-21f3-4ec0-6ede-08dd1f09afb9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: pmFhTZxusFRZt9TxR+aDSWN5aTpp6Yfpu9qQcncTd2hbd7T/QeFjzu1P87z9Zcigg0enViG5U5P+pxblx8Vy+o+hDe5oOFw7K5VPXtPUK6ZTJY+yFD6/9nU0omNMG3kiLd36KuF5Jv9pOJtXRPKPS9Tgw2QN1R2pw3DL5Pu6JoxRJYvadACeOT0Q1YVqZ9Vf0XN9ur/AYhr66LRPDmGGlxCRM6dZeWWjZWsW5kWxR+32w8eCN0/zGyysqphi2ECmh3LCJHQyHnCQn04o450Ae1+/r54pw7c4HpaRJoo2n9ydpHoJVGzNa4njsytKdTzBPWswizdkAy+VC5L3w+cwkS6Bhp1ETNoj2oW7Q9gKotz2TG7jIKHJa1+Ot5X6PUG0cAx/o6kcJS3fLSvz6045LsqHQ+C10lMaefDEuyeRR0acf3eas2L1MbxZLeWjUa/Vg3Us3EoVL0Gd/vmRtCdDbUTxrZJaL/KEYaxVQ0vGNkwjn0vH3UsHYpvcgW8P/kEHYjBOQKI4EruUMaTPXSFavpSSIQTiwwOlFsJFzHU7od8pOzkUOY4lPD7xWkN1hpC88jqlZSgxAWTegUuWB9IUtjhSGkGG09SyaLfs4BsPkarGBoTF3nvyWtnJ0YLIl5D3PYvkhtqvZp3IrybihhuRSnmTbUSsPeDUHU0D0zeKr1gp8Mh0bgK8aUJLF2/ajDxSyWWtD5ExTLtEbbK/fCtwCAgC09lii/PcYKtQuw+qUmRwlJR1p8t+gMyeGMm1qb+lx2RA8WJbNaqqU2P5hoF6vRCMLAsD3486z5XHP6VWQYJ4acLWSad2ZGzVo3W8nxlU5gSab7oKpEW5TzFADA82S5/0BZu6brUHChxcEUnaeIfKpWJq1+ylReCvy1nxwvMLhh713fh5bRnGCMXcQRnoGc8Owapq8Twen+MFMWu8Ij782U4TMb3xdOFEbK0UKAZVUJWPgVQBzLbrkQS3bgukdWCj+h5YE3hlxnQWhnADfWr3EgiPWa4aNtQmqyYlyMGy+5STbmANKDcKdRDemXJjzoZs8GBqHea2fcDr6xk2htmbMP7J9lkalf7Buq7Hn0Lul/f0dHN1MVOx7JVMRQbygqBtXHM8ZgSMVkLD6yJH0Zm/LluQHG07i83DbXTfxCirEWpNko3W6D0sqvcewF0gRgnkrK6HVYPpmz8JBtRm7WReY6xG5odtf5ByNIMJw2lAQkMVDFwdk17jnWFmDRnspgldLQtCKZOZhq7u/SJrmhKS4b5MlFbBpke/RUZdg3uT/onxo5SmMvZpAFq7sian2l4VaEoL3GqyeYO7m84wf59go7NTig2lP5ANgV/7R42PGjslKGAnL6CuTXXvm38O/H46VF/EH/8RPiLyl/pkwFAEkQcbYiRfMJQao1ZToxz1 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-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tqLS0DlUitAdsw2/onpy0i24tJoYhfhgM5gJq+L14tsilKZppeIEPdVKo2RPgE9JABD3zEvDRi8yZeHtHiHMlk9bkcfS34Z11GBjv+mwjJsRalNcyAEEb0+KdiCUCcY7QL0t07g94hIgG9IEQr3hHC/wUaRNXtg3DsjVXT2O8L7y1GXqBNXwLnsTKjz74xLDF9mDG6Kq7LvJs545YH8GwOgLZYIswqgK/ElfDXhqanOeVqFqxViABgtEFjlDRos83Ub6/VHZg1LWELc87TfGYlM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: af30b3db-21f3-4ec0-6ede-08dd1f09afb9 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:22.1380 (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: WFTJE9VgTS/rmXHVyrbQbHryJz+35LWjGaToEf4NDyLYBA3YvuuBLrX3B9odUMctiN0Gd2EBEr+chqt8CpteLqjQxZP8wQ6FuAplm7wp9lo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB6959 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: ceduvBMBnza8HJ5Z2LlqgorgBcT91Yyw X-Proofpoint-ORIG-GUID: ceduvBMBnza8HJ5Z2LlqgorgBcT91Yyw From: "Darrick J. Wong" commit ee20808d848c87a51e176706d81b95a21747d6cf upstream. [backport: dependency of d3b689d and f23660f] Create a new helper function to calculate the fundamental allocation unit (i.e. the smallest unit of space we can allocate) of a file. Things are going to get hairy with range-exchange on the realtime device, so prepare for this now. Remove the static attribute from xfs_is_falloc_aligned since the next patch will need it. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Catherine Hoang --- fs/xfs/xfs_file.c | 32 ++++++++++++-------------------- fs/xfs/xfs_file.h | 3 +++ fs/xfs/xfs_inode.c | 13 +++++++++++++ fs/xfs/xfs_inode.h | 2 ++ 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index b9b3240a3c1f..dc26b732aa24 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -39,33 +39,25 @@ static const struct vm_operations_struct xfs_file_vm_ops; * Decide if the given file range is aligned to the size of the fundamental * allocation unit for the file. */ -static bool +bool xfs_is_falloc_aligned( struct xfs_inode *ip, loff_t pos, long long int len) { - struct xfs_mount *mp = ip->i_mount; - uint64_t mask; - - if (XFS_IS_REALTIME_INODE(ip)) { - if (!is_power_of_2(mp->m_sb.sb_rextsize)) { - u64 rextbytes; - u32 mod; - - rextbytes = XFS_FSB_TO_B(mp, mp->m_sb.sb_rextsize); - div_u64_rem(pos, rextbytes, &mod); - if (mod) - return false; - div_u64_rem(len, rextbytes, &mod); - return mod == 0; - } - mask = XFS_FSB_TO_B(mp, mp->m_sb.sb_rextsize) - 1; - } else { - mask = mp->m_sb.sb_blocksize - 1; + unsigned int alloc_unit = xfs_inode_alloc_unitsize(ip); + + if (!is_power_of_2(alloc_unit)) { + u32 mod; + + div_u64_rem(pos, alloc_unit, &mod); + if (mod) + return false; + div_u64_rem(len, alloc_unit, &mod); + return mod == 0; } - return !((pos | len) & mask); + return !((pos | len) & (alloc_unit - 1)); } /* diff --git a/fs/xfs/xfs_file.h b/fs/xfs/xfs_file.h index 7d39e3eca56d..2ad91f755caf 100644 --- a/fs/xfs/xfs_file.h +++ b/fs/xfs/xfs_file.h @@ -9,4 +9,7 @@ extern const struct file_operations xfs_file_operations; extern const struct file_operations xfs_dir_file_operations; +bool xfs_is_falloc_aligned(struct xfs_inode *ip, loff_t pos, + long long int len); + #endif /* __XFS_FILE_H__ */ diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 1e50cc9a29db..6f7dca1c14c7 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -3782,3 +3782,16 @@ xfs_inode_reload_unlinked( return error; } + +/* Returns the size of fundamental allocation unit for a file, in bytes. */ +unsigned int +xfs_inode_alloc_unitsize( + struct xfs_inode *ip) +{ + unsigned int blocks = 1; + + if (XFS_IS_REALTIME_INODE(ip)) + blocks = ip->i_mount->m_sb.sb_rextsize; + + return XFS_FSB_TO_B(ip->i_mount, blocks); +} diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 3beb470f1892..0f2999b84e7d 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -622,4 +622,6 @@ xfs_inode_unlinked_incomplete( int xfs_inode_reload_unlinked_bucket(struct xfs_trans *tp, struct xfs_inode *ip); int xfs_inode_reload_unlinked(struct xfs_inode *ip); +unsigned int xfs_inode_alloc_unitsize(struct xfs_inode *ip); + #endif /* __XFS_INODE_H__ */ From patchwork Wed Dec 18 02:13:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912903 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6496B7C6E6 for ; Wed, 18 Dec 2024 02:14:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488071; cv=fail; b=g/cLSABbEGvMIoPtgn8/uONYBofop64Tkcmb5bOSXTIjacSw3qihB7LiO4uuyBj1IJvIaWNWd/LuOLlVv1F7bNUe0wXZikY0ZzjVDGU9+5O8z3tOWLB5RvXF/RdF0i+riHmQ3a43Cnk5SaLdQxeQwU5yJ+J0kuycdMj3JHz3fRs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488071; c=relaxed/simple; bh=DffPT8OGw3APfCSx8Xs4ZtoLe5/3JgRz7DEjHTyhIeg=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=SQo9bYmmKt6CIGHDACSCAD10iL8pbUPkYLZfyQPkVS7W11w+I6KfOk25njKRH5X476JxJKjLH0p4PWyggN95UsJEFBYDk2HDHIMhi/e5RvxQyT5xb/ILRb5D/sN2XRyk/zckDn3jRl1IX5AxwGtKqbmYGrRwkxbFNkJH+UZStxk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=SY6sybno; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Hf/4HGy4; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="SY6sybno"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Hf/4HGy4" Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2BtDC001508 for ; Wed, 18 Dec 2024 02:14:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=h/DKrACGieoKaj2IhvGvin2xwlA0HSckjRecyvuccOQ=; b= SY6sybnoxU9+MI01sUy3qRuRp2UUFjmoLBg06o/qhglJDX5LPfyvLsIPiWzkDA/T Ebgkt5DC5tDzB9ydh932qYCmDfR6siGeJl+hJm297jR2DeciHTfmboe1cfVX2/Hv tKGWayg/XtCObF28ddiNJcB0aiXK2cRbIqMoPQ2O0CEoWtTlZLxvnHEGWU2KyIDA FgOXg/wq4ZrphqD6gVa2SRBH8DQOtCzFBGW1T5bEb6RNYTe7tRSIJAgPwsvsDNor 2d8VvOVoo5CLPrg8XCDz3RH+cNWAcuM2kuGjyayN6id0lFzztD6QHrw9wMHFveU7 cgyXUD0FkwKYkqiIIMFpsw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0xayk6y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:27 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI29oEE018307 for ; Wed, 18 Dec 2024 02:14:26 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f9fbu4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ygNiPOM9KniZDn/YGYest0TLLSA8GYmL09TLHG2O9PXaInDTkUP/XqXwZNiA9HZFXHWIJLrYxGlYXxceM8VSXw6x0wHl5yQswnBLwpmA8bIhoZxcnjgLmVkT9dwdjtEKh7AmHf42W6qpuEPT2A4mvh8faZjx+r/L4CxeF7PveRK2uIjU+SbxWVP8maWcJ/oDzU+SpyoswntCoKGxGxpaPnCQiko93i6QcV5Lc6Ph3qk2e4BfdEaeoUKG8RvFqhkbKYfKrIYRQ3c/w672H6//xz626BBeUUeH0Dk5T1QDsLRj3E9O6BEi5DVEa2KdbZjZbeWzyXb7BJ84GmSbrwKvNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=h/DKrACGieoKaj2IhvGvin2xwlA0HSckjRecyvuccOQ=; b=WSAkwieEicQgUHgzguFpEaPpKlPP3ThVu4HKtmobAivN2jXmUBsRBntfTqnBgXuDW/5LwvTCeiqsEeQKPRCv100bMaRA9oih65ahRDe+uuNkfBmytC5HX70tKPxiM+MKwEpIrIxJPqGJI8KzKXQ8g2FT0VOxn0t+VrfM3ejDnYubyI3dWHqG7FP74MjHCoLJLltF9xpGzhTdJf0N98x59Wdn0Kr8AZ5TJlvYBQMuLF6FIqDwWcZ70Vd5qyd9xOk1IPMa+VpqibUijOKPrn7vGxrtEyI1J9TWirKY+0qItf13oz8bKlRHwNMxPgLCiumtmw56jw0vlXTqaJRS4f5L1A== 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=h/DKrACGieoKaj2IhvGvin2xwlA0HSckjRecyvuccOQ=; b=Hf/4HGy4D3fhPWcLMrLLy+j3Hl1B8MKMzgZdq24cIF5xH+ZXRkOwP4YPN7JvBTdxAQiC+CFhiyYr+Gq60Lwv7Wjl9dAkx6UTNDCz4Ns4Qii+UkkpStderZGNlNb5MKYlbThikhwQQvJlHRFnPmwFA9pmwQ7M+QwM2Pllr1YiRRo= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by PH0PR10MB6959.namprd10.prod.outlook.com (2603:10b6:510:28f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Wed, 18 Dec 2024 02:14:24 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:23 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 06/18] xfs: Fix xfs_flush_unmap_range() range for RT Date: Tue, 17 Dec 2024 18:13:59 -0800 Message-Id: <20241218021411.42144-7-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR11CA0039.namprd11.prod.outlook.com (2603:10b6:a03:80::16) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|PH0PR10MB6959:EE_ X-MS-Office365-Filtering-Correlation-Id: 05fead31-9530-4be0-e45c-08dd1f09b0c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: q8WwAlA2lQfqLjzD8XlxT45r6cL4IxHTboP3Kdi8Di5n00/IprvBZfotRYLY3ggbVlNnWgvpvhn6506gV7dVlTLbQg2U2aVJZKj4Vzeq9NU81FV4aUvQU8P6GaPuc+oWHjlm3G2YEoe0Rg/9mXRX3bo6I5JvkJ6M9gMhtfrjlCjGP50ccCh8ODuTAwnLf8W1fNm0uJp6KYRfTtx2K63DqRe9TpZqZUp2pBQXacofy/vwXTy7b93hqFCnWm6tmFU/nwnddomsQ4dyIdgthIsLEp26rlV8oD0th7JRtXae1JacS6AbkRIzJuG9sFqFJx66kbOjXhCy3wxC2NTRo7/nShPoHzxauAMCVFvghXrUUDuZLshQ/qAHXXCF8xouG98u9m3hh3t9l2KNn1m6PvdghhlvjI48QOXXAjbm8OvKQPnNQlr3BOf7GTyGioaF0/3NkFEg7YW/55vo688JCGL/5mb4sEulMmxXlhrE1MuLucdOiu63vC1x+GT8Hgm9Q5X4x4rT/MbL+mkGbyDivYNx7ruE6PJCVZOFANdqF33DS0znlLdH1Gn4tbRmGJ35ZxvT8XpyL0nUPUYrApvtC60LXkn9uTGDC+Kje06i6gtKhsCT0Q9pMug3nTG3JUS4RIHO7QmV78dDu2wcBDUHcJyDMtS0UXpFj8+4plnmDV2ssjmi5SQLcvZAa0jpQSuyHe+aYqPk/y4EH8/5LoIOSXwITQEBheZqt/a9BFw80c35l+/f6mO26SdS4SkyAvD8R2xZ7nVWS2qPmLtIrRAGu+pJvUJq6AxzaGQ18lQ1evMYZbMJ7+235YJ8BFXiLg8yF1euWD+MP8WIEtGQZO/kVvIBWve9ZRlWucJrTv9ZWUm6sBMA6seVuTtyG9mq8Xd0d5Q2d8FNjNle4kwPFe5kQT/EOAIFi6yo+DDxrrBRfKGPPWTpejGfDjjzc0H3ncTMDPNcdcDFl/T5UmUaGlKwMNmNjgL3KixcJAP9vhSRYhGLQ/bZUv0d0RHSLKHAjYlPdujCJ3DILgk7hFygeBo3byNcna6aXUgaNwVjOn5V2SQNXxn1t8H7Foo38NVqs9+wkS/Rqvc8qhUzwjzOIglY5R6RuOZFOLaX9K4eAXpd5TnOfmom8ftMGpvDLGjBaQdAPu1k+/GIf7xf0Jx7xsGnp3A49FQRxgPaXHtgDLvIS0xtQQRGkH7Qg+YBTig/iCJqxmgwCF6EgR9l6lj3udgkiK8GfJdfxE0DPg0Qy27Qed83tY2cWQrEr+ddrg8TPhbSUmkDertKgz/4ItfGoJp5huHaW7+lfq2/vzjrcJQXtq3WW2+tjJsJ5LymkqxAREhdeWhYDY9Vyq5ff22PeMMNc52fNbRYHvNePSRmuMF6VsUDhFXIm2FR6vU0wQCNN9/k+Y2F X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KweCMY+JxTomHmCC0A+CBurbgmqPd8AcIoaxJY3GSLrwhWZtRLt1aDWGLawl2p6aIGjrebaQsraA7g1GbalMHTZkaB7M9FxFut6G67gehEOUMWy9t8Sn4NjirpdJsaO0Aij4OlPMFQ+EdI4Jvyn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OMCwEjas9CoRqjYzmMcYRLv3QMnQhg9F1dZ8YldlNqwskD49844am+s4lTB4zEAYBwL4AQT16kAHlr9zhSsp2hwjjfnrMo1k= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05fead31-9530-4be0-e45c-08dd1f09b0c2 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:23.8953 (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: VrolyB/49895uNtGgLcwx6xJe5D09QOA7PkqNXm3wCZY3og8vfBryD+1M6Sn3FATzAjWG/8IuY1b+Q6QecLUMl6HqW9MJJNEGmR3q+gRnns= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB6959 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 suspectscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: ySoBMywdc_BQ45ohjmErkEfxgniS_kdY X-Proofpoint-ORIG-GUID: ySoBMywdc_BQ45ohjmErkEfxgniS_kdY From: John Garry commit d3b689d7c711a9f36d3e48db9eaa75784a892f4c upstream. Currently xfs_flush_unmap_range() does unmap for a full RT extent range, which we also want to ensure is clean and idle. This code change is originally from Dave Chinner. Reviewed-by: Christoph Hellwig 4 Reviewed-by: Darrick J. Wong Signed-off-by: John Garry Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang --- fs/xfs/xfs_bmap_util.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index f9d72d8e3c35..7336402f1efa 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -963,14 +963,18 @@ xfs_flush_unmap_range( xfs_off_t offset, xfs_off_t len) { - struct xfs_mount *mp = ip->i_mount; struct inode *inode = VFS_I(ip); xfs_off_t rounding, start, end; int error; - rounding = max_t(xfs_off_t, mp->m_sb.sb_blocksize, PAGE_SIZE); - start = round_down(offset, rounding); - end = round_up(offset + len, rounding) - 1; + /* + * Make sure we extend the flush out to extent alignment + * boundaries so any extent range overlapping the start/end + * of the modification we are about to do is clean and idle. + */ + rounding = max_t(xfs_off_t, xfs_inode_alloc_unitsize(ip), PAGE_SIZE); + start = rounddown_64(offset, rounding); + end = roundup_64(offset + len, rounding) - 1; error = filemap_write_and_wait_range(inode->i_mapping, start, end); if (error) From patchwork Wed Dec 18 02:14:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912902 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 339EE7080B for ; Wed, 18 Dec 2024 02:14:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488070; cv=fail; b=XSWqWkh/UlyNLlz806PNSw6zRiUythN9QXD4uzVQMYcGKS719voD5eOUdfvKvNQbv9x+weIVzbz9nx7gpDRwUaMOWSj4UGJLUzgdPYm+3qg+/toEqlFfNfJ7d8lqM59LafWztF1TWM5o8gBCNV/2s3bYK5Xp/FId5w1JX696N6A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488070; c=relaxed/simple; bh=EDEAopcb5aaDV3IxtkrLyB5Fh/DfGDmJHerFBFZoaKs=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=noFW5YvnE7qOASyMXu9uRkBy0GyuHaVVJJ9dYEpnLLRV/UsKgbbg3Pszr/tEiwoEtiOGoHlordtn8JbmFwcKonA98p2CMqlIZ2EOXBsGyr36AvGH/gfbLG+sTH6fhzzyjphyahRt5ifjSoNepg0ak8820U85dsCttLw1Q+svL20= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=PJ+tIlub; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=PFQ18QL8; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="PJ+tIlub"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="PFQ18QL8" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2BrvX001129 for ; Wed, 18 Dec 2024 02:14:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=33Sa8NpBRSsVzc9p9XSCT1Ps1Lc+cgCT0PjOc4qJGag=; b= PJ+tIlubbF9dzYTytyS5TRCtVTt+1s025rSo9Em2spGKubVWZmijzPXYWjDcDMiZ eot3VpU1iAn6BFyQBfwQR2k1+PEOqgFyW9qYXshYk5ZSTOYkhNEf27IHnF/6FHUm sHSPxUK47z+M/r4tCzgfC7nJNndD+aXFQoys8AnFRqb4j2v82KvtV9Vah/ctxLMb D7lg6qoiPOV9KuvZU5ADuxtcy5DsmSVWdNvBBIThWONj08bsOFkyGDZtINR0hNoj 4DPLF2tmqfzG8Ws5DZblO9mGfxkg6EKIEre+NFy/Qmj6idc4uhHCl/0L6fIy17av cnjH2I/bcwKIk46Y03KN7Q== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0ec7fmd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:28 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI16RUG032823 for ; Wed, 18 Dec 2024 02:14:27 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2176.outbound.protection.outlook.com [104.47.55.176]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fffbd3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OF1iee+7UECWPpAwy0vpN8yAgObc49/T3nyr0rb3AajtZ8VX4cWRCDxtS7/Tpu/zHErRi+e+6PzTkEJhnHPiGiWmWvZoMnrsx9N3NAvFyBcBjukZfs07W9yED4Y+Rmb9Nr5AllekEL6mi7lcjTcLXUKmE8Y8/r/wW9bvKaMSI4pDdh1hNNyk+9PyAxjroE2zm4IB1LU60Wpv3Jvjdfwdjw5h0d52uHfs2sD5Hx0JBQxzzGDAN6NIz0nbC7gadqvjdAFjZWezsacAMn5GKc4qHO+ARtsdm5Xtxnl/eTFVp8wYqKZ5J+sLeQFrQaRUM+hBEirgouFhBQxIcHV4Qh3+AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=33Sa8NpBRSsVzc9p9XSCT1Ps1Lc+cgCT0PjOc4qJGag=; b=Yp+2fS4IMFpCNWQB/5Llr78owHLUy4JIHgy1KpixGqg1k/jAvyOos5YpkGDR2GP2fw/HD+PCR4OaH9mu5mYbFBjVu9r6uG4nc9YSPyT4LQVO7WDXig8+XK356mBpwkXf1mCprU8qCNBzaAgS49/nNX7xa7tJVUEdcYrXHghCCnHDa4MpemYCDb6uot2qJndY/gvCk0LF3RGWQHDCAep4kd3oMeOppR8Fay87E3ujy/nuyvmWHKdg+Fe5uFX8isdm8u3yLU9yA1V6AyW6okxpvo2hEpNbEjVsh78TL/KAbvMRicqjAatB14qECsi1XsWUEceCFy/ENBLUpz/tokTU6A== 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=33Sa8NpBRSsVzc9p9XSCT1Ps1Lc+cgCT0PjOc4qJGag=; b=PFQ18QL8ELJSNAR2sFQaWIA9SMYczHhmuN4BY7Tmwh6K6yKoMqqAeOb7SYVeK143i1sKnflZ5ih70ww/UpCSaisn45alqkojAeix4+EXRvFjsQ6Ji+TRaZA78StKGWEChrkpeLvX410Clvkz9UBkDMg/WUfx1SHpHIOIsow8Z00= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by PH0PR10MB6959.namprd10.prod.outlook.com (2603:10b6:510:28f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Wed, 18 Dec 2024 02:14:25 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:25 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 07/18] xfs: Fix xfs_prepare_shift() range for RT Date: Tue, 17 Dec 2024 18:14:00 -0800 Message-Id: <20241218021411.42144-8-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR11CA0070.namprd11.prod.outlook.com (2603:10b6:a03:80::47) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|PH0PR10MB6959:EE_ X-MS-Office365-Filtering-Correlation-Id: 91865e97-d658-49eb-2560-08dd1f09b1d8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: uz68642VtAjCgryD2Pz/pC7crxLalUUJ6w+Psp6AQ6qbZTjAYlmDC5xpUavm0NZA+pbs07X8JOfH6V3AecK3fmUr2RinDZfMw+/spmsB9xawBsGHy8N9trW0FuKtiQ3dmjdv4Y8nx26/SItljq69lOk3p990ZPMo96XwE9VmcWiJhy1PjyXBLlRFbrZWTcvLnndwq9umzP7GaQ6KMsxnuPmOYYruz0ehUUetUs81RhuMKLDwhFf0SyCQXIpzeKYCggUHLhJmVWMJKli4G1fq+36XXm2EMiSh9MfL3hsp0bwn3v6B3ipxBQwn80M2vmdiMofX8Xw2+u4+BrSTxXQpmbdf3nyzGt9I1IztD6EkYAnAwXh4eKA8YyHDSsQEcvTyLruRUz5qxUZ4Z9AoHaVTMDUBcguC6kSVi2b3Gpt+5NWnLjF7ggj0JoY6kO7LtT088ooLfr/h7CoSjSXq8xc/zQnOHy4IJhkMk0KKhowbP8Zhzp6S14aDohjiU0B6veZTa6loi8bRMSwDPpzIdP4s5mWG0QOxDTSzDbz/sc84ii4+lW86r6mPmjTZzWDmNLrBXfG6WfYdrGhD8dtz+kTMer89ApeYWbD+3RqKIoHQVWKZGkup8klGVz08X9paURHTZcBL0i76I9i4VamDCvtpTYHrUHMkEORMdhjheHjQ5js57YExcIlh2Y18FUlafl4NW9fFvYXMWyu0YP/sr3O7oOAL694dEwxNqu0SOs3u+MHTZ6l0zjYz2U+ViQNaiU0tosAnwBRY/AwOz6lcF3Z8mYepy6+coWhSoVgNP8PFxKiFP8ke6uXjZLu1odyQ8uoBI3QUYZO+l/FB8gfDx4/wE1aKki8F+3A1ortfx7ysYvh+xh5hqDHZaGXFTUigk6EgvM4d8DvUNLzy89b8ZjyuR8Zt3ITg5J23anmaAw3bJE6J9PBkr8w8SN+1u0WCmrCxqwog0kkAsNWCRnllyE5PCxKKd6KFEjdLIZw3SAV87ZKDmFKGgY/NDUIdXMfe4a7C6I6yHXb3d6cX2sOyLNg4TQZfAjzC4GmMh3VsHw5R/sT22NVZQDaEv5VT3f5PQCLFSBrBMfGImDt19YOQYfqlU/9aaRb2LJaqM7UAtMfivtz1UYoxOYdHR0wNGonzxmsULECk6yQ0igHNof++P2mst1lHtwehz19v0W5kcJtJBOK7zAkiEUjLey40tiG2pGH3IdeaGfqY7+1mVeSe47pwh090rsfVdReAPEZ58l1MCrrwdx9oMN/aNpZZWDi5kOJCNSKmmYQjzeeJ6ZIylPPUnXHPket/S47pGWjg6sc9uFE8SI6gXpcqLDXh50d3GQcSE0RX5eCJrVSBxVv+lV50F6qLxA7yEOyzfShAdj9Wn8MLNq7MP4yzYCbHOuawwUt1 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Cfm4BBehtv/YgUNYsBxjiHuj0QmeTLY6sPs7EICrVeLLqDysDlaEvhQHVX63LWGrLhcQF60BgTuVJI9fy8w+GQgBbsRyBlOsVO4nWXbYYizxIIzhbmzfoTETWwHW/46bF+697Mz8dQkAD7L++UaaZX/v/i/VWTNqohSW0/UMWW17G1uBHtQ337cyWdN8azvHc1IFpcRvo9kOrtgN8rt0Ocf1WhkR6lljSS689NA5zsdnwWbrORMIYU9w8EB/BRhPd2Hm4KstBUh8N9t0CWjbvY2GuEzefpEctP8bu51eJ+2vh7BHWMATHQRv694cdhmLV1QQw1CbBweIJOA6DpUXf+k1JYdvucCY96YDesLHOG1WoSm/cc09r4SZSqe5R1jmOi96Hy3/OyR2ENo8Fo+Q2OWmj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PSs6lzchYJ9eugXbFHyXCCDvAtsDmp67SXLncCPwMiiQtkTjGPZJOJKk8p5hilOCwwndHcjFyuKzgazBORC/ssgIH2T/H9i1NkiJGCDAn5WnSNVG537aOqjy6i0hPpRsVIvnJb4zbmjnx9PDTcwjAPxMyJ1kdmKQ1hEQifegkMHKmW/6OcaA3LJV9+D2k0+JAK2F2cEZOXQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: +SYN0DO3yA6IYAhctWkYaDiqvIpi3mkCJJLNStuPTnSW1g6RHFYvRxnY2cg8EZZylLEpWa24LYKtvAkcO26Le12ZODU5ar5LeYeAHTQv4BHyttAV1AM+b7Rw7JGXK7zg28PFtg3VMnEKAfClw4RKakdB3kHGZ3gvTOn7hF8FVROtU49UxGAJxgXrLjm14z9jqovorwoCqOJzuPt5sJrUw7lm+yfggpjQnCliiMS4ltVYkQdctUPj8X6u21N0zOauDKAGA6jjuVi5LTTRdgPY2lhg5Xuop7RrCU/YwtWNxR4KIQh9WHCN0i5OLQk0q68bAHAk0NSB1LzDOSWGSVeKXZC4ubQgMJBs3g3Dh0PfI3c6FzcXyfeT++Un1didz8Sw6VGJaW79vCluPsf5hu3sg+jEWPty5pZcG5Cbs7zP9xc5wDwQ+2uczm8k08LQfxlvRoO0fW+ufr4Vtab7DmwTkOLX/vTBCU84R4/Gd2kQU7Cq5RShnjfbQJYzxkZ+WW0NBxKzPbWv/xuExZCtEChHB/GXN2EfzQpmhx0Jcv0CGEqn35iPHfyuihxKHkmo38xcI49lDYJd0/f8aMb3P3qWFXnNZ0jiugi2bOtTdshGmKs= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91865e97-d658-49eb-2560-08dd1f09b1d8 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:25.7136 (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: wprYd/P7CfRU+yDPw3qcKAFH7Jq+VPUIoe+X1OUUqDD1Bc1egaCqYvmhqpjWZl6YZf9wi5agOZ/xo7DrsWv3QTLazvI/ypUqRvW/2tCzBlk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB6959 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: qAfr6uKFBkuBUsk07KnrLlGCC9OBVT7J X-Proofpoint-ORIG-GUID: qAfr6uKFBkuBUsk07KnrLlGCC9OBVT7J From: John Garry commit f23660f059470ec7043748da7641e84183c23bc8 upstream. The RT extent range must be considered in the xfs_flush_unmap_range() call to stabilize the boundary. This code change is originally from Dave Chinner. Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: John Garry Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang --- fs/xfs/xfs_bmap_util.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 7336402f1efa..1fa10a83da0b 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -1059,7 +1059,7 @@ xfs_prepare_shift( struct xfs_inode *ip, loff_t offset) { - struct xfs_mount *mp = ip->i_mount; + unsigned int rounding; int error; /* @@ -1077,11 +1077,13 @@ xfs_prepare_shift( * with the full range of the operation. If we don't, a COW writeback * completion could race with an insert, front merge with the start * extent (after split) during the shift and corrupt the file. Start - * with the block just prior to the start to stabilize the boundary. + * with the allocation unit just prior to the start to stabilize the + * boundary. */ - offset = round_down(offset, mp->m_sb.sb_blocksize); + rounding = xfs_inode_alloc_unitsize(ip); + offset = rounddown_64(offset, rounding); if (offset) - offset -= mp->m_sb.sb_blocksize; + offset -= rounding; /* * Writeback and invalidate cache for the remainder of the file as we're From patchwork Wed Dec 18 02:14:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912904 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B9D270831 for ; Wed, 18 Dec 2024 02:14:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488074; cv=fail; b=DnjCqF4aqyPggMpgWtDzv12m3aySPnQvh+FHTD1AymhFpzUabDNYTHCTK3MbUu4iUK1luWzYJwJrxtKYDEqVSYonRs6+EsENEhfdLhC7o7x3jSbHwUyVdaO/UdO0NR7mGldaQKvAqfqliHW9IV2LcZjjxFb7Rq15+F6v3SquN8Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488074; c=relaxed/simple; bh=ENQB/EQ2v9hoLydf81Qy/JFDl2s2V31l0ZPNreUAxx0=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=AGVMgKud2jnzAQKMSgnQ+JDgj4VWihUrw8Inj8NkO7GnK7TfK2xVA9SMooIxTygww8rHkgyIfKb0hxhYgMzjjVMx82XU4zAxjzf+RBfxk9SK4nrSA9lUbgJ8Kyd4yezvQDiqvs9LHG1kb5pM0HtaVeD8wB6Ld1ywuX9w2slfYyE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=caQk+AQA; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Fcl+56xc; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="caQk+AQA"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Fcl+56xc" Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2Bpj9016216 for ; Wed, 18 Dec 2024 02:14:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=z9E0RklIgoLnFku1YFWklEley2VgMWTR1w8x9rsugIE=; b= caQk+AQAWAJ2HYHGJ8RJB+FbrEcKzuk/s7j7tRGJiRr1tWyWCvBJ8CVYCwiTjLM1 hoLPdXQDM67L7HG63JyoUi+lEyTsZMZ+e2chEd5ZKkOiF+msDX5lMTVF7K/E/UUX tXVFSWE5PknZCV44OSIdNH0W/jT0/WlNYSi0zr32cKmlc19H2sZlaIIgrj3m3MWk 3sOFr+r+sHuCEgAcJ4sveJgiEhUPDSWVXCrY9tQlodmgyes0/7pqFVq2x3Vjca5c EsYC6ZTTwAMpX1Ki/PqcuQoHrBkwlBXE7qEZErs90RFFhbKiSbVS4hUquNMRWI+Z Kd/i5cWaQz94iS6hsLx3ng== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h22cqhdt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:31 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BHNe8VX011078 for ; Wed, 18 Dec 2024 02:14:30 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2171.outbound.protection.outlook.com [104.47.55.171]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f945u5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Bhp69mdU3GM1j27/NcmUPi67Ou/DQqigRWMsj+OFWOkj2s9CriIQaz2BJVdrxbPIc2kUNjNZo9fpthlZp82IsnplIUQpm8HB2J7N5jVpnwPrTTpLhjVDdeYPHOP2D3EtmAs1BbQFhq54/tDYVJGfqubsFYXN7KeFRfCIyqNt1/jhT2aB2gL0wMQn8J4Ih9ksd5GUKCUfM3vI6EBsSV5hfl30SsMINF8J2tC8+aXOEeEyee0K4hDvzYmyYLLKG41pwjUiVkJ6cAuCMvKCW0Np5nhkYmvMoJNySHO7ffKeOg8wgXZ38K2C1uAYm/xxHJjP5x7rRFnJuHVCdkr9I3Uuew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=z9E0RklIgoLnFku1YFWklEley2VgMWTR1w8x9rsugIE=; b=MIAiSWOzh1QgR7mcZWEif04KeSez5EOLbkorYotA9ujTjYWFiolE6LF2mRk8QHqzOMzFKk/GNDOXUellMVTyUq1oGjRaXarLLhWiJTAnE8bTG8dPeg2SIWfIaUgWBZWEhFm1wTzkDMky+rObTgntfqQ6Y7CAxJye43/OgLW93gGdxaGp90yX15NG4Hnp2vTBZNcDMtDvo5g+sdw1vr1bVkKzbdxe+GPczSI66Z4S04Dn+ChhfGjGOkjNmt5BIcBd/t81tBhok0Al13455gPj4pEsmQtIy3kdJRbZ1whojQQqRnBlPxBgt8FhBO0tdfysGA4dNhHNcYOAXC9VeYXEhQ== 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=z9E0RklIgoLnFku1YFWklEley2VgMWTR1w8x9rsugIE=; b=Fcl+56xcDaGTEHUXLAAWkM27qiREAmpeGFt8vHkN3J8L81hWFdgeSKXLPzhAl40BKrlchH3Ob2yeMY9ZCFBrmmg8aPLisOY6/5z8VzWMz8kQEVOESNpqf9AKBPQ9YvQdDaHmAKQklf1iDPCNUpRq40tVvXMX6XF/9Prqhuv4qcM= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by PH0PR10MB6959.namprd10.prod.outlook.com (2603:10b6:510:28f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Wed, 18 Dec 2024 02:14:27 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:27 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 08/18] xfs: don't walk off the end of a directory data block Date: Tue, 17 Dec 2024 18:14:01 -0800 Message-Id: <20241218021411.42144-9-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR11CA0038.namprd11.prod.outlook.com (2603:10b6:a03:80::15) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|PH0PR10MB6959:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c8b2476-e4a1-4301-fd31-08dd1f09b2f9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: LA8DwB8uey2HA+LkrPmEaSYKypMQzN8vnDcbDhr0fnQ1T03+/HOXMsayabbRFI06kgd1IQ0tiV/bNm9Y4Mfnec48AY8IWDGXlcxb8VpJp1T5Fe5IRhAiQFjQSybrflARV51SqcliA8D2o3CaY+1cc/Sp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TIrQIxWPdGUHzCtC+uHBAVdidqnmUevJ3TdABOVQmO6M+PfosnWc3uqKKEu+g/Td21VyOIZjqhQy3h4CTRHVoCY62srkXk454WVnzQSFbjjLb0XIBhhCvXHDOen1YOiWtFwj/J0ylB7fZJX9TMiEbqCKjvKKHnIjsSYMPyejNsLWKvVvwvqY X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: I1wKZzBgBLgkWT4yRE5Er9levogpAQqWcKqFC79AVCNcQem7U5WvN2eThrr935JYXoFB4Rs7CdYNS3ifJEq+ic8EzYQE9pbj67uVUeomNqesg9POvSPDmVuxl/O6bn9Vw4+4z+k8bJJTrKeoPoCoNVXfKyHoC/KffFB37ahdzC2Y1cum2zJFDXexXzvivFUVi6opGGew5XH4X1MG6nYRERCFFBLpTpwmTexDmSCPvDJynxeOGz+eo386yxLMiaQ9wAFr0ny3dzNym5jyaZTj/0NqGnfqkzPBFFTtmtfPT80dDZ2QQSPUaqGFx2ji4Yc9HEfqn0s1gHgQsi6OKKGhAOxWETTS7RnVTICtAeM72bFVrR5iETmRvjPoAoc/lrvpP6/1eDlELhTd8QElyVPFl2mSpUplf6Zadnk2IfBTzY3bsWzxx7C5GcngPUquuRZJjkG6tqiQEfOfe4vzmLEyBixziKaEN8U1NsMfedKbD+5PvsXKjfSycOnDWNA5YAjws3W3yJ+FgcwJRaBAJwPiSIeEWvs0X7uSsJ3uV5l0AaxV61jHDcHWUfWQJBAJwV8OBOTqfPTCmeJ01kePvwK589xuZLuyA1Y4rdPmpw15mPglXoHFvBQQB1NIGnH3gOeeGRSjdTaxAWCchDvzvFjnTX1esJsvQLURrwoZ/Wej5+Eboxkd5IxONmv+mhd6/7l8XVp1fehzs6aCLD8Y4zvzw1/YeUE88MEDzMBEIt5RrWwvfRbCkKoqqnYqte18WX0C7wOEpWl9mU+3KaIznRotDpMh91NKupGkjVH6I2JCY23Z4XEEqy4GfRtb820AJhFQAQfXCJwCyGzoSGwa2RDIW8hlC9msZi5x9JH9t9mxGig+lKaoQ6+tPzOzTljcq9vUp2bAWFM5VSq4A3ab0jzxVzs0QByL0m9Nabl/wHb5tAwwB67KxKOTR6TMj6pGQ0fUyLgxVicRFFHviawn8XbzgaFDK36obEfajoHor5ofvee3oEh1ltDElB1JPNA3XoFdlbBBOBfcm3McRENJjo3eAfmvIaDKWIB/CeCnPTH+fILMpH0vmcsyzRpuyRBndtnvQPm9Jv44TH6UHQXsPtnmEGXAn62UV0lZs2yZwJTDsingdvjJJptxx9fWjl7KPoGEjBUF/DSP1rl92uTVzxbJoDa0j72O4YFPdceuDlIrEUB5JiAkDrWE4Oya6KTUNXr9XatwsNks0W7BZUCjoSkDYlHE2geg3qvogVpWfWiOUj3nUKEv1ByDKeugkLjUv+CXQkvwPzApO8MXda5JORkTh3ja0etWrsk8O7LmA68O6Dlnsowqjzjghj23u2FmiY4mP4ksNnoWdVXquQCvmQvdg+Qbg0AdCuCkRmT0NQDBXjQhrAZKteAAuEvi+rlWlXWUFbLsb/Myv4ALNNwS4u8fjOMXP8q94asv4MfoxGsJo9x7//A+rQzXembX04TNjeZ89n/0X4QLkEoB3ZZxzjU9XCjqLwh9kfi9yC7SZWhehAAHsgHeTLA8uuvZjEvBTO3dl4ikbCNXwPYyWBrDzshDTan/zLp43qYRr4ZZQQisCq900yj6cUF5ga1hr31ePJZoZSlQ3ZDxoNO+sw46LA2KwOc+2gMrG0vcPtC5hcugQiqwb9For1xdpMSgqCGlZrQZJf39K/IzM7yIRWbbv8sqhQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: JldzHt3DR/aSFmPZ+bGivy7aSV/jaoY097ykMJagXihjBCnWJ/gB9m3Dqy1D/RoLOUvTu+tw+Cv2I5pAz3gLNPLzfDvSxu4ZEUNILI1orW4ffJ8HQDDo51VHe2Hc/ZmuX9sULPtY85DNIp4Q/G1BV2xVXTp3ij0Hk4uhUlWzvIw/iIpY1zCpt3OdmkrmPD4QqoWHOy1YXZtae8cbAdasROnpHhxQFVh1lMHvVwsLqOq7ggnI3n6Lp4r5F4QcSlk/L6w43X3uQgFcVJ04vpAG6HgSw8KxhfRQN6Ag96k1SLL0jU+fK15LF0GhU9USCM4OnOqTzUs63sBJuBp5IU3aNK2DMkjyX4ZUlJr1NSnQPiuVlqowQJyS1aabBuxgso3q5JTifClmKyF5nHiTmKBYO/JRrDXbeKAtGN03wmqOXvHw/vQ3ahACX2gpNn9QDjbN08BkdldbJcW+ygYtHnhbt+HavhEs1UdGPr3ULRok36Mho9FszQGV/pPH/xiW+WnjEXaUl27jVMZkymmop7DkoRv6prgOjMLNV1McQ7vDmyzRzb8dKAe4Smc80UVCs9qR9OgFhU3S3xBBcqn1NupB7rwbal7V+IcY0BFu9t60kyE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c8b2476-e4a1-4301-fd31-08dd1f09b2f9 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:27.6114 (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: YOPl+MmAHuDc+Ld8YhTVaIZ0e0Tec5mNyvqzdKXra2ZqP4ez+EprOe+/EYWs6nyD/u3PObvCRbremI0TjcE5U02bQ3ze1KlrCIfW+dMtph0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB6959 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: PvuChrskBWmAy7dgVRKY9py2S4WOt_n1 X-Proofpoint-ORIG-GUID: PvuChrskBWmAy7dgVRKY9py2S4WOt_n1 From: lei lu commit 0c7fcdb6d06cdf8b19b57c17605215b06afa864a upstream. This adds sanity checks for xfs_dir2_data_unused and xfs_dir2_data_entry to make sure don't stray beyond valid memory region. Before patching, the loop simply checks that the start offset of the dup and dep is within the range. So in a crafted image, if last entry is xfs_dir2_data_unused, we can change dup->length to dup->length-1 and leave 1 byte of space. In the next traversal, this space will be considered as dup or dep. We may encounter an out of bound read when accessing the fixed members. In the patch, we make sure that the remaining bytes large enough to hold an unused entry before accessing xfs_dir2_data_unused and xfs_dir2_data_unused is XFS_DIR2_DATA_ALIGN byte aligned. We also make sure that the remaining bytes large enough to hold a dirent with a single-byte name before accessing xfs_dir2_data_entry. Signed-off-by: lei lu Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang --- fs/xfs/libxfs/xfs_dir2_data.c | 31 ++++++++++++++++++++++++++----- fs/xfs/libxfs/xfs_dir2_priv.h | 7 +++++++ 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/fs/xfs/libxfs/xfs_dir2_data.c b/fs/xfs/libxfs/xfs_dir2_data.c index dbcf58979a59..e1d5da6d8d4a 100644 --- a/fs/xfs/libxfs/xfs_dir2_data.c +++ b/fs/xfs/libxfs/xfs_dir2_data.c @@ -177,6 +177,14 @@ __xfs_dir3_data_check( while (offset < end) { struct xfs_dir2_data_unused *dup = bp->b_addr + offset; struct xfs_dir2_data_entry *dep = bp->b_addr + offset; + unsigned int reclen; + + /* + * Are the remaining bytes large enough to hold an + * unused entry? + */ + if (offset > end - xfs_dir2_data_unusedsize(1)) + return __this_address; /* * If it's unused, look for the space in the bestfree table. @@ -186,9 +194,13 @@ __xfs_dir3_data_check( if (be16_to_cpu(dup->freetag) == XFS_DIR2_DATA_FREE_TAG) { xfs_failaddr_t fa; + reclen = xfs_dir2_data_unusedsize( + be16_to_cpu(dup->length)); if (lastfree != 0) return __this_address; - if (offset + be16_to_cpu(dup->length) > end) + if (be16_to_cpu(dup->length) != reclen) + return __this_address; + if (offset + reclen > end) return __this_address; if (be16_to_cpu(*xfs_dir2_data_unused_tag_p(dup)) != offset) @@ -206,10 +218,18 @@ __xfs_dir3_data_check( be16_to_cpu(bf[2].length)) return __this_address; } - offset += be16_to_cpu(dup->length); + offset += reclen; lastfree = 1; continue; } + + /* + * This is not an unused entry. Are the remaining bytes + * large enough for a dirent with a single-byte name? + */ + if (offset > end - xfs_dir2_data_entsize(mp, 1)) + return __this_address; + /* * It's a real entry. Validate the fields. * If this is a block directory then make sure it's @@ -218,9 +238,10 @@ __xfs_dir3_data_check( */ if (dep->namelen == 0) return __this_address; - if (!xfs_verify_dir_ino(mp, be64_to_cpu(dep->inumber))) + reclen = xfs_dir2_data_entsize(mp, dep->namelen); + if (offset + reclen > end) return __this_address; - if (offset + xfs_dir2_data_entsize(mp, dep->namelen) > end) + if (!xfs_verify_dir_ino(mp, be64_to_cpu(dep->inumber))) return __this_address; if (be16_to_cpu(*xfs_dir2_data_entry_tag_p(mp, dep)) != offset) return __this_address; @@ -244,7 +265,7 @@ __xfs_dir3_data_check( if (i >= be32_to_cpu(btp->count)) return __this_address; } - offset += xfs_dir2_data_entsize(mp, dep->namelen); + offset += reclen; } /* * Need to have seen all the entries and all the bestfree slots. diff --git a/fs/xfs/libxfs/xfs_dir2_priv.h b/fs/xfs/libxfs/xfs_dir2_priv.h index 7404a9ff1a92..9046d08554e9 100644 --- a/fs/xfs/libxfs/xfs_dir2_priv.h +++ b/fs/xfs/libxfs/xfs_dir2_priv.h @@ -187,6 +187,13 @@ void xfs_dir2_sf_put_ftype(struct xfs_mount *mp, extern int xfs_readdir(struct xfs_trans *tp, struct xfs_inode *dp, struct dir_context *ctx, size_t bufsize); +static inline unsigned int +xfs_dir2_data_unusedsize( + unsigned int len) +{ + return round_up(len, XFS_DIR2_DATA_ALIGN); +} + static inline unsigned int xfs_dir2_data_entsize( struct xfs_mount *mp, From patchwork Wed Dec 18 02:14:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912905 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71C557083A for ; Wed, 18 Dec 2024 02:14:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488075; cv=fail; b=YUpAlZerzpOuEVv6vXes6zf3e08yOuq4SQ0+MVhw5X1ZA0Qw0Sram9G67lxJSBtpISYTGyPF2afAt++UrIIMhTzI2HAzTR2n2/prQGyPBMJfIZrijgvpS4v/CXNglTnPapjOfoZ956rY4mUiUPH1q2RsAwG3xAVdJaUPInY5t6A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488075; c=relaxed/simple; bh=ekeIErxRU2yYxwP5+JKtEz48TcXsQ4WD+LGplPm6V6I=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=QdwsvR7AiM+tG1geulwG0148+JGnhDaeeDnaBHvN89bijDubV/oYt/wNNFBB6/PMyPYW46Nb45qeKgkxLHw4PZVe0qGnw7XtDnkWNBcqP4UvcUXpCp+hAmIpeTBGLZ37jjKX05L6NhELdv5GIgGK+HHBxqBvgscXJjxwDxdqUSs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=ceTSpo5O; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Zig7L2gI; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="ceTSpo5O"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Zig7L2gI" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2BrFB006233 for ; Wed, 18 Dec 2024 02:14:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=t4Lqngq74UPI3uAHgeSo1LKgIBbZXDVIghmlhCliS0w=; b= ceTSpo5OMB+RhXWhEwNWNXhKa5DR9Qy2UXGUl9YjUkTlUSDWm2ScfP/W2ZwHo2C2 2nbi/YUs/2PsHwFD0J8mivnZE1wc3nW9CZ3T/PzX8CvBr3FXG+IscCmZ7cmq/WUf 6pyPBEfL2Y+H4HR5KrlJ7kCQTKki2tCJK4FNp/nn3/aiHGjUA6BC6s4I/brSXBlO J2oGo95SSP5+ZAH0lGSDVXUq8WGQyxnr9B+tr80j3HOUPwkTnHUqHC89NUdaTI1e wg7PP47b6A4xsIKKclgETxvYgiDfxgfJD6bygpYo0Z9omuuitBGgKjhplhPKx0GU +c+bKmUtVDR6LMPdujdhhg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0m07nta-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:32 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI1V0UU018231 for ; Wed, 18 Dec 2024 02:14:31 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f9fbvr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ge9am21DNZ0vrILEFCRrT6Rh9HP5ILqr3O7xcozrdEDdKiKqAhXf6s+/mi5j4+jhGheKw+s472telsGBleOKyujpCPvQHoCWj3qhXkq/f8di/sZwuHjqMkCf6zsNbsyS98qWCWWfvjux47UvQDYEem2SVWNP0hEUc8eMZdXAjcBIAhzYBipt0ps1V4graenVQIq3ZuadBeu+ouljz6EaevwgAJOeoM1FpFRgOUbBaWwMfuOniwa7N+boEp+JyhS76RT7fLhRH7FtfIA7HHKMMM8IlpwFVEI106g86yMq2ZuEDF9+3/1jzdVSFkhSM3+hpzR2S9LJ6IxaFNd0KKQcJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=t4Lqngq74UPI3uAHgeSo1LKgIBbZXDVIghmlhCliS0w=; b=O2srfLFu7sKClzg+9uU5CLxRobu3EKByfPccN+Rqwsxm/u6D80o+4rFbXzdfveHhDlctZjygjFpM+3bG5HnWQntPPQv5e5sBrRvHfZBoVNvtyRDCZapCy2D8MBazasTUaj3Fn30DsXdbisEAT0NYsb30gm7RWRN58lk3ZmOdqFFGoQRH7nycbjrwzWiLL/40j4AKkoSx4qSSHUuMtErZvZh9x1p/3x385HJWhS7FqxWjw9DQXA7wE0wPZfHQWw0Xj7ObkaMpDrl2PwZthzE1dTGPgS3OktLiuEfMLLkfeAMLhbVGA7e3pVZY5nqGoMsspJuC5X78du3SG7hLFb4uiw== 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=t4Lqngq74UPI3uAHgeSo1LKgIBbZXDVIghmlhCliS0w=; b=Zig7L2gINzitzMdAblKROPF5ggK/YwEWC2rXsaPbX0Q9DmZvrdz1Ab6Whqa3UELZiy/YJvKO/fOELGjUlmM03EFN0OinD/IeiQ7Mo6gmvA1Jmb2sxYCV6hf4ZgNnXboF6iO6VEEBrUbuMROLIDaTT1YyEXqHAg/rDh0jNbpSS60= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by PH0PR10MB6959.namprd10.prod.outlook.com (2603:10b6:510:28f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Wed, 18 Dec 2024 02:14:29 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:29 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 09/18] xfs: convert comma to semicolon Date: Tue, 17 Dec 2024 18:14:02 -0800 Message-Id: <20241218021411.42144-10-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BY5PR16CA0006.namprd16.prod.outlook.com (2603:10b6:a03:1a0::19) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|PH0PR10MB6959:EE_ X-MS-Office365-Filtering-Correlation-Id: 99ad9623-ba87-4f17-dc60-08dd1f09b429 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: TE+9P+vs+GhDapZEwBVJIPlkoZLnJg72WlgoHU5fGhSPTCe2wzA+xIV0dD7Dr4V3Bj4SEZtF6aJUGeuunqCzuZJ2JyWAGm6FGjoAjhsmX4CDyoByfI0psIW/pzpy3+CgLr/4BFS4ws224V1Bg5v3kviegZDRzB5eS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yRGT0oXfmQFB7/9s/ly9nhQh4XAdbZFQBXZP1vpt4fdiIb7susz5v3msMR6nEsX6DVd+eqCtmadMha+R2+gvhXdXQ2yRoHhpYwcLpFO+kr4jWC+6I2nJsHVfQkrhFx+ATATw3BpA4cXgfOqTAVRE47Xf1n7jgqPe X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2HVEie/vlwLhdORTc5ZNqZHoqwduxqOwocuHFpIxaDqHUMt81Bh2or6xTooi3ND76lcEEf1iOpXv6rfr33WfKdfqjnp8Tzj+AwqU0svpTbCbS0WOf+1TucHBiWDMhR8s0fcb+U0/k9obHloL71gM20s8ZHpnoOi40BRJkiUYi+NudS3z3gsmrJpUOk7jddXV1rupRkAMKQsiwwhrKOoWRyQoh7GGZ3dRIXGOr4Qqf8Ai5i2M1DJAC5fY6f2VCHKNL7cacTeHVqXBJO/3/O3ri1l1WKRrGK9eayBDitBllEj9bLxHsJMt7M6dUw8EXTKpHAO0ui1TFoMjkbjsmoHdX1luFkRst/KxRO9PPXx4DyDoURR6tgQ/ZOJX1TfmfaJef/TzdLrO9SoNwYkQt5BvQNqAqjMbhcENdlymdt+Cpda/Fbku5JJ144EmABI01Upba6opT+sRhOPaQk+BpcCxq+lf0Xx1zjihoL40g8ojynTDted64WOza+PRdJWOjG2DTpKhhO/zt1HITME1paLWo4lVmVuA6+74E9tbeCjcu3EEl2K67hZaAT3gKY52kYAy5IVtTFEXGp4ccTGvFNfZMvaRtqwvNmVYaTqMG9VY3Mr6y0CMdhbKKoHmMlDKguzktqPWzD8Ogs/bV0KRltMh8F3/XFpXRsXcp3c++bI4r6UtV1qLX4Odr7DhzA4P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pAvw+f8kUPY2mQG4GmUbnBUO0clOoy7Kt5KZNgLhObC1+cnTf2QDY39pqorDLRj7PK81izP5uM+/lIBVYStbsrq/D8W/7e6y9I9HetzZXKWoVeVAjkfYCJplm8FHZKK/tu27yuSpAAx6d3UT2SQ4IGdbizcKviNsWnf0CwkpppBbCP+Wpyd2ryErP0oR6Y3zG6+BnR+DICJmvdniU8ZL3N+BF3/HPtNFTpYjMpR4egjV3Ni/k+B5hLM9/8nmTbp/75sbk4Dym6CVQgc03X4efQxc3llkZYy3rfNu5sPwyzyWN8G6dj/TAWPky9zDY53Oym2xT01D3jozHAr831lZ3KeaPBxcvFJAikd/Fpg0caaeKtvu4n6443S2u9x+Iqjq69kNPMJVwi1HOrxcvlbrQb/pE+fD2eHlUbVwrQANPRbNQnK7l/ZqIhuhN0cfMmzrnTrDzPTr9iemtc7DyUBSA5ogqUEN2smX6TvCNw2lbDxZGBCFv3jNqfjBmlQLDPJvIUnyn7pAw7OLsM4Aniol/0pOOZ5SVpMzYUhGau1LScoUjlieWf/z39Rjt+XqNaUPleQMsOVEfI344bhUf0LM21wbX6pogtoc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99ad9623-ba87-4f17-dc60-08dd1f09b429 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:29.5015 (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: KT7Djg0Ib5R/pM7x/y4Ri/YsU16nosBD4mVeMUOI/f0pTuyaLNBMIoPcQWxZ0w9ewIdtI6m5IPnec+0VgyuB/97hvN/Ek1iEnkhlKYSKl9s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB6959 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 suspectscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: CQg8FzQ6DaEwUlHubdUzu1KMAoT_Hd1m X-Proofpoint-ORIG-GUID: CQg8FzQ6DaEwUlHubdUzu1KMAoT_Hd1m From: Chen Ni commit 7bf888fa26e8f22bed4bc3965ab2a2953104ff96 upstream. Replace a comma between expression statements by a semicolon. Fixes: 178b48d588ea ("xfs: remove the for_each_xbitmap_ helpers") Signed-off-by: Chen Ni Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang --- fs/xfs/scrub/agheader_repair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c index 876a2f41b063..058b6c305224 100644 --- a/fs/xfs/scrub/agheader_repair.c +++ b/fs/xfs/scrub/agheader_repair.c @@ -705,7 +705,7 @@ xrep_agfl_init_header( * step. */ xagb_bitmap_init(&af.used_extents); - af.agfl_bno = xfs_buf_to_agfl_bno(agfl_bp), + af.agfl_bno = xfs_buf_to_agfl_bno(agfl_bp); xagb_bitmap_walk(agfl_extents, xrep_agfl_fill, &af); error = xagb_bitmap_disunion(agfl_extents, &af.used_extents); if (error) From patchwork Wed Dec 18 02:14:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912906 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3EBF70831 for ; Wed, 18 Dec 2024 02:14:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488076; cv=fail; b=R8BBdOrPgP4/NJ+fqaudumKfkFBajzFVN4JmSh/ss6wtNXlGaltiH+13cvKHFuifBOXNjNJGXg/hqewYoQRrzeWNvtbOjuujfTGm3MCxXoHh6++OViR/HKeTpMnTX9oPuPNqyZ5FdFtMWide5UK3rKNZtNV900rL8gUi9L/kCyE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488076; c=relaxed/simple; bh=f5lO/gzx5ahHU+v2tKcHSad2Ini8q+MpqAZnzL+0o0Q=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=YXxvORMxaNtlnEYdjpTq+EzU8wCJLdGlsJYumoC7yjRId/hCpLabtBX7mgYxERfTVjaJ0FkwW2pu7l1rVF0JqhIdajARSoOs4v92uHjYTgyu7aHn9278NEGsAaOGUBQfuJSKrL+yRsuvXYZ5IX+4FoKiECMbu3EltWoKfGU9ZtU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=bCUxKr3X; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=ltwkVxYh; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="bCUxKr3X"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="ltwkVxYh" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2Bpww029194 for ; Wed, 18 Dec 2024 02:14:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=9LzWIJD6xO5Rd8t3hneBUiLT7lKdVcuJ5gsQawa9XYM=; b= bCUxKr3X0LmFOLi0YhU0/qatL0dvfTEB/vBLeh3OsUUBNk+scTUry4HqXOfUoa0r sdUAJSnYwaMLRSJwt6T/ChYqgzWknMFt8dNotYXhpUIPOOi1O1koz+1F2ZJBHMoE r/f63pEd2RPbm02mCOSJggePYOnn9fvflVIHFJ0XJAvKtuktVHSsb2VfXUn4aIEf rl/9HgEH0mlRG03l4LhOFl19qsZFos3maurUNljd9CqQin7tifTto/VmIROYFFAS MCoa5w/wJOjTXe3OyvjzKm+nMCtFVS3gj4eSO3UyxadlOGYjg6SQoBpC9+RofS+J gW3JAUwtZR/ydHgqxJhkiw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0t2fgc2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:33 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI0ZIA6035493 for ; Wed, 18 Dec 2024 02:14:33 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f97yf7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gJXo/BtsgClE1xjrHJomvHQRDRA4mSHoaE2K2I18wkZLN9Q3stzI+WCJMnE4GOFD1nAG5SUdGjKuDGXf9R/noF8fPsk4r9KaSHw8vqTdyS3eKxU2X2KEF6/OmZGJ1jaqetWzRTGy8aFyEFLHATb8zZJm0/OJ7RhyUXafSRFmVQWQHy4pPMNKXSKOPhqVML2Zc5XoCFWjSwFP7kvWzgjKf7HgLR/lBKIeF7HO39SHOhSr8NuEDrNCX15ymQTcJq2bGll5Aq62lbQ1AspbIdyYjBg1nwnscSE3lsgSfdN9/iypCq5MsEuQBhKfShqEK4Ma6d33FTt45RBedHjwJ8tOZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=9LzWIJD6xO5Rd8t3hneBUiLT7lKdVcuJ5gsQawa9XYM=; b=MpNrDFbggk29sr/a3uq9Ocxu9/WT8BEjVw0/B0h5Z93I6ULEoCXx02/zCLLM1b/8zPmEj1/PXJ0FCiLr7x6vQwJtBWV0jpbrg1mMBGqS6j6Fg9cPQ4ywAqD4Po2W5KpZ5JA9rkO24J+uFWcO+wHMzQLWZmQl3wLqrBwwgmD+5P3wlttFTIDYscf2AH/USYZiEatSmvTD7+qHTzcNi7lM35b8NKS+tU1pEdom4bnPNw5DxyQxF6ljJ2+CR+HCyZ+Y1EaNEZkC1Y9MsZs00sPBlUBcfBDJrvHxf+HQQltN53dVK4MW1x9/Z7sRzYJS+HgqJOymgoENSXmCuloKqbjaUw== 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=9LzWIJD6xO5Rd8t3hneBUiLT7lKdVcuJ5gsQawa9XYM=; b=ltwkVxYhNfXf6sK3+KK0NOqchYZ8DKRhWu8ETtaDS9wCe7ddw0KezVWjsX9gwSk4+nZY3ESYh3NGlSZbGzXZa2rb/N5dh8GvNTTDpDSgx7Hj2xwq7MceSv6mTL2VYbLUuwvc2G2yHXZFAOpZtsd+r+hHeakigiD+35y5m+kEk44= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by PH0PR10MB6959.namprd10.prod.outlook.com (2603:10b6:510:28f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Wed, 18 Dec 2024 02:14:31 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:31 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 10/18] xfs: fix file_path handling in tracepoints Date: Tue, 17 Dec 2024 18:14:03 -0800 Message-Id: <20241218021411.42144-11-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: SJ0PR05CA0197.namprd05.prod.outlook.com (2603:10b6:a03:330::22) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|PH0PR10MB6959:EE_ X-MS-Office365-Filtering-Correlation-Id: 84957454-449a-4881-ad95-08dd1f09b52d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: 2IQGXONRpEDTqMcI2JB4KNTYa5qnI227WKsqwzuBqHCUV/0KjO3nejw7+KVSohh8HM/B57h8mjvgtULxLmqFWqEm/Jn7PJBWxvDNcoqcxzFe4dgY7AhUcS+TJH+Sc1QTGX48so8LahSF2RE7jsxVoDdDSkvxRIWqyis9TV5ctbTN/3RS6wkDkWF6YB6pmnwcKuai1LEYX1ZLVaxUnSeKI3XYUTB5foYmLBmBUiEixbwXxlKFFnDv9DuoG2xhi2AqEs5s/2oAkLU/L2y7xGS7+fw6kXqtY7Ivtn99Srly23z+tB9hLDDye26om7TZrJSUuf2H8zt4/KdbqQg75Q6XoviME0LYfXLMY8GNOQ5RMT0ryfUq3vkWd6h3QeEqPedgQtiGMYFV3E6k+3We+b78D8B+qITUWT2/38S4W1PHeKwmzU+nSxA2XJQsuZobRuxH+V/WBysbJWcPEemM94y+SXFXaaNUH92X8tRaAJ62EdfzyyxE47syo2r5bvc5UBZ+T6lsog/99iovnINeHtbp+0I/j+OAsQstOGA/YX9WHC0MM7HqYeqbovo+KEEzsxMs77PiivIxm/0XSWaACvTlSKATKUArvI5FDFSD3/9J5lnV30podgYW6MR3403thbaoYePzYXOyazWaWPSVYLkvz+/K+AJGBcNCXkilj/gYmMMj/+LF2Mb/MlgoD8DhZ5YWOA7TQ/idCQQA/PWz/h4SC4KDrwTt+HkJ37RSqNGdO8JLvrXM2D61lTOtuR8ww8H2IuVFYYud5Mopmd4J5FJgbOiaPn9A/LJGNClTcstF/vNnDI9quS3EoPVgOe97QqSHYLXDY1QjgG8evsj7ej2LQh9YQALYP/6d3fSY3Tc7DMjbbtH3koYNB3s60Rym+2t6lfdR/46X+bVH60SG4+MX3z1a0UO43kRzhPG1tYSVZk6l+5Y42LytZw9hPRsf5TfxXfHiwALG6PCd3KI/tY/xHWaJlUHy0N0+peXMfwVfeX7/uj1qFWv3wq/t/T7QwNxunAu0rpFjdztvVhfEEPNYF2/mseNE2xj/IURpxyBw+KY8kaaa2p6EAzfH29RWLm+JUBfK8XuOUUQrhqIteMwWdGCBLowGqDG0jLQi2DjpfpvvIzuDWzgwm/rlj2Rr2eBSKwfHo7vxLHGlymJDnHFytYDaW+mGhT0KohNk5CMyjiQE2qbOqT6cwVuEOeOFzVHxbwTlUVk2BUPXEM7FQLsj8A91zzjpvmdL2CMOwoW1CXjzSVi5jPNGPaVBD4yRKtTVYa1PWsYRTQHH6/DhOMw1SGXir6lFnSWgs8hWxBRTmdCG46H/Md4hZCLsK7ORiusyAM6FaAkhihXPk1CFgxBi6QY/CHqOmbP9K7ANROVun7k0pyght+MbyUhT/gQvZMV8 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XrXyBcDzJHWVSLbBxAkeV7NUFMYHGdFWEvs21rkMhO1a4YY9pSia1V2DyFick0dfIhvC6C1N8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EAsSS40ar4ITNxzEUhzzbhFtbMKSq4p4WMxm2iS98ElUzHzhTRdZRXSPkjZzrPo+ba3w6yWTXPJ5t4ohfw3Z6TFidD5LK08UifT9Psv15jx+xSN3MsMzW8dDMvVOm8DTn+SpTGS3Hli3yPv3q8yCJP8c0qxc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84957454-449a-4881-ad95-08dd1f09b52d X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:31.2905 (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: IjRFXeCl7YqVJdkeHViNz1VzQhfDZC9FKgQqWVU+zhYKcC8oTBiDXbUwGxfiYpYp1r6SFlmfhv9FTYliiXJFrtjbDMQ8QQ5mGTf0XAhxMUE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB6959 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 spamscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-ORIG-GUID: TOdMbRG1fo5GgTjDRjGtpFYHPqYyY6a0 X-Proofpoint-GUID: TOdMbRG1fo5GgTjDRjGtpFYHPqYyY6a0 From: "Darrick J. Wong" commit 19ebc8f84ea12e18dd6c8d3ecaf87bcf4666eee1 upstream. [backport: only apply fix for 3934e8ebb7cc6] Since file_path() takes the output buffer as one of its arguments, we might as well have it format directly into the tracepoint's char array instead of wasting stack space. Fixes: 3934e8ebb7cc6 ("xfs: create a big array data structure") Fixes: 5076a6040ca16 ("xfs: support in-memory buffer cache targets") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202403290419.HPcyvqZu-lkp@intel.com/ Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang --- fs/xfs/scrub/trace.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h index df49ca2e8c23..0497a2d681e5 100644 --- a/fs/xfs/scrub/trace.h +++ b/fs/xfs/scrub/trace.h @@ -784,18 +784,16 @@ TRACE_EVENT(xfile_create, TP_STRUCT__entry( __field(dev_t, dev) __field(unsigned long, ino) - __array(char, pathname, 256) + __array(char, pathname, MAXNAMELEN) ), TP_fast_assign( - char pathname[257]; char *path; __entry->ino = file_inode(xf->file)->i_ino; - memset(pathname, 0, sizeof(pathname)); - path = file_path(xf->file, pathname, sizeof(pathname) - 1); + path = file_path(xf->file, __entry->pathname, MAXNAMELEN); if (IS_ERR(path)) - path = "(unknown)"; - strncpy(__entry->pathname, path, sizeof(__entry->pathname)); + strncpy(__entry->pathname, "(unknown)", + sizeof(__entry->pathname)); ), TP_printk("xfino 0x%lx path '%s'", __entry->ino, From patchwork Wed Dec 18 02:14:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912907 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3CFB80034 for ; Wed, 18 Dec 2024 02:14:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488078; cv=fail; b=QEQ6OogcwjB8/GR1ESofVe/BtV7hLp+wW/1WziVlDzgmZebeNw75LicUTl045pS2vqPL9Hyg4hsJ4yfYBEtGCEpdwpiTOKOjnQNV9dINA/0cN91xEivl8069tO9TaJ6gBxTdxndfHwwG3jnklk8VC0jANZWdluQVNiCQL/K0YaU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488078; c=relaxed/simple; bh=AT/Q4DM0EW6mC3CtOocHwtIPbTYcOy/jkrh4HNRv8GE=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=jBZdBFDO1Doqbb+3NyXcj01MiFKJIAxTKXrpUJ8ACbEYjCXqQOF/qiM7PGTO9gBfV9QycZKY2YSV2T5OZYBSQLbDY3h8t+HHIjGd2+cFt8Mnyug2qBT/6pwwxFRAJJeinGa9dnR84lPJbAgmnr5kXuLGC8KSUGaSl1aCey0Pj3U= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=m9A+EMf2; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=T4eh5f97; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="m9A+EMf2"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="T4eh5f97" Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2BqAt016223 for ; Wed, 18 Dec 2024 02:14:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=waOc3kf12XCaUTAgX4FkTdZrBlwkunwn2NQBvP3aFtc=; b= m9A+EMf20O5Q8axD1nSGCwnq5VyorYBZc/TWlBViKGuwpvdQvjrpdnou8UyLFgfK FU3y0fP6stKl9WOlCYh+V2Mrb6Ag19nqpbpgaB3/x5cJNs/6PDWe91+l1CKZLFhN iC7Q1TvKQ7fptTy5dc6ngRI6xe7F0eqGbxP9ZQGsvtO+43gT2X1y+A1LBpm6i2VZ UmzXS3EAHvAOPshEZedgn8dK8opVXrmIMAOI+1NX+DzpIKGRM7klllRlvLg7rgBA 63k/Wwtdy83Kniuk/VtNgu7Vx4d632sspY30VeVQLkojhcj46UW0Ot60ZQx7vqH5 x5xeVghZiw6n8P6I3XcpnQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h22cqhdv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:35 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI1hjfO032631 for ; Wed, 18 Dec 2024 02:14:35 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2174.outbound.protection.outlook.com [104.47.55.174]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fffbfc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QOzxbCICmaRrRt9C4NksHA1xcm70sVIaJyz43AZ3CMqz8jNcXW+5EoQre9e9otPIGUF/U8t+mnlRK1PXXLJSQwibhN+ASJ7oRrw04ohB2vaNX0xLKvX1Wnn9lHSDTJs5nnEKaZxj+7NkBVBxtp9U9D1BS17lJwbbSRfXP9hpTN/g9VS95hBEpGM+O1A98FHf6tP0XyuhNbgyAKEkRFClFZejb4zNdocFxLMt+s7yta2/48o9GGI48V/Ix3vMIXJIJh03fSYtuLzUofbUUEnXc23JieZbxnJeBQKfGOTgDh0nRX7nvGWcRpnIUgVKCbYzmcC5JfjQDt6BoEVIwW7cng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=waOc3kf12XCaUTAgX4FkTdZrBlwkunwn2NQBvP3aFtc=; b=iQjuWhSTP+ypePuUUMJw6xRUjCmF5HpLVwyMov9XMrYd+cGmScC7ruwZICFbHTUVQVf9pDYhAf7kWTMkp04Gcf29ShPssxMZeaY7eD2dCH/HF7+PiFaX98TikkA6PHdKYeW6iU40p6J7WIUBaRwy0f4VFlndGMxq33/iopP1vSHNCoiLr7wF/Xhml8DG3z7zLPbtPV9lBZiAiQDkusGbCOi8o420iVYSymkMNcjxWklsccjfsfcM2S3iG2G9+fmIjlkhXTtD9C3RGdlRKNBkoIt5KkPdfLlvRsIAyjnLwVK/3wQdrB2pXSH+tPShYfgKeJSvAoR0akY5jz+E/3ohcw== 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=waOc3kf12XCaUTAgX4FkTdZrBlwkunwn2NQBvP3aFtc=; b=T4eh5f97qjzo4mqfxTxW4RIqZfrTO9oA0G07DlCqecBlhA/+Wk3wnwiR+HdYDSKrGud4uNaoVzrXsTytv+KGlbUoUrJeAA6WE1y97q5tkBkgDQ8N9PnxAPIoBeig3Ealhxkosj4WHm11VX7zhELbHlHwXU/Vz+Au21mcsBpTLWs= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by PH0PR10MB6959.namprd10.prod.outlook.com (2603:10b6:510:28f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Wed, 18 Dec 2024 02:14:33 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:33 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 11/18] xfs: remove unused parameter in macro XFS_DQUOT_LOGRES Date: Tue, 17 Dec 2024 18:14:04 -0800 Message-Id: <20241218021411.42144-12-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: SJ0PR05CA0198.namprd05.prod.outlook.com (2603:10b6:a03:330::23) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|PH0PR10MB6959:EE_ X-MS-Office365-Filtering-Correlation-Id: f8446f16-3f8a-4aee-2fbc-08dd1f09b66b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: yF4VOVVdn7Uh3gpsAH/MoPzzGki6LcOqulAmDiRBo+liOiUT6/xU63NcX5s//RXDWgWsjAkTmN4Phn3MR6SX/9ryZ0SYZOWGp8ltPdHOGhZVDm34EpEnavE3owEasarrwUglSqnklrV+XOhH0xTn7+vpih3Bu7HSNcIOy760RlRD+Np1SB+Sz3Ho84/JJly574c8WYcCYB5L19sJouzN2OoAPDlbTQNXxxs9eXfW5Pr8cxP83K1Ym3m5oIg5a3+UXtm/aU0S4lRtOKMS+EhaOTGbuir7tQ6mG8GSJPORVToAf//QdPjBOurnVYcs9EdTKj6nHaEXfj0knpZhveOx9YoQ/MGEstr1TQGvbltjsW7PM7/JumHNC91KQrMJmZYR/9Ujg+d168sdGE4V3nRtpYZaceF+2Hgs7zsALmMScGE+DY0ZZC21pZvMzL8q93Yv6HaaIdtq4o6NF69Wj1JRehfX5doh7f8ihrbtUQfC5tJn/6ITYMiZ4oYtxMjUAJiF1jCR9KKXRETDVmJ54kAZz3ewCcHL8TcRj1g8g24nwStgSBwEBiLaR4FWXyduTAMLcxXoenvmB03RXDLg6mSD53WEuq2/6VX/zEiaikfaws1ximoztPGN1HlYXT+96w1dSkGKtQJMldNZJUscAiRrqlZ/+6pQDEzxe+IEsHBsKP12+ziD2HrGMbwXYLuwDqlGp8QLJAVxD5Lgfxn1P7NmIPhofsMvmJg05eNThTsWXBaoRN44gJE7gu508wYFo+uQ3Lc0xbmxN3lQJCEd9+pNXIzzb3TMtrtfW/6+Ut2JwWScvDU+7Jw2i+eMYi1mwMPQmXmbJTV0YKryh2Ljf8BzfZ/9KuP4Z+scFl81Hobi5eAkAOUgvnPXSX1qz95j+yjW5A4oMDUxAGzRfTe6HM5Av0vDMpAUpMfu/gqlaLx39SXAT0sT2r0MLfG8ClCYwGU7xCCX6LTV6OlXrCXSJ0NqekhCyef5YNpF7RVgYZU/Y2i5FGLspyWGfU+I1EJBTeNkORa3dtEvmrxYQ75WLVSQWoPArgkKxDxEsOxxNQuIZVCuSdq9dVJ7fvr+gpPh8eix0kHyFgOZw6nsJ2V+e2DRhh5rgyJ+787wKGPlNd49ClBpPXals75b5iqTrwHlMafpolWqReeMS+5H2F/PYLbmAs8UW/RWbQ226XPlsS3yUYwLl4KNWg+r0DcJXhNU/TGGkeHSABU/38sc72sbodtJFeD5F3FT73fjifJJafHGdoZM6el3xzlATj3rzKqESlaEBaxK5QOarhvh+7izcF2T/i3ArJAKFpzIUcsZWZAxxgDRIKvGVnytfKHRsmmoFjliu1Y3HeS2mFzlztHGyO5VZIsgXX9cNy/xAhzqWso0cYKAzP/nRGt0laOcYz01mf58 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kXv9Zjcd9bxCyqCzHPomJZCrAw1+EQx9cheuu+Y0tGTnKi+dZjEN+LJVcQWwvyecW22uM0F0rswfWOqdjv2QyJHNUKTIgZdqm55uRsPnUqqpm+h9BWsjsydihMNyMPqmpYjn/rbZJAB2wRGQli17duzhBuPGvGsJZUhex4Y2D548x2KicDpUkyzK95QfrvZXXyjrvanLjIcf2q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xALnBKXeOylCJpc7LoClNP8I4SmocXs+nySR5u/nTLMV949unX4hw7RXmbSdGjz73bVw83Fa3TJa7iPW2aPuvlJqd0jXgzg3dpoT2SWZT40x5oPZ1j07CU5U1DkP85oqHH/KqsSO2tkGwqIWR3czt/t6sajDnKve8+Lnzs23/AjVn71fK1d7QTwvgB1FtOdZ/Zo8OeIEIjpxOXZVdjEai19haqxFcw9n7g11ih7gSALq+KvnG3JgKvZK6I8UtBS8XzN3b+jmaclfsSpQwLw9T2sAXmKl682Z2as9uLAwl+kM/37OYB9PSEmh4SNJNVTO96hamY98INyTtiGlHoRbrONd4NfzgRXXK92LpWfsqJmXfnWjF5u/4p0q9RdIEZLMHC2JfdXdnCpjGmAnbZmw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: wc/8q7GKJiOX3phKNCxvbaLYrcEjwwUlZRp3AUQEG+fq167yr874EW6gqQ61ZMv4CpWM/rkLkOx7upYxUo7lSGLwJKjbXCqWUVsZwAPxmQGIUM/rIJVj2DHMOZiLrzVaYO2womVjfzxNFxCjFSIOpYp+xDARIPNWrtvWawP8SFT6AeG4K+BoAWKsJh3Ds/PlbP+zRMp9XedYQkArXB95yA7KKRba5VJh4Lvp3t8/QwFgzGYx02uxoJtEt6wTMfoYEymZDksn1CZmdBpoDPnp0Rifpnduz56SGY1YJBciHUoZ2F1m0BSwuYcElbfSEEl3GsQpSNICTwRxqLPHg5fYKjCtzeXLG59zFRod2E8NcorI3cILX0Ch/z9GsrRbaB90g/+mQ28ixVto9TWvZ3vyGJJip4XiHlNx3WAH6iUFuUoITsdn1xhPCoLOY08SwFDfDx23utEzsaHoUiPowlQWhl2Ml1lrk6UpTaxkV0dZPJ+6URvsUe7ybp0gWTnUQbhgrItNWsGN38Gm3NDfxFmsXCWmv61t7pLR+BGMl4xihsS+p+ml0CksOOJFYqozfNjqYtLTt9yiX7ueWkPcMgWO81jSYhyRiFaezeX6PMbFWRE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8446f16-3f8a-4aee-2fbc-08dd1f09b66b X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:33.3801 (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: RWOOK/kNyBtXUuui3fGrmGo0KAU8DylbPnEVisddyVTQZLLZZhjBPAc/s+/qSBW7r/COMyeqCXgzKrmBNW2EOkwgH99212k88ViDMXTKOts= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB6959 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: 85HcZoIXMSwuoo-KeYc9kH3_wAqcezlr X-Proofpoint-ORIG-GUID: 85HcZoIXMSwuoo-KeYc9kH3_wAqcezlr From: Julian Sun commit af5d92f2fad818663da2ce073b6fe15b9d56ffdc upstream. In the macro definition of XFS_DQUOT_LOGRES, a parameter is accepted, but it is not used. Hence, it should be removed. This patch has only passed compilation test, but it should be fine. Signed-off-by: Julian Sun Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang --- fs/xfs/libxfs/xfs_quota_defs.h | 2 +- fs/xfs/libxfs/xfs_trans_resv.c | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/fs/xfs/libxfs/xfs_quota_defs.h b/fs/xfs/libxfs/xfs_quota_defs.h index cb035da3f990..fb05f44f6c75 100644 --- a/fs/xfs/libxfs/xfs_quota_defs.h +++ b/fs/xfs/libxfs/xfs_quota_defs.h @@ -56,7 +56,7 @@ typedef uint8_t xfs_dqtype_t; * And, of course, we also need to take into account the dquot log format item * used to describe each dquot. */ -#define XFS_DQUOT_LOGRES(mp) \ +#define XFS_DQUOT_LOGRES \ ((sizeof(struct xfs_dq_logformat) + sizeof(struct xfs_disk_dquot)) * 6) #define XFS_IS_QUOTA_ON(mp) ((mp)->m_qflags & XFS_ALL_QUOTA_ACCT) diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c index 5b2f27cbdb80..1bb2891b26ff 100644 --- a/fs/xfs/libxfs/xfs_trans_resv.c +++ b/fs/xfs/libxfs/xfs_trans_resv.c @@ -334,11 +334,11 @@ xfs_calc_write_reservation( blksz); t1 += adj; t3 += adj; - return XFS_DQUOT_LOGRES(mp) + max3(t1, t2, t3); + return XFS_DQUOT_LOGRES + max3(t1, t2, t3); } t4 = xfs_calc_refcountbt_reservation(mp, 1); - return XFS_DQUOT_LOGRES(mp) + max(t4, max3(t1, t2, t3)); + return XFS_DQUOT_LOGRES + max(t4, max3(t1, t2, t3)); } unsigned int @@ -406,11 +406,11 @@ xfs_calc_itruncate_reservation( xfs_refcountbt_block_count(mp, 4), blksz); - return XFS_DQUOT_LOGRES(mp) + max3(t1, t2, t3); + return XFS_DQUOT_LOGRES + max3(t1, t2, t3); } t4 = xfs_calc_refcountbt_reservation(mp, 2); - return XFS_DQUOT_LOGRES(mp) + max(t4, max3(t1, t2, t3)); + return XFS_DQUOT_LOGRES + max(t4, max3(t1, t2, t3)); } unsigned int @@ -436,7 +436,7 @@ STATIC uint xfs_calc_rename_reservation( struct xfs_mount *mp) { - return XFS_DQUOT_LOGRES(mp) + + return XFS_DQUOT_LOGRES + max((xfs_calc_inode_res(mp, 5) + xfs_calc_buf_res(2 * XFS_DIROP_LOG_COUNT(mp), XFS_FSB_TO_B(mp, 1))), @@ -475,7 +475,7 @@ STATIC uint xfs_calc_link_reservation( struct xfs_mount *mp) { - return XFS_DQUOT_LOGRES(mp) + + return XFS_DQUOT_LOGRES + xfs_calc_iunlink_remove_reservation(mp) + max((xfs_calc_inode_res(mp, 2) + xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp), @@ -513,7 +513,7 @@ STATIC uint xfs_calc_remove_reservation( struct xfs_mount *mp) { - return XFS_DQUOT_LOGRES(mp) + + return XFS_DQUOT_LOGRES + xfs_calc_iunlink_add_reservation(mp) + max((xfs_calc_inode_res(mp, 2) + xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp), @@ -572,7 +572,7 @@ xfs_calc_icreate_resv_alloc( STATIC uint xfs_calc_icreate_reservation(xfs_mount_t *mp) { - return XFS_DQUOT_LOGRES(mp) + + return XFS_DQUOT_LOGRES + max(xfs_calc_icreate_resv_alloc(mp), xfs_calc_create_resv_modify(mp)); } @@ -581,7 +581,7 @@ STATIC uint xfs_calc_create_tmpfile_reservation( struct xfs_mount *mp) { - uint res = XFS_DQUOT_LOGRES(mp); + uint res = XFS_DQUOT_LOGRES; res += xfs_calc_icreate_resv_alloc(mp); return res + xfs_calc_iunlink_add_reservation(mp); @@ -630,7 +630,7 @@ STATIC uint xfs_calc_ifree_reservation( struct xfs_mount *mp) { - return XFS_DQUOT_LOGRES(mp) + + return XFS_DQUOT_LOGRES + xfs_calc_inode_res(mp, 1) + xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) + xfs_calc_iunlink_remove_reservation(mp) + @@ -647,7 +647,7 @@ STATIC uint xfs_calc_ichange_reservation( struct xfs_mount *mp) { - return XFS_DQUOT_LOGRES(mp) + + return XFS_DQUOT_LOGRES + xfs_calc_inode_res(mp, 1) + xfs_calc_buf_res(1, mp->m_sb.sb_sectsize); @@ -756,7 +756,7 @@ STATIC uint xfs_calc_addafork_reservation( struct xfs_mount *mp) { - return XFS_DQUOT_LOGRES(mp) + + return XFS_DQUOT_LOGRES + xfs_calc_inode_res(mp, 1) + xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) + xfs_calc_buf_res(1, mp->m_dir_geo->blksize) + @@ -804,7 +804,7 @@ STATIC uint xfs_calc_attrsetm_reservation( struct xfs_mount *mp) { - return XFS_DQUOT_LOGRES(mp) + + return XFS_DQUOT_LOGRES + xfs_calc_inode_res(mp, 1) + xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) + xfs_calc_buf_res(XFS_DA_NODE_MAXDEPTH, XFS_FSB_TO_B(mp, 1)); @@ -844,7 +844,7 @@ STATIC uint xfs_calc_attrrm_reservation( struct xfs_mount *mp) { - return XFS_DQUOT_LOGRES(mp) + + return XFS_DQUOT_LOGRES + max((xfs_calc_inode_res(mp, 1) + xfs_calc_buf_res(XFS_DA_NODE_MAXDEPTH, XFS_FSB_TO_B(mp, 1)) + From patchwork Wed Dec 18 02:14:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912908 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 441C5450EE for ; Wed, 18 Dec 2024 02:14:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488081; cv=fail; b=f8St4nq60QlVQrnO/o3kq2bR4AT3mhnGpp/XDKYHukj5PCX0JfvEQ7pcFEltir4BGUsGpB/2OhoVeN6TFVkJInalwzikFBzsvD1XimRHNsIFHRG/CdjGQbwP/mxUKOwUOOr6hErTIxGlmCWV+zYrdFfQFwzyH6onaysJ72FXLig= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488081; c=relaxed/simple; bh=psZHwsuA9sy6e/QJFA7PJIVDL3CLHRoeMrUOAl6Zyzo=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=GALaAa8tPQHjigsD1H4BJBpYxe2NVZl/eRlILpigYkybVSf6nb318QfRGO0o9CYIM5lnUhTx4I4nneW4uNwNOpKS4lEhia6/SOEb9FEQ0dXz0p0cszYaQe8veP8S92Np9dKCsb19e4e1qJfs2Y5Fcdm2BIz0Jtrz/gvJkt+7HJc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=IK4q5QKW; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=dG5FYHE4; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="IK4q5QKW"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="dG5FYHE4" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2BqoB001111 for ; Wed, 18 Dec 2024 02:14:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=XqofHiSLi6EtRfVc+YEDTVFXeKI72cJeabGzqWd1wp4=; b= IK4q5QKWBuAiLdKe5X9VaFEjIehR75J2Tz9VEOGA74TJ9Ij+UN58fAyLY66plW8i 6keBln8cSRqBEhKnAMqJ/paYGyYXCKewocYW51jIaz5ijrYUG9hJH0fpZWTj2wIS VxnlMpLpiZ+YjlJ81BMcIwcc1Ta6T8Ii3Wyvxd6+tBnTpq0deEh8oJNJPKnXpr8a 1FWAWKR4Iz9cmx8AXrFybREZpDIO0bUXnnUiWZL6Q+tgLoD7nn/Lx2yR3ym+RUHk bXOk6wr59ERX4g+GAJNyxeS32RDiRqBHqByWgJk3NwSnMNmrS7ZsCADKoyhLMqIY K/2YuYzAlVXntWvlz4czpA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0ec7fmj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:38 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI0N95S010863 for ; Wed, 18 Dec 2024 02:14:37 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2170.outbound.protection.outlook.com [104.47.56.170]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f945wa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=puj0DDl7pVaon4qWXJFMlcWfnuxQBHBDS8IujhyM0Z+MIa8FDhc8RjHxlFVE5X5ohKY3LgAS6zdWbCwers4YAWblnjtENizw7UYvdLP8ghhTGsiSVCf+tarIhf5VFfk1Q6q/vQebRTSE+el2VDOEdXA7kJhfEFw++TtqT3dHwtsblhkBT07qbrgPcqbf3ReqoKEU3pSMofhYaIC8q1YlOhKX9bFcmShqkYkZLz839SFb7oxoQN49lCnrKM0JyAvYH6hl/ieK0mWcj8LZ82hWinAOMbV8aSYI2rurX4BA4D7/ShfAZq28bJqZfQ3ygvD08vP2S4xDIpXt7pnHDcUb6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=XqofHiSLi6EtRfVc+YEDTVFXeKI72cJeabGzqWd1wp4=; b=MAi6pLK+vRT4Xc+jwreef6rjaALN6ZrzlNHiOA5QfelnzynU9EKHo7TOt1pS8cCicGRcNomorrBvNqX/+nNd+++MnjlyWmnKqiaoqACvAiTYfksIgr90siy6jVBaWB0kqVUxnJB/GtVK7JIHCl9NeVPWMN7klEgwRzg1CbwqVT4sj0+pJs46dfitTDaYavqXZZCuKV3l+aFlkLy4ZGLWNm6vXiKoUqtdeTb4pwPS49P/rK3etKUYB91d+XwzQBtOKGXrPyqALj6iXzVOja8wQQLn2kuS6gsoJz82D86Kq7a+MI4cJMy7orbfQwjZ1j0TXNLxWrxjqqL45HTDt4koCw== 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=XqofHiSLi6EtRfVc+YEDTVFXeKI72cJeabGzqWd1wp4=; b=dG5FYHE4XEGAFNqSRDD3lCS2ggjVcULl+mbZtXPYDgwRI77DoB3TxosTjMep+d/DFoCyEVdFiBy72e+UOinhJ9F5wpifoKinU67gt7hwKjVrAcUlg4OTCSIafbJZiX8BDz6K/T2uiyN83SoGHE6ZDzguT0UM2aI1jljODTNKD+s= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by IA0PR10MB7577.namprd10.prod.outlook.com (2603:10b6:208:483::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.22; Wed, 18 Dec 2024 02:14:35 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:35 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 12/18] xfs: attr forks require attr, not attr2 Date: Tue, 17 Dec 2024 18:14:05 -0800 Message-Id: <20241218021411.42144-13-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: SJ0PR05CA0199.namprd05.prod.outlook.com (2603:10b6:a03:330::24) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|IA0PR10MB7577:EE_ X-MS-Office365-Filtering-Correlation-Id: 2bfaa40f-4dae-41e2-728d-08dd1f09b781 X-MS-Exchange-SenderADCheck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i1gmpBA7HuP2nmtibxA+HdmJaZluWuLRs+PFn7XlUC1vWhgUUv3pL/PdPKbIAyimbTq7GH6FKkfyG2AGoQ64o2QxhKxm5UW60+AwrhMDeNxVi3dEW3hHzi6pQFuymMdy01/HgXnS3HRgPw0aPevKKxg2p6Nb1SFe/tg/jWvS30CizD8NxnC9nly/iQ0pJdKzbQqJUE4n8O4brIJWz7b/YPYQMG1Mz66CTl4rP694EzeIq8yQhsD5PI/hE3Tg0rB/WKCkhoHZG2xD8+BPYhxMXTaH0ehVs8qVYx4ZNX4fqOiPFhwelRm+96wmWMvrGrSw0pgVHInliguwyrfOE5eaBouWYTR9N6p2UjDb+n+OPicXg9/AXUGftoZN2StSFRTsCGLa3XrZ6zq6A27Z5CmtFT1GzpJoDLvwZGzvdY/ZAbYk6WDLi/LI8hrJ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gDn4p0YWAolWFnzmiZ+bzokc/a8vGLOruBT6xwubn5jwlVhbOoHIkUvae53CoLbegi3AKIDlmq0UPSkCjCm+YlOrZsytgpft5BhLb0ncnuMzb1LwucXheQ5Ko/38oR8nd/LXuEDrXjQ1jlaRvORCc/49r3lEE1CcUtjio/DeipUa6nVqsgadKZVXVKJhfn9I/dVSqmRuypYpu0jpnHI1LEP0xUQCeRXfkRUk4c+ar1Da4FD6CJaWngfflXNVDYvrPGTZMJ13c4XWmhDB3qvk/wpOUjX3cOc96gaX83F+2FHaNY7hdccBBHiwf48wgMr9h62lWN6Z7dbi36/kMxIYJ3SDRB2ZTe52Z6r6b0tnV2QJpNraKxxbh01Fe9Sl9FMZVDq5n++HCB1LwRxqdm+q91d2bVUMU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UwwaLQ+G+VbCFKgQYl0wVe2vvrrLQ5OlnXiCCZ8SYwtfus3VPD5TusQjW7wRgkn1xdbzn8bitMv3LPsBJ+NG9xo28hRGc1YZDqWdqGPT8M8xSUzLVa6Csy5ZUPP+v0NkswpZBkBI+Sr7AIKy+XgUw/rN34tGoS37YP8yj+xaGyT6QF4PAfI/m/o2xXSNsdc4A== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: u8VUDbps7NOKPvCOINc3MIhRZSku88LBIrLyrhImK6aHMeEjbcTe/NhjwdoA58x1fvJRKBL0DHE+/J/dZmh9jUnyMNtxbW1dnezQxX5W+kEazhnbIUiti8I+b9V7pJOHRObV4Dgd4N8OIM429x0vBgwFUm5YtWXrRLyJvPwXFNFc/bPuQfrRGTpXylYfgr3SI70eNucRh2KjZ3yXEljgcSG5RbZyr2BYCWGxus9HukbNbN7dgrcRM5rhavGdogelaZahATNgFZAHuxt8szSQlRYuekCf38uxtcICthZYi9s5QhfBwwfbpPUNZuhYJcykqSBvA6Z6fB0z6LxxBO3MCC5UZtumfolQX899UE5wG9nLc4hJ1H5qgA/ujmLnciuDslfcu7Kkr5ch9A1zY+7bQDuyUxLZUfEt17a3Q723nkSFF3Z0UphUy7mMKKp4D7BZ1WJMxQ2xzlHtFZTajVlWvgPyX5sL/WS1sEuV9EuasyD/f7WG6UUAkSce3JQjXgZCGEIAHuYPmggbejuPdZ7CVBMNSzs1tQyjZV16lSKNTM0SGxH9lPriaUpgvM7Ggh9TJEpfrn865c93uD9i4RWHkPgYFcp9qcaIv5RSr1NP65g= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2bfaa40f-4dae-41e2-728d-08dd1f09b781 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:35.1913 (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: Gx07NOoIbJvcMCj64Af3Uz6cu/4yob/zF4Qb2q1tIFH961S5T6xcUQZZ0y8TkfU5pl/8eKwrk/ZfxpyA8h+On4YIi5LkNnD0GntC4IbrW18= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7577 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: yGVLRLOONpd5jcRR4HGREi4msGyLEl31 X-Proofpoint-ORIG-GUID: yGVLRLOONpd5jcRR4HGREi4msGyLEl31 From: "Darrick J. Wong" commit 73c34b0b85d46bf9c2c0b367aeaffa1e2481b136 upstream. It turns out that I misunderstood the difference between the attr and attr2 feature bits. "attr" means that at some point an attr fork was created somewhere in the filesystem. "attr2" means that inodes have variable-sized forks, but says nothing about whether or not there actually /are/ attr forks in the system. If we have an attr fork, we only need to check that attr is set. Fixes: 99d9d8d05da26 ("xfs: scrub inode block mappings") Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang --- fs/xfs/scrub/bmap.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c index 75588915572e..9dfa310df311 100644 --- a/fs/xfs/scrub/bmap.c +++ b/fs/xfs/scrub/bmap.c @@ -857,7 +857,13 @@ xchk_bmap( } break; case XFS_ATTR_FORK: - if (!xfs_has_attr(mp) && !xfs_has_attr2(mp)) + /* + * "attr" means that an attr fork was created at some point in + * the life of this filesystem. "attr2" means that inodes have + * variable-sized data/attr fork areas. Hence we only check + * attr here. + */ + if (!xfs_has_attr(mp)) xchk_ino_set_corrupt(sc, sc->ip->i_ino); break; default: From patchwork Wed Dec 18 02:14:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912909 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8573270815 for ; Wed, 18 Dec 2024 02:14:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488083; cv=fail; b=NqbqMFgRiqN8nbYxJiVW62cWlyhK8mkkqZW2EGiccJNWqTwOch87Ja3YWx8ysGLGx0vxSVnwciJsEr1riM0WR6kutXQBf+GHU13in8VUz7q0rP2/pWzFFIXdzvh92zLClQwT4uHH60pXDZBG89D6E7RtYCXEAal/0ewgMtAqK28= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488083; c=relaxed/simple; bh=DDEG/9z3wPiChZ+8MgRKA+QyiEBiHaWy560hdEfQkDU=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=hR5443ID4+sQQv2FvJTNS6abLGImMCFz4k9EMJjZ0GS3hcM463w0WIrjN60BlhX6F/aTgFuBik8hkRrbv09prOLN/J52wHUZh5ooHBvgMLoTePzADni0Y/6l9fTEjYz37DV+fzXU0iWwE6MDhFRWNYBScqnjRsMhYIZKdfID89w= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=RsDIAye2; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=HMvfSTkx; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="RsDIAye2"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="HMvfSTkx" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2Brvp006239 for ; Wed, 18 Dec 2024 02:14:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=b+nVDA7iikEzFNWGjlIlqKxCjwwgpI/kDGgYZMYwix0=; b= RsDIAye2NF0hgte4SRfB4gXme9ko7JvR3XFZ2ziT4xvqoKgKrkp42u+YiyDmHayL 9ITtWtCmfj6YkiU80C3v9fJZXLb3igBzZTFMPY+LKx4YcUeCCqcve9tpQJBlP0qB f0CVS3i9YQsGvgX1WmaNr9A4GggPlBZRhBnASKBnNtRz2hKE7lNZ1d43QoSkhmqE 8OUjuDLHMM8NxYXzEQmkPlA4s/uJ69JxvnaaJ3LFvAERro+KyOiGiecaIs3ERsnj a67MGuqDkx4EhOFzfZ4kHmaXxPRgNr3VB8tudFcVAJejck6eG097Q3TIYTzZY+ui XJROY7sZ35L3G1bTmqBmwg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0m07ntc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:40 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI0dED3018376 for ; Wed, 18 Dec 2024 02:14:39 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f9fbxx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vzp+f335dW/4pqEE/gyasrDRF8PkrUpSWLKK+7HG7B8SlecHrVmMRWYhL7yrNtfKYJ4FuM7qIQpc45Wfm9SvfAX/PiTH69stQybAyp/k9OOsJstg17UavIED3RSFeGP/DAS3GyXNWlPeUoKfaNXh4VYtmFs9GBKzNFz6eRlzX6rFtM+ZXS/4kSBrIGBi/o5hc8HgQv96+HyTrz9OIemEgrm1KkwcK4zAhVRN5cbHd7iTfJY27zvjqukIHF7RZ1F4Ju7j0XxAWDWbL3s19utEW1+BFv1/sjqaH+0jgLq63zNjKpajlPO5lWJMesQECnMlQfiwc71tWzKA77mIQNmSFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=b+nVDA7iikEzFNWGjlIlqKxCjwwgpI/kDGgYZMYwix0=; b=shAlCZNRWvkjsPHRob6FS7KzylcLZ+c9mXE8LRJPjY2ozgxdHeflB6ogTvIVGdc4tU2GDH2fVu2N6+W8BjqIPGR0WtEQV8OAo6faYsyJRrdjs9W6LUZinjkgZAqy1DDrhmWqMYvmRYVcSQPwIsZmEG0XLxFv0O1DoBWBN6pBoZ7Jth7/Ls90jTf/eHeDhy3C7m+vQW+ixHPjWFQNMXOyvMfKNF2hhRCNHdAKdOpRiuZK0lWoKuZkzqM5x1N7M3VzFdIHh0kEibD7H5z9rxevYT5Ar+JhDlQNYCIbekwg6QLJayvXfYIK9FxpH+dRMd1Rg3PmJbpm4w5KyHfYLHfamg== 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=b+nVDA7iikEzFNWGjlIlqKxCjwwgpI/kDGgYZMYwix0=; b=HMvfSTkxGFrduPzAP2SS0xbKTMCeW/oK/OgzeHR10UwXN8bR1lCwCLOSG6a908gN0igsJS4IrA5Lh8TJzR36hA+J/HUVL/oRCf9uogIVxQ1yTHqKAlIB47xqtmfUe9JEFea9iZ1hCxTTnYPWiScrRvjgKDGGeVgs8A8WYwF1aZY= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by IA0PR10MB7577.namprd10.prod.outlook.com (2603:10b6:208:483::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.22; Wed, 18 Dec 2024 02:14:37 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:37 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 13/18] xfs: conditionally allow FS_XFLAG_REALTIME changes if S_DAX is set Date: Tue, 17 Dec 2024 18:14:06 -0800 Message-Id: <20241218021411.42144-14-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: SJ0PR05CA0206.namprd05.prod.outlook.com (2603:10b6:a03:330::31) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|IA0PR10MB7577:EE_ X-MS-Office365-Filtering-Correlation-Id: f512d69a-5396-4e86-e4ff-08dd1f09b8ad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: o33t8lJ8aoH1XJHvzxR1gwSqAHhR+iXfBb2NqmKDjIGQXwg7qSH46OUP69BJpl4obdLkibimTVAGpIadDoNVJzhcSRrM432BYxd883r4AvYfBWViuJ3q0Uqy6nL1Vo6SCUQtcobsxdBGtdBkUCBBB1x0SnWS7aq6D+ozGVOrJdtg8v8SdmfSC8j78R+yGfnY+wkotS6LDP43lGZgDdJVLzP7M0PkTt05IZ1lB1ilaKOXr0p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PGXyBpuk5ql7QLU8/evm7+tPcSjFl/x2B8wlKRN3UFL7Nb6GbTxg98cSMWnlH/h1kKqPlEjfIJkCvwAECYeTHT75uwzrDVla1WV X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xDkAO9LcS9C3YacUzHbIA5DKUsOGO4otvNP+Zn2nGi6qAJHLDRD4zi+yaOLdz9Je91F4jwrmO5MWwQkeeFWj5+uo25QlNMWKGXCbwNxxhprS8ceCU7FWWk1VgobrzOR7sI6Wp9Snes3hNQap8P+OjlGHeI0HMhUNhNFSRUevCr8k3d0I+FxnV+4lyXftnE7dpM3NBbsbbWleAs0YTl8DBjoM0dzHK9WntSQaQ2j2Jbr5nYzilM9tLmubRSYWVOINtwUROpawBqiW5WYlw1Dk816qaw/2qboe2stOSjgD48hqA2Xg45Os0/TiLQ6gJnJ/irIaIhrmsiTohw9WPRuKZBxg0zrtU28Wp9Ex4TVdNJwrLqQpzKWIRtK48nFVLUMCn8gZZ8Gh2gEajXP20iVu4irvofUNYTF4pskuaz2gns0GOe2x4sGZmHUfeZzHAVR+V44/R07Wmqho4qso8brXuIdqZ0O4OY2nmRgcm5uvkfbDJVL2vjBUj8xgvcQ0wX5mlJeLdJK0U+4wdsT18MsOPtXp0uoKMmJEHbHOwnxgHTr8UfJ5mcq/Bc6rIau6KWhe+Ryq/8zg0p9PkKSUaT4D37MyLZoFt1C+LvpSOUkino+vrjRYwn7itr7ZOmm8WH9sSvG51z1RjZqHvWSP7D4UKYLR9xUTcS55OR7Hhxcb5diVlm7jQpLV2zqTv+trwYNQVojI0GCMGk0MukctkaS8Sl/G6+L0kdHrAZcCf0tk78IvpN0osi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Iqo873LjsOv/mhM3lleTlTvnQizjTPG2IKCtZA3FcAfbxwkdrrL04P5W9CBzMJ0r7O569aptquQxRGY6n2gDXoregkzYMexQvsA82Z7hzoJVqNT3WGRfgA7ZPK9uAq7lDJ+sQ1pQ50BPHoGjAKu2muwQaX7QTv1JwNg3gapz13So2g1e82O9/wP600lz5ezdHP3eZfSUkm2Ncod27MVxa+rXQUgvEzMFOSAHDkiBsqfcsfCKqVvt5Io180dQWL+Lz8oIw2+CHGS2Q3i2ZZd9grsmz2jUuTYYrbX1Mvl8KsOCaCwGnGHXZcx/tI4o0VRi3uKL7FbAx3MYr0GFAytRTYKrdmqN4BwykS8MJHiJDbebmTR5cmHN7UPE3neTTIHGwUHGjJuLdA+uX324PT3l55pJE797EjkIZIfu75X11HrNPyyUbdwziHjVZyhN22eb+jfYthQB6cbekTYCE4d5GXz5zIrMMWbdvzJ8GvFGF5U5FPqjSY0VspWqvfzWcRnnUR+9J6YRdFHqeIWBINp6MpI8dkkgG0Q4Nmyf0dzHY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f512d69a-5396-4e86-e4ff-08dd1f09b8ad X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:37.1684 (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: CiSDoVtic9MkX4teCOn5IIjRki4kqj32OQZgB7Wb+I4yo0ZiA/aHYp21yHvKBPmxcSBcqLBxXxoENMVnkdWEDfaFDzjUIitBhMbjO+NpaVw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7577 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 suspectscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: czt8GePKyptWDf9I4r3WO158GgF_piMR X-Proofpoint-ORIG-GUID: czt8GePKyptWDf9I4r3WO158GgF_piMR From: "Darrick J. Wong" commit 8d16762047c627073955b7ed171a36addaf7b1ff upstream. If a file has the S_DAX flag (aka fsdax access mode) set, we cannot allow users to change the realtime flag unless the datadev and rtdev both support fsdax access modes. Even if there are no extents allocated to the file, the setattr thread could be racing with another thread that has already started down the write code paths. Fixes: ba23cba9b3bdc ("fs: allow per-device dax status checking for filesystems") Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang --- fs/xfs/xfs_ioctl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index df4bf0d56aad..32e718043e0e 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -1128,6 +1128,17 @@ xfs_ioctl_setattr_xflags( /* Can't change realtime flag if any extents are allocated. */ if (ip->i_df.if_nextents || ip->i_delayed_blks) return -EINVAL; + + /* + * If S_DAX is enabled on this file, we can only switch the + * device if both support fsdax. We can't update S_DAX because + * there might be other threads walking down the access paths. + */ + if (IS_DAX(VFS_I(ip)) && + (mp->m_ddev_targp->bt_daxdev == NULL || + (mp->m_rtdev_targp && + mp->m_rtdev_targp->bt_daxdev == NULL))) + return -EINVAL; } if (rtflag) { From patchwork Wed Dec 18 02:14:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912910 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 544A27081D for ; Wed, 18 Dec 2024 02:14:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488084; cv=fail; b=aKZGHN3/S3pKeKzgzOQzT22mnI13QHtuWn9BxB8Rr/3hQf6pIVGhJbaBBkPOXLpoaoAslVwNrs4mhqX2If9I3dPjayAFqEPp8vQp9WWn/EAVkYBRiDWgEMwJGggb94Ck7k8l/Yo149m/MLOTqmf1byv1jU4NFQNjld+2IyzI3rI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488084; c=relaxed/simple; bh=XEtyqCIVyfnQaeNWHBrj5xfaPAADVGUX9uakfGRsksU=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=PBF9MISGUW1nc9l3oV8RY3u4PKqZtcQY195+VV4zO2SAKHMeDmuTc5sVtCXZMRpqX342QbVPoB8cARH/vOX+m+CO1pHeXuQAu6RFzP5dTbKwgslliYnlPquTu3FJSO+/Cw1mzEx+hnjexSXCv77rmlo790RZGLvp3FQGepAKK8I= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=Kb74bhUn; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=B9PmJYAf; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Kb74bhUn"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="B9PmJYAf" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2BtBd029124 for ; Wed, 18 Dec 2024 02:14:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=/yPLvlaq+Z+qDEjmgdqWejSwZgD1dP2CIZ7Vh5jmJc8=; b= Kb74bhUnUOmZbgz3V15oxvLlagQ8viNkERtNLyL7E49IXeNxX72qxNxY0vquyEaH SZpOEvK09QMK+O/zootfoj9uZSoM1tl+zkh9dhOxVVE1rdW+ItWlkzbp5WrEDJ4w f51PkLvp6AlDaOemgA14V7h9SMDkVokNDKfESaZQAB6Pg3G6sHkJKf6ugKtkEqsP OPbsslhRV8BD5Zq3WuZUOevkcFcgzUuZJAZcppdEHw1tfNhJCFHuTgnhfaux7L/6 Ol2654t1Sgl6JjUuD+DnxduwoZfJ1Mb9KWM5EiKm1FsToz7SU77u0g4v2+Trf9Uw 5C4oJcuRBBI+IOcbl1EPxQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h1w9ff85-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:41 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BHNXJ3F000614 for ; Wed, 18 Dec 2024 02:14:40 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f9dc7w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FMYxEQlAZCE765+6O2ksjNCpadOrP4JmWTddiVmGkfzfNiBhkOTUzKps0BmicksHbmbNf4PZlTovBa03zys8h2nYGGxPvgAk7mRcvfFp6nEKbiH8YOi7ZIcHmDRrlQkDiFew1Kr7SCi8s/THkzqchByp3fOP1NUUr7pcNZZtoRl0YKy5/+cJMEi99ExliBFLQ1zWA9JAcLVct7dWxaTH4I716C5Q9TW+y0FsLkP7uMzDyPRgwDTuMGSr2tdFCoXbiGhlk4SmXZNonT2CYggF0dQbhOh5bh5FoyOK4ABcsmGLa01yBy0QWJaLg9lcAY7lHV6vBDmYBDNnuQ/PSvisBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=/yPLvlaq+Z+qDEjmgdqWejSwZgD1dP2CIZ7Vh5jmJc8=; b=icmMhVbS3juFCShFupmV1h2ElydzXvYlnS86wqH4lGjLZ1ihK2fpGIzEl6nLMQRTTUwsCWpqqoRhqV+RZTE5u0zy5X0mpj45HZA7Y0UGMmKNlF3AzPG+F3sWk9PeZhjywb6RDGxtrE80wh9PwNV7gUOHJ2plLmsobSgBeIS3raryDcrcepESara9izUviABGWnVaGUb/F9JHeEjf9UcsPwxJmUR0uUpSIppA44uvgBrObwhakvtvHLO2Gsi1HlHXjUKZcnb7n7JJAnd+snoXd8OJuZGxa/o8jYvB2fJycKI1mC1nKIUgMuvktIDVrs9CQTFJk7uZuACIJbrrqx2pBw== 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=/yPLvlaq+Z+qDEjmgdqWejSwZgD1dP2CIZ7Vh5jmJc8=; b=B9PmJYAfLnO673Gzi/Yz1IdoNfnL0U6N3jhRrwc6w06SU5s3YGaWkKX4Yah4eZzoRVjuFFteinRQvkXqfYhlPCK0EYcQciSNxis4U2e8O0FdhQe52tudsaIT/HvgnaIcbCWFJZYHR/64dEyTgRi9CHagO2WouqZq4aJC+l3EngM= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by IA0PR10MB7577.namprd10.prod.outlook.com (2603:10b6:208:483::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.22; Wed, 18 Dec 2024 02:14:38 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:38 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 14/18] xfs: Fix the owner setting issue for rmap query in xfs fsmap Date: Tue, 17 Dec 2024 18:14:07 -0800 Message-Id: <20241218021411.42144-15-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: SJ0PR05CA0194.namprd05.prod.outlook.com (2603:10b6:a03:330::19) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|IA0PR10MB7577:EE_ X-MS-Office365-Filtering-Correlation-Id: a36c2cc4-5367-4759-7842-08dd1f09b9b5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: csEI0wqBce4UpBO9c8V2N8iIKfzjhan9Kl49OinXfCIS7dMwwOrqIiyLuMuw3ZCdmiP+wJ7vNmeNQbi7k/0/u+PpdB15lKeFKRh3leZ1qN8R2Q8K6dDBGqeCtTg7GN8W8GSkzO6Jl7OL7cVDBuc84vmNNkjVkRutcaTc4x22aNOlQOHEV0TKAUaXJQATZACwTC6hT9Goo3ub4Ql7EaqgWNl4FdgMjOP8ZiS4xmiIekQlGk+lXorCikr+gM/RpMZnVjjdun6QJ4UwulVMrIA8/AX8BFMIsPZsDcfPfbvhQJwaLGFhj+aa04dQRpf/sz0BAtNRS+JB/ktmDP87pkT0Pet57ZqO80OIOypyNsl3zsZPZHjWvz195gvXEBTymPJmD22EgeumiAF/J3vwC/nlp1G6jtWUZx0tKeGl1SmY3CDAkaULOFFcTXBRyyg+Q5TCtjhZWgKIg28S7bqddeAmlj29nWT4Mj9Dn3Hgp79ijk7hsbTmekKqHjsnL9B/QB5brdtqDwcCxhy/Y9u8IvmjZY9GtAL4dN3SwjviezTN76fJrWNCGVmWge5JLL8zHrGOQCj/0IrW1W/0KNvucrK0NfvXic+yItNxYaKfPGpw6sJ2KrtONzE8cuuV/ZdvC6d8cRbC1B9NEZVLZ2LfLnc11lLy0On14bJ9+WWduXd3zLVbQcagjYUH7DLoRYEXtatSIXbzfKja8HPQdhHBYfB38uQ6lH9HVpiy+j39li0DKFm6c6f22pLBfnYD8cO5gKJQ6f2cDpz7PQEgmvb5K+amFHJFeM7iWjSBo1WCQ8X/MtvgokRaxMFwpYVNFSs0bCPxtSef2zAPUiUaNnnWHgCLVEQFd3Q1/Kx9gASU1ESo6ugap/PKiOMFVZ928O73w0Wq6rZ7CFerEIK0xmQy8MmkXnoWfeSicl5NzzHhM+vjDXeDzXIwKkCFwDXs/xuWleA0AkDnvPCza9mPHI9Tp+C0UO3fmcisJhIQjwK1z4gUxIK8jlBEO4akriMPwc4dtuJbXdnZOe294wN9A6+nV0ejyy3Ww41UEYNHkENj88nDeDxvVV1UcyXtLOphsgB4IYoOAkKBuINoTpvZsojTbWaNipLavyyG0q1BXNzv6ZhnvhdtadYy558qpT7jQC5td8lZvBcnv3Ctx33o0TrxcRuArrkosp2NEWjKXXA5H0nz3jmnSIbZ34wtlp5kD8YXLgcEfSlDbOPKOr3QCN2zeeSWhtJk0yPOf/6MkOTzUoYUDQmAfHM8uJVayIxQ0jqmWyGZzjwigLvbhyp6w4r+yDxvK6H6Po/OgGjA5/oyJiJgQQrVoRx/KQqa26X42wAWQPjk88wu2WOb9wT1aROgzRNJ42XMBPZt83bKOpNI2jLQ/f7yFFqzTQYoTuL0JKUZ2FPi X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 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/wwal2rpwIpju5l1+0xxKx+fHEuF1feJlhZ8eM51q7B9+FSdCGYeWkr+JMm0kd220aRMGLgihpSF9OfnasdlKEVg0+NVSA+rzZo0r/1xyooi91KGwarLckxXKrRSVKeb4Z4tPtgo7a0JN5AwBob+1qa/49qDUNgs3f6+RcToZ2bzVUynp5dopIn8XsCsosBFQ7shnXoKovURn7H3hm8FbDF+jAAh30j6Dcn/lM7/ggghy658GKofDLmDQBdO6/I/gVY2IpH45Zt5sMq/wXy7pfYONkB4RxDLOgIdMyePgOL1dwfVPBula03eO4LnxePDXXpIHdqcXFX2j0ufWuL0sUHTDtRmGR/1SzzcZgV6lfgrngmbj9Jy2luYCry35o1jgZFszuWWYjxzvcfKREE+wX29gP6OA2IFQLmJzFKruVqWvNChok1kKIAN1aGhC6SATH8Eg4/xJLL0pxgZafVEfQ2+g20UXgNNTjacGbkCaIhF7/3TgrY/KJLVpFXbQtJttN9RA9ufNBrc2EupDqvquklnkmvVyddsguhjS61TbXNSyGPOlX5ESrHAD7MsxzgLSyxu+l19nfRpPgfdH179NsPI+y9J4iLByBV4yV4mffPP0bKwbdOwE4rUvLUH0g== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: v1oxiTrv6iG1XJFqrQ3+kPBE+cvCbf1sifb5IeBekVi28Yy1g0KBCgzl8w2qLI9Tj/tPp7pqemW2986jhlb11q8uXjxIYopLApBNP10n+RzgNS4DMqHv9PtvZdwBxStNzHXqOB+sGSZ8XEuzWa/A+Fopeh+52+5IEPmVi05hD8bqGsgnyX94Qvq9lB7MiZpesBhCv++naKGqZAwVLQeJG7KEHcVRRhJR4YowsT6TeT7KpWcyfwGhxDaSaa+4DEY74Ff2jBfaGjkj52+t0b0e74J+Os/jQbC6VSvBKBIk+AKs+tOSesEvniFPlm75ysExa8A5vZAAT/1G0KK4SUh13/2DbkL4QXbWYmGJKzGFq6etdEqgH7gVYkkpdTCEtkWdTKWcFfSsVYr1ZKkexIZb9nw/USE3AWHZSclJEkLLKrsfg9OJz7rnA5ezr6xXeRldD2IKYEK6O53jJQENuQ8lJ20wRkCvvONyWj4hpvNYdjDxCQnzdneFZCxHMNQ/GkzaH2ybqcfCOi+LhrYocruZKc3MS9dh7h/HFNzdRWCANVz+EurZiydFLBP5L8FRd0RQxHqXXq0dm+QKaInB2U7z7FvL0+wE6v4IKAgKDPYEZ0c= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a36c2cc4-5367-4759-7842-08dd1f09b9b5 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:38.8902 (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: UkPRAOfor9BYG/q6zWnDcrQ8qnIvLKS+9MWWTLqxk4viGbRMYnqvDMA1BgVGiq07obJV8h0RVm1k/21HrhiSM4Xq8m2LKyHWfLt6CCWV/5U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7577 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: cp1TKBL6hyXkHRcxmSQBnQ9tzunF1pTw X-Proofpoint-ORIG-GUID: cp1TKBL6hyXkHRcxmSQBnQ9tzunF1pTw From: Zizhi Wo commit 68415b349f3f16904f006275757f4fcb34b8ee43 upstream. I notice a rmap query bug in xfs_io fsmap: [root@fedora ~]# xfs_io -c 'fsmap -vvvv' /mnt EXT: DEV BLOCK-RANGE OWNER FILE-OFFSET AG AG-OFFSET TOTAL 0: 253:16 [0..7]: static fs metadata 0 (0..7) 8 1: 253:16 [8..23]: per-AG metadata 0 (8..23) 16 2: 253:16 [24..39]: inode btree 0 (24..39) 16 3: 253:16 [40..47]: per-AG metadata 0 (40..47) 8 4: 253:16 [48..55]: refcount btree 0 (48..55) 8 5: 253:16 [56..103]: per-AG metadata 0 (56..103) 48 6: 253:16 [104..127]: free space 0 (104..127) 24 ...... Bug: [root@fedora ~]# xfs_io -c 'fsmap -vvvv -d 0 3' /mnt [root@fedora ~]# Normally, we should be able to get one record, but we got nothing. The root cause of this problem lies in the incorrect setting of rm_owner in the rmap query. In the case of the initial query where the owner is not set, __xfs_getfsmap_datadev() first sets info->high.rm_owner to ULLONG_MAX. This is done to prevent any omissions when comparing rmap items. However, if the current ag is detected to be the last one, the function sets info's high_irec based on the provided key. If high->rm_owner is not specified, it should continue to be set to ULLONG_MAX; otherwise, there will be issues with interval omissions. For example, consider "start" and "end" within the same block. If high->rm_owner == 0, it will be smaller than the founded record in rmapbt, resulting in a query with no records. The main call stack is as follows: xfs_ioc_getfsmap xfs_getfsmap xfs_getfsmap_datadev_rmapbt __xfs_getfsmap_datadev info->high.rm_owner = ULLONG_MAX if (pag->pag_agno == end_ag) xfs_fsmap_owner_to_rmap // set info->high.rm_owner = 0 because fmr_owner == -1ULL dest->rm_owner = 0 // get nothing xfs_getfsmap_datadev_rmapbt_query The problem can be resolved by simply modify the xfs_fsmap_owner_to_rmap function internal logic to achieve. After applying this patch, the above problem have been solved: [root@fedora ~]# xfs_io -c 'fsmap -vvvv -d 0 3' /mnt EXT: DEV BLOCK-RANGE OWNER FILE-OFFSET AG AG-OFFSET TOTAL 0: 253:16 [0..7]: static fs metadata 0 (0..7) 8 Fixes: e89c041338ed ("xfs: implement the GETFSMAP ioctl") Signed-off-by: Zizhi Wo Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang --- fs/xfs/xfs_fsmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c index 8982c5d6cbd0..85953dbd4283 100644 --- a/fs/xfs/xfs_fsmap.c +++ b/fs/xfs/xfs_fsmap.c @@ -71,7 +71,7 @@ xfs_fsmap_owner_to_rmap( switch (src->fmr_owner) { case 0: /* "lowest owner id possible" */ case -1ULL: /* "highest owner id possible" */ - dest->rm_owner = 0; + dest->rm_owner = src->fmr_owner; break; case XFS_FMR_OWN_FREE: dest->rm_owner = XFS_RMAP_OWN_NULL; From patchwork Wed Dec 18 02:14:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912911 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2761012A177 for ; Wed, 18 Dec 2024 02:14:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488086; cv=fail; b=XytvpAQOl6ycuzpgKzuaD6QVP8feRijdABjcppkUix5rSOpTD2OKWAzMFHT7wwJ8Jfmrot6LeZb6DvKxxt4LKEPOKBmXshe05DgWru46guDCjeqVDWSG08u+7VW4HeI2q4yP2jXpd02sQe+aF+caZhT2F2a+cX6P0eoRmHxFX84= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488086; c=relaxed/simple; bh=Bl9vQLixQbGYjg3bheoU0hwC/N3PPhvV8OCQfWOoeR8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=VBRBEKBZ5lWYD2eVDJznYrzWrN7BzNayP7yPVDX5jiI2o2imAw4wFpy838hIH5H9ZaU4k11ANm81R8AA9nAHlfkCaLgW+137UDepYfhRDfG66NyPOj3vTmBWHE53dv8KMoIQLu+roNbVDLb60sH3nC/j5Lh08YHmYMTVHBVEQig= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=aWOTUtWZ; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=XSasdMzj; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="aWOTUtWZ"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="XSasdMzj" Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2BqCx004607 for ; Wed, 18 Dec 2024 02:14:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=kX9kk+0FdbMtL347JKg9cA354fRVX6xXm72n9Te/Ksw=; b= aWOTUtWZ2F/bC9pzpKAz/JPgPhHWe6IvGX8OzENJAWZUqQK4rOwniGXy6COrLY4n OFITGcOyUn+sh5XuZq9hDd+v2usUU2XKOBRxmq52NMiMAgJSkDyY2lJG5UAP1HXP kdPr6N79EwsGDnG17b60V2+XIY6O7HPsfjtOcjIn26NBqbQkDzR2ULTJrhcBVWFR u84DKDMHTyfyFxBBhGtN657kXpHhU0azif+lX+7Q05UbuLMoKow2zRUhDKathTdY e9jcEQqwGoOSDpMgN1pcMFuw99R9lxG1xFhxb1Y1W13tT5va1xm3sEeD4Ywz4XWa VVZfxr+i9ZZOHRUXbdFTzg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43jaj5db9g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:42 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI0TkbN035729 for ; Wed, 18 Dec 2024 02:14:42 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2172.outbound.protection.outlook.com [104.47.57.172]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f97yhd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZyChOL81GVeekvjcF7UrnGwUrb5f44botoZ++llLhmxTAVljSkwKX0aDhzIYqMoCIgFcKynRbLRY/Psg5lsc33oyW5cfjIcwlIt+djNwWB7ih1Tokbf0h+2h08ztbQNnDWGKfKrNAO0X/tSr8/0jpZLNRzorHhW7pzb+yikMoXHkb6lVHYR0xcndQJjOFtJg/9pKHToZgkfZevpoVDmmiq40GBjgkJbMzLZDlnjdmFEG+kDk5Hb8auGn7938v3Nli6xVdXJwetm9ji/mJ1iCj+nEDG/JFXIF/loArcuAMvtp/z9i+sSjr7Dm2LV1OIR2HoXlGvRaWMK7tVTCl7cSJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=kX9kk+0FdbMtL347JKg9cA354fRVX6xXm72n9Te/Ksw=; b=VCONfY35SFSVKQrLlhnQATftVgeVSoxcqSsLtkbFaxF4biqaBbSR9JwXZqRMVSN7nYoeXKRoyzJqvxY0GYAHkWFxW5yXsCM0exZmfwBZf1nHh+b80uBm/rPrmySQFz0rqNGirEMBL992+e7K1yZWfxk6inpZSozR6SIsEH64t3Lj6YSd0KxEHgQDuOM1h5U/EMpBdAtulpRKXXowDChu172rDhCRGTK4CCilWBNMm/uDhYUl8wzfkG+/4SPXVDh/DjDlKXPOLHwA195jAg6I/3qQjxGHm/mjreU1PpiPUjsKQT6qCzeadM4UgVMD/Vm5B+jcgdTjYhaU2bwRSqlT7g== 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=kX9kk+0FdbMtL347JKg9cA354fRVX6xXm72n9Te/Ksw=; b=XSasdMzj+90bmWtWS2hbtlgMf4pExe8TSPe04DCi51Y/yOtpXilMOMr258ZXMLl2cp066N8wqImpbBQP8F1tmjZTNsnRKY7DrsZ2VA3h+79Pw+8lYv4NUCwUqDf0L/o6k/lUOLqORn/++vdcwksJE5aZinbD6ACp3qbs3RSla8E= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by IA0PR10MB7577.namprd10.prod.outlook.com (2603:10b6:208:483::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.22; Wed, 18 Dec 2024 02:14:40 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:40 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 15/18] xfs: use XFS_BUF_DADDR_NULL for daddrs in getfsmap code Date: Tue, 17 Dec 2024 18:14:08 -0800 Message-Id: <20241218021411.42144-16-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: SJ0PR05CA0207.namprd05.prod.outlook.com (2603:10b6:a03:330::32) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|IA0PR10MB7577:EE_ X-MS-Office365-Filtering-Correlation-Id: f78cc294-0c5f-462a-589f-08dd1f09bace X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: 3ciYYAXnloYQvzZTHY5QrO8Jb4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VCUFAdXitPgHwQR2xW/woDcWJZpo2UQ3VAZ7U5dX+UuVKi7qAqvtrRlm7Scba7gd5MyRLZI7QlpCbdS204W3UfN4xlK3CVfqEOpooIQGOJiIhuCvTFkmFbb/VIV1OHNphaJ8W246MsKbxtlb7AmPpoj3dP2MM/EAMIBLzqNhpDh9pkdLUf+ZNXoYgQ1Y5t2wdIWpIu5e4lm8uSZb2OhsUT0ecUUfxOCqUNtvXsnalz6MnBIW8ZN5ut0iJShQ1g3kqruDjYZjYK8Id0MJ1So8IoiZ1IJmKSu+VCBi5NUQpMXB91fK98/He X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /d/fH2D5PqSQQiRgabZgGM1GJ9NwUF9cr+KAX/PuAh2UGeM+BwFYf5jFIXjUcgS4RZ4EofrW/m2asrhw67KIVZFxIBxqjrvNUGIJcOCKVJC8GU0jQ/3yCOYaAfZmjcIpDL85EGc5fzMmv9qFE0NF5Ja6V00fKS11/2vWI3OQe6Z+I+wnusBmEgxjIDwUCvIfUEmStt+CUzaNlcYUOmsSBf6qhEp9Y3Zv5XT3CA9yWekj5dtEh4hglgLlH18Kwzjz9l4aMe9ZnbSgSQKOEQmVc2K0tyGquZkr7Fy5v3wseIP1Jw4s2Gr9E6sj51nYRnOJRLw3dmk2pBONtuAYU82TIfjp5KHZVcPDSbYXCCsfVgJITkjhPAkrQiLMAqfXTr7YJVq7GAiv844FaXB1IPoA2TpX4Ell2COnIUbBfJUa6vihdLejVvRhIbnCIm+YXOy/icGpRbxu5/lLzkBRqAJlKTBuQWS7Boe98ytYkHQpihrYmTAEwcEpMMCqP/a+wQBNQFm1tH09tmEKqoINRi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NRKFUfR5WsNxa742j1DLMC8JP+j7xJvEj5PB5TEw1/+jGKrdHjH9QTP0pQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Co3/BxK4Hmls+P0mgGKMxgz4Ock2jrxA02t0/P4f4ZxHKJcNZNGuj00nEC7GdLFnzQAium8axiN1IOfHnPIFAzjPNimYKPQ7gUIuQ/TmUrvggWuk7nsISR9zGTrJTyqJlknZ+GJ+bS6z4HQ/BsqTdxXoG5Q3CQ7kQCNqR/FlzEjqttqpc+LBfmRGDLL7CLC71jgPuOsNre4VJB+FON5vsEbfZODmRDz6i6BKCd9yDj9/6BTgHOWs7RqhvIf441o2m/LNMxJtT1eLGkFEo+wTVU6JEgNzxRByWE/epahcf+7qIg0Pvu/Fv3PCFGGrngs3xwYDspfS5w89PRe0RyYGetNiMtIpMeYp1kVuJp4/SvnEPiZwKSfyuno8GMbitt7ghz5LmcCxVVj6rPF9hGLv6SXzcQU7EXpDJevdE+cQ85HVvNC/QrvjGgAQvxpytSZsxMvXSUVSaj2l5jYoGh3OTI6f/Se0idJM/Q7/JDmNzRc2WRXgHXxzl2tpGLjPbViaDqbWzXl8Td9ztrYBwUQUCO/LiNnjCrlkuUU1hM7Ql4W72fz+rX0XuYghmwJVdohXtAa8UkzLtdRkcsCqh029TeOr95ShxW0DfbIVg7xIxVw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f78cc294-0c5f-462a-589f-08dd1f09bace X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:40.7505 (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: Bk5bSULPU4F40QwF7i4GBCMz+9de6sNWwsCxQi6NyfvaCY7+QlDrzb4alQ57AsQgD5aSU+g0iT8DMGrfiaB+3JKL+wXwKUGPUU1pmV1lul4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7577 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 spamscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: IA6Ml7m6P9lB3AsL5GPFqB9GvyN9Ycfn X-Proofpoint-ORIG-GUID: IA6Ml7m6P9lB3AsL5GPFqB9GvyN9Ycfn From: "Darrick J. Wong" commit 6b35cc8d9239569700cc7cc737c8ed40b8b9cfdb upstream. Use XFS_BUF_DADDR_NULL (instead of a magic sentinel value) to mean "this field is null" like the rest of xfs. Cc: wozizhi@huawei.com Fixes: e89c041338ed6 ("xfs: implement the GETFSMAP ioctl") Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang --- fs/xfs/xfs_fsmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c index 85953dbd4283..7754d51e1c27 100644 --- a/fs/xfs/xfs_fsmap.c +++ b/fs/xfs/xfs_fsmap.c @@ -252,7 +252,7 @@ xfs_getfsmap_rec_before_start( const struct xfs_rmap_irec *rec, xfs_daddr_t rec_daddr) { - if (info->low_daddr != -1ULL) + if (info->low_daddr != XFS_BUF_DADDR_NULL) return rec_daddr < info->low_daddr; if (info->low.rm_blockcount) return xfs_rmap_compare(rec, &info->low) < 0; @@ -986,7 +986,7 @@ xfs_getfsmap( info.dev = handlers[i].dev; info.last = false; info.pag = NULL; - info.low_daddr = -1ULL; + info.low_daddr = XFS_BUF_DADDR_NULL; info.low.rm_blockcount = 0; error = handlers[i].fn(tp, dkeys, &info); if (error) From patchwork Wed Dec 18 02:14:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912912 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 923B77080B for ; Wed, 18 Dec 2024 02:14:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488088; cv=fail; b=btQcJufXtOJc/EPUOv4yClM0HW9SwW28gYXGpB+O/gPrF4mHa9Xojj+qAWOgvoyiPl2Ad2kgcI3uwpm/QsT/hoSwUb8IoIKfOvsz2fMkXiq2ZJfqgb3XrQML19WFwo6oqKsGSDVIhLeyK4rwKdJUhQhdDla7WLZ3v8AWvNTpS+M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488088; c=relaxed/simple; bh=sqtIIKavIi7m4F0o4lde2qHXmd6XAisBPTYgw0yAUuw=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=FWc1zL9A1mBZ+BAmwFsI6t3qmkNc6PiOGS5zCLc9jvJA5RDVUuJvpkQTETSdIElCqnub9fJEvZBUOI5kUL99PV32jSJk0xeM1EeDOGZywiu733lvfyDVKp+IwEWiHCRRs6kn8/8qAiJ6ny5YKOBT1BXxCjpQOf2MUtCuapXcFDA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=AJQIF+dT; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=plrWI/2e; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="AJQIF+dT"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="plrWI/2e" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2Btqf029108 for ; Wed, 18 Dec 2024 02:14:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=2FVMfHGjaKf9iGKh3bOxlFU9UAkPOxsA8/T9if9UP7Y=; b= AJQIF+dTRA+EHrQ0v/g05HwCryZyMmVdNHXbPHfIb7WECJrgp79+7TSvevJ4XHPp lsBNT4iyBmX4C4oztTNdYxXp5O4L11uFk3sLj4TDtlzGCbh0j2H+62GrT7t9lLbt I1L4yVCYfzMmTpFnNMErIhMxB2NDbKtmx0kkD4BpjxBVZOg3ZhkdFveu0pn+0Ptv GN/EfuyCm9N5eECNdvnFf9HIwsbD9keL2YcYabJmj+NNuAUFazUPeTNcnxWFsYbB NFK+8W2jbUPYNk65lvIYvZMP1fx/iIP1O+3NzMD6WbR/XdhH2Q2pdMzmXCLAod+O yFnrh64VQoNtSxGw24kr/g== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h1w9ff86-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:45 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI1TX1R032572 for ; Wed, 18 Dec 2024 02:14:44 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2175.outbound.protection.outlook.com [104.47.57.175]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fffbh5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rhe+9C7PYhT21Ohugpic6PI20ZdBwZerln4IITnISJfo46OxfnS9r7Zrxym7wZZnmQRKy07z4q8NVJwaZ47QTXNXydyu6oQDFoX0CqIlibHy1fSpoi44PYh0oYjCEj3YTR/bMS+A6I8OoCn/9YvBLxeIa4GfJ1qUGY4Ffl5egypX5obKbLI6yOx4e+Wpz2a/i/Vo07HgJZZy5niOU3MmeGTehsgB30jFOQ5+qy9SaJpOKWKDXZQfqD3K2PqT0PMzjc9F96BvvXoTBuH3h/IB+bmJFLSa21Mlmbn7t/6od23CNodl7s7rW9XvzUtEi3xtCXpYNwG03ViJMXABRtctZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=2FVMfHGjaKf9iGKh3bOxlFU9UAkPOxsA8/T9if9UP7Y=; b=bocihWSUGRq005qhQlLBvVu8X1ggm3p2tpUqHqxvlBsAihQVcEbOLrtIJYzZb0F8vXeZM6XAIx5kc+cLHAyoGkQxtsKNumFvWEP06LzQ/qjr/aJKIS0m8I9n16pGTapWF73/kt8APwZFLSFkDYSIxSi9JQG+8ZweO/PwWl/H/s+YukK8lUYJFqXe/2rQ4KMMn7UxS0f9Oubyj8jk699KiSnB9o+/VkP1e6Kx4BkaGIUZJU/h27o+4uBstRZAaHZDGhHp3TMdoksN7Vc91MNl3/yNrKffY0/tNTL5YfdMTR6xi8ugQptB6LAwxZBiCyxmvr6WATjGpUmkgetH1az2vA== 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=2FVMfHGjaKf9iGKh3bOxlFU9UAkPOxsA8/T9if9UP7Y=; b=plrWI/2euTcjWkO8OXojzmvfeDOFSA9fa5gDnLaoIoh3/0wwcg6EzG6oLWjGAcaXnusSDWWkqcCYXA4ea1BR9i9dzvxGJqc3yvkd4kCseBjMzyejTCKhVoLmNtNP5MTlZxGmLTKs4KPVuy6alYGZP+tNTOY1YCHipdJzdGJ8zeM= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by IA0PR10MB7577.namprd10.prod.outlook.com (2603:10b6:208:483::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.22; Wed, 18 Dec 2024 02:14:42 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:42 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 16/18] xfs: Fix missing interval for missing_owner in xfs fsmap Date: Tue, 17 Dec 2024 18:14:09 -0800 Message-Id: <20241218021411.42144-17-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: SJ0PR05CA0181.namprd05.prod.outlook.com (2603:10b6:a03:330::6) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|IA0PR10MB7577:EE_ X-MS-Office365-Filtering-Correlation-Id: 49686fa4-b68d-4a5a-3bd4-08dd1f09bbe9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: V5MKodUPJtBUnkeXd48j64K66PLwro4kifeCaC1nYLR9q+kq4UshZFPnzyAclMgddAZygkegw8fNl8rWQ/D2q0aoU6yGVUGCnBAIXPeIJ5ybgLLrG8kI3KuTQ5SXGvmpvN8gUohXQgAZVvM3g9E6xkod466wc2n+GZs93u6qQO1vqlWVMHtrrfXztyraa6gLRwuXrUs/msfLhP1LWBUVxo6O20d2mKftCToSY2QhIv98RSJ4JNsfnoqbupBTKCVs/idGWCJ88/revU9L+eNFwjVJ/bzve+ZH41/m1yP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gCsDO7AajVx22/fkoJu81 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nzhSiOPBc/FCxiATnwalQ1VErlcRHZuV7266F/LZb/Ps8gyybxZyF2opho0OD9O5bufxFO9sGm4d8spe7NNoVdoXMWsn9XFgMabwk8CjNXApGfVXDh/Z5PhnnStgCz34z9UtXjnSK+QNSB2+rt034QyY4lHOcWthRBjhCwYbfqptEX070YLdAwTgSr6ndJemw6mQuzgEGTeIBLAjhfjkHOM+YhCNnh2xzyVVNnUtmTobd3mSARcxPvj37JOLeXWZwMgHLHaBIViqQHH5/FAu/6YZPDEktn4AjNRlrTQMNttxeTfMBZrwnJmbuGDfoahuEj0m9YGjZUFTFsgAVCkx9HRfAg9oqCXak0/mYsaixAAesXLixBOkJpfl+e0hfwVMPT2CkaC57b/Re+c+j/jywxvo8zoYFfEE/pj9b3mCfV7Y4m8PIEWuXFDNA9ZbjjxOPzSq10jnZlsU6M5xaqDCu386iFjpensAttnOm2qW4Cxutf6Riw1EMXQIHKXGY1dFB8vINWzxhdrfWH0r9II+AXIJPCkDV+ii+E1MJVwAWtzrxlWgYZy9UGsLR1/KF6vDiue0srC17QiVkEB0cQPQjkShV4aB1cO22oKN8SoEv0cCAkUFsJL83xHY7jhdjh6yvRZtmTCSvAdYhexAJ/GfS3yPawHHsfiev6GQrB2YtK73mGN05S7cOE7s+Gd3NzxfFEiNBfuD9axopcptJgTnnwK4aGU4pPXek6nTN5dlOOk9c7spyPFKfmxZEm4uANKgvCS+c8C/H7RItpbrNbCLqSz1X0aV7UTo0f7MpANnCxIjUKA5jXr/oYZM7UNu6dHlQ7wK3pQ7TP2NgGjiKj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T2qt9kjfa6E2gZ08OrZaO+i5AMgPz19TDBiLha9yu+TIgL0FbSDXFfF7MzEC5AqrEQi7mTrT80oocRC3M8x0MsWyZVIVFv3dVXHEw6EtAkwpdbS5IYg4g+5lcd7mfy5krfEq0gwLZskSP3I7eFycYx/adNBfrK2R8srXyERMytqtmRAmqUcDdfK7Pm0UmImxOQX6yd60uEfdKn1F1N6U/2u0XSJRwilgERVXuKCtc6rs5M/4Q4aEHnvVA+mj9npDXYELbOIb7R4sTjMtI1z96JbQL56nUSUSV1YtJQ3KRe2nENUJN15MCkE5+9bo7L8VQMYQOxua1j8m3ORL+odpplp8laJ1qZcl4z0lTx36CjL4MOEUiSaozv5qRdlLw5hpEXWTtH+5Yq8V6Nd4Z+q4LWyLKBx/dxmygUXNLiLr7GDuCzhrR6cTPiIjNRdJWmnNU97Zow= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49686fa4-b68d-4a5a-3bd4-08dd1f09bbe9 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:42.5727 (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: 2GwIYn5HJvfHFJgOj4812oSkpR/JE0db7ObueVmSZMOOveOiXIRALRxcbwNOPuiaMRzwEalkfl7179WZXruBqguE8Wrkxaeqlyfug+PswEQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7577 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: 2q08U3ScIqoBh2KT5fNyMmn5ZXeMvluN X-Proofpoint-ORIG-GUID: 2q08U3ScIqoBh2KT5fNyMmn5ZXeMvluN From: Zizhi Wo commit ca6448aed4f10ad88eba79055f181eb9a589a7b3 upstream. In the fsmap query of xfs, there is an interval missing problem: [root@fedora ~]# xfs_io -c 'fsmap -vvvv' /mnt EXT: DEV BLOCK-RANGE OWNER FILE-OFFSET AG AG-OFFSET TOTAL 0: 253:16 [0..7]: static fs metadata 0 (0..7) 8 1: 253:16 [8..23]: per-AG metadata 0 (8..23) 16 2: 253:16 [24..39]: inode btree 0 (24..39) 16 3: 253:16 [40..47]: per-AG metadata 0 (40..47) 8 4: 253:16 [48..55]: refcount btree 0 (48..55) 8 5: 253:16 [56..103]: per-AG metadata 0 (56..103) 48 6: 253:16 [104..127]: free space 0 (104..127) 24 ...... BUG: [root@fedora ~]# xfs_io -c 'fsmap -vvvv -d 104 107' /mnt [root@fedora ~]# Normally, we should be able to get [104, 107), but we got nothing. The problem is caused by shifting. The query for the problem-triggered scenario is for the missing_owner interval (e.g. freespace in rmapbt/ unknown space in bnobt), which is obtained by subtraction (gap). For this scenario, the interval is obtained by info->last. However, rec_daddr is calculated based on the start_block recorded in key[1], which is converted by calling XFS_BB_TO_FSBT. Then if rec_daddr does not exceed info->next_daddr, which means keys[1].fmr_physical >> (mp)->m_blkbb_log <= info->next_daddr, no records will be displayed. In the above example, 104 >> (mp)->m_blkbb_log = 12 and 107 >> (mp)->m_blkbb_log = 12, so the two are reduced to 0 and the gap is ignored: before calculate ----------------> after shifting 104(st) 107(ed) 12(st/ed) |---------| | sector size block size Resolve this issue by introducing the "end_daddr" field in xfs_getfsmap_info. This records |key[1].fmr_physical + key[1].length| at the granularity of sector. If the current query is the last, the rec_daddr is end_daddr to prevent missing interval problems caused by shifting. We only need to focus on the last query, because xfs disks are internally aligned with disk blocksize that are powers of two and minimum 512, so there is no problem with shifting in previous queries. After applying this patch, the above problem have been solved: [root@fedora ~]# xfs_io -c 'fsmap -vvvv -d 104 107' /mnt EXT: DEV BLOCK-RANGE OWNER FILE-OFFSET AG AG-OFFSET TOTAL 0: 253:16 [104..106]: free space 0 (104..106) 3 Fixes: e89c041338ed ("xfs: implement the GETFSMAP ioctl") Signed-off-by: Zizhi Wo Reviewed-by: Darrick J. Wong [djwong: limit the range of end_addr correctly] Signed-off-by: Darrick J. Wong Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang --- fs/xfs/xfs_fsmap.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c index 7754d51e1c27..560e61283c22 100644 --- a/fs/xfs/xfs_fsmap.c +++ b/fs/xfs/xfs_fsmap.c @@ -162,6 +162,7 @@ struct xfs_getfsmap_info { xfs_daddr_t next_daddr; /* next daddr we expect */ /* daddr of low fsmap key when we're using the rtbitmap */ xfs_daddr_t low_daddr; + xfs_daddr_t end_daddr; /* daddr of high fsmap key */ u64 missing_owner; /* owner of holes */ u32 dev; /* device id */ /* @@ -182,6 +183,7 @@ struct xfs_getfsmap_dev { int (*fn)(struct xfs_trans *tp, const struct xfs_fsmap *keys, struct xfs_getfsmap_info *info); + sector_t nr_sectors; }; /* Compare two getfsmap device handlers. */ @@ -294,6 +296,18 @@ xfs_getfsmap_helper( return 0; } + /* + * For an info->last query, we're looking for a gap between the last + * mapping emitted and the high key specified by userspace. If the + * user's query spans less than 1 fsblock, then info->high and + * info->low will have the same rm_startblock, which causes rec_daddr + * and next_daddr to be the same. Therefore, use the end_daddr that + * we calculated from userspace's high key to synthesize the record. + * Note that if the btree query found a mapping, there won't be a gap. + */ + if (info->last && info->end_daddr != XFS_BUF_DADDR_NULL) + rec_daddr = info->end_daddr; + /* Are we just counting mappings? */ if (info->head->fmh_count == 0) { if (info->head->fmh_entries == UINT_MAX) @@ -907,17 +921,21 @@ xfs_getfsmap( /* Set up our device handlers. */ memset(handlers, 0, sizeof(handlers)); + handlers[0].nr_sectors = XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks); handlers[0].dev = new_encode_dev(mp->m_ddev_targp->bt_dev); if (use_rmap) handlers[0].fn = xfs_getfsmap_datadev_rmapbt; else handlers[0].fn = xfs_getfsmap_datadev_bnobt; if (mp->m_logdev_targp != mp->m_ddev_targp) { + handlers[1].nr_sectors = XFS_FSB_TO_BB(mp, + mp->m_sb.sb_logblocks); handlers[1].dev = new_encode_dev(mp->m_logdev_targp->bt_dev); handlers[1].fn = xfs_getfsmap_logdev; } #ifdef CONFIG_XFS_RT if (mp->m_rtdev_targp) { + handlers[2].nr_sectors = XFS_FSB_TO_BB(mp, mp->m_sb.sb_rblocks); handlers[2].dev = new_encode_dev(mp->m_rtdev_targp->bt_dev); handlers[2].fn = xfs_getfsmap_rtdev_rtbitmap; } @@ -949,6 +967,7 @@ xfs_getfsmap( info.next_daddr = head->fmh_keys[0].fmr_physical + head->fmh_keys[0].fmr_length; + info.end_daddr = XFS_BUF_DADDR_NULL; info.fsmap_recs = fsmap_recs; info.head = head; @@ -969,8 +988,11 @@ xfs_getfsmap( * low key, zero out the low key so that we get * everything from the beginning. */ - if (handlers[i].dev == head->fmh_keys[1].fmr_device) + if (handlers[i].dev == head->fmh_keys[1].fmr_device) { dkeys[1] = head->fmh_keys[1]; + info.end_daddr = min(handlers[i].nr_sectors - 1, + dkeys[1].fmr_physical); + } if (handlers[i].dev > head->fmh_keys[0].fmr_device) memset(&dkeys[0], 0, sizeof(struct xfs_fsmap)); From patchwork Wed Dec 18 02:14:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912913 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E456D7080B for ; Wed, 18 Dec 2024 02:14:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488091; cv=fail; b=eBLSKzgIJtebOKwaxMgKX0aBW5OEpsAni8/p1fB4p0b6fZPCuGaUZkkEhSXSwH6qtlawiC53YsE1pclwtrFKHcWFuGnVasBiyl/Y955O+4AilGymkFsG85KWtuYkR6V172GuB0BUPpg6/befMcZGD1Xocx73cb1qo2OUaRW6bQo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488091; c=relaxed/simple; bh=GwsUUx1qm8EHRzimS5xBi1Z1pFli2DGiy7xplOkKeUU=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=aXwEAzvbe9gkU7j7QnYSMsHHJJ7wylObfK+/ux+Gpqm9+JeqxSLTuko1js+TkMzmEQ7hR7Rn724dPnRqJmDfy45tCzTlV2DL0ZBc3tTCVhj/9Iz82sKl3HGHwnGckLJv9vuSdz/PS9wTlAEuG+eTdBJK97J4D4pcz5qPGV0oFSI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=kcrBXSop; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=uQyHMcPD; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="kcrBXSop"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="uQyHMcPD" Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2BrOT001474 for ; Wed, 18 Dec 2024 02:14:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=HY4nLa1O9te6j0Isr+qwLdMhpGzWwE/7k/cy9SWr61E=; b= kcrBXSopYg0Uk1s+v8aN8c5p/5wtRTSeLlIHK/+oi/blqZ5ehfh/n2/JqsZBW02Q KSqqgACofdiVQbay/tx5toi/2RR4fHNBhp0lXC5sATYzP69A7C2WdfkIdfGe+WiC HYa9axqLl9uvgYRzVkXQvFfps4ICadqfVb7EHlbybZ9AAc5++yXAdSBTXawCY/7T xQ44aLWh6baMZzpiAZO4CiZtUyzAJ5NWjjzcfZ7yB09HIXbOpDeXKFyZsBsTHJWk gOYdT17W1+ZGdPDFrJw/OYnOXzhk+DSSfPCBwnQa3aUnqy7BOd6cSzLmkuyuCldB RIJEKmDMO6ZZjb+j8KTP9g== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0xayk77-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:48 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BHNo3ds035452 for ; Wed, 18 Dec 2024 02:14:46 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2171.outbound.protection.outlook.com [104.47.56.171]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0f97yj3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HwsoK0oAFAQwP29VRVekA2C6YCTMqsxKmZaBtgQseV1z9o5B/CWHR/sVtvgWTEri91mwUpfyXt/JWnpKcq1bIbT9hynlxN3+ZOXNapALQO3lLGYAtxqdpKAKWg6MNZRmQEPzlEGDG4C93JsiGiwaiPkY/Ik9yLe9MMzIIxA7hc+iKwtTKOLUw1KIIovaVCsr51O2ebDKOwxcRPzQ7JMIphHnr0JTjEcjQU8UOi0rzwaCrOstWsVwljtD59z7U95kuqPplK9EF7Po+J5YneqEx/g0O5P87h54dii3NWAA1YLaqmxpVjrDmDpHzN+zS6FnWBoQHax4sHgHDQTjTn3ahg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=HY4nLa1O9te6j0Isr+qwLdMhpGzWwE/7k/cy9SWr61E=; b=vYB5fXjjsdFHx2yKUk/VaIPCec+nmtsslCZ8b+KkQlOa+mGnxFB3iHPVOctsgp9tslaLWy+AVeVcc3q/d9BV7xic6jPtUXPz9M00+15ezpWzurxMX9Kr4AHu6IOEi3gmIl6sPBRHeoXvtAJe0oRmSNTxjHvD9ufWOJLOQegUK/HXv62uAMAAfwmfCTukbeT0ggOVJBrvPwvk+URRD8pRiA6HENmNfUkrcKxA6zmvYKQlmmxAH4Y4A/SdIMEXLbcyUcKrbqrxwqVon1GMx3jYJq+j7jsll9dZpfMErswWJjKknRLa7GjHvDcOnrTSVJ6O2SK98TAdLGzIW4TXp4Nakg== 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=HY4nLa1O9te6j0Isr+qwLdMhpGzWwE/7k/cy9SWr61E=; b=uQyHMcPDBEy+yfzkg2kGl6UziXy02KGcKsGxI5PIHLoiz48WrZYpvAHSo6Hvu/0kMqmpsI5gaYLAJDyWvAHHu0OihG9qXclNYXUa1IGiq+7i8l+SwAvdXozs2+mQZm6mZL5rvB8rdXIPopjBw6nBqGEe66qaOh4ErzzxVm0fJDA= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by IA0PR10MB7577.namprd10.prod.outlook.com (2603:10b6:208:483::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.22; Wed, 18 Dec 2024 02:14:44 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:44 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 17/18] xfs: take m_growlock when running growfsrt Date: Tue, 17 Dec 2024 18:14:10 -0800 Message-Id: <20241218021411.42144-18-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: SJ0PR05CA0198.namprd05.prod.outlook.com (2603:10b6:a03:330::23) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|IA0PR10MB7577:EE_ X-MS-Office365-Filtering-Correlation-Id: a42bda28-d07f-4b2b-8e07-08dd1f09bcf4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: eCFjSvFSj+bv1WpWhinnXUNwtbTpIp4W9+Qa9QEvvU6Kngu9GCyA51gG0i9Sn639gPGoGbGQOV2Adj/gO5TuR0BEdWTqtfU6R1/0To6uJBDtILRPqmFfn6Sp6Bsfg2JStJs8WuoNB5ZFSGTUL6WfAZrDHLH5KXU0C/RRRDSUti7DLEoOpPmCZD3S6y8vVLF64GbLyG/Uk23TBoDawD7X6tNG7A1vHIj1bkJ5gklU7weTX1AHPV4Ykb/BkFx3f2sSMfd1UpyEGO0zst4RlzYX7EnEZsop4IgMK67Y6n2Yv4AxGkGIzaFouabcWunDRsw/kHx+LWLlV2s0UyieHEHOpbhfKN4t3FvMG4D9e8k4+sewQtB0Vb8RYWnfuguxzj65os8WSgmos52ovBS7i1qheN3ZvchHDCgeoyzQNMl6AJfNKcnbfvaQ6zfwdeKWJuZHLCP8SGWXSQazZI1wlBbqLQ/OBhE4EkQZq0ZF7OfZHHpyFxjpLQqAoGLW9dROjS94xgrB33oKyB27H6vN/n/iFptlzqPMvHrRV/YgZiUSC6ddRX25DSCzHqbX9FZzQTpfShgHAUuSyYDY9xN0GmRWn41kpYhIV/GZ+qrCO7DkCJ1PsFKBZoCskvYPmZCJFy950u99xSTrq0VVjK/yLQ2K68J7mywKfG85eyThhmHsvHjgsRwQjsQjhxTXk22KYUF+bNGceT9v/siI3whdVezIfaPTRJbk5I/vRN3k56s7+QV+BM9Xv5XdpZig8vBCgKgVnhoJ8lDq2w2fMuHaZPkFoz3gbv7xwvdQjevj7Fjl5C/jK2XlqAdZSxrnPj4DrzGUusVKTo7jtnsD8dUNegmj13hLwaOOtOX+Di3gQ/lE1CM3MBsoj4f8WDM5HT8gOq0g7mXZqs06/w+f5agUyZyEGKIjLl4EXEBd1cHgXi+fko3bfL5l/VfPWgHDk367/R4mjAC1LWvqELC0lHuACYXc7tjVk/V5wSWw4RNO8UjPLXlM+3qdie26/aMVpFsJ2SKtl3sXq2wnAISvxE+A8IB5444W8Mti2o9YwW0p4ZT2xdonIH6k39VVIIoyMsjCZFmV4wzdtNJADiqQdvCx0YqCVhmIJBkusdg5fHuTo/gT7VfvL+Fksv0lagyfKG5OQyZ6MPZA/ysQE9M/F8W0GT83h8BXwxGuv6apLKSI4xMNqFK1HIoKoKgI/1poq9q8XNKGo0g087Dl7HpkSQrSl1EEctkcx9Ye/Y14Higin6a9kPMsAtMDP2LjWOFPcwrcicZ/zQ78Js0657sdFNrk/EOz0m9d1TAPcbLhNlfITxf4zzOKVnHO5Is4l6BiUpWVq3D4+/ILVvis3bJJLI5cD7iR/RjOztdmiRsuohEG9Xs6wZs14PgZw9Rbr/ilLXtt5spp X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qnJt+JSicWoyri4ZWLHQHscMjnNT5cJyID3G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mudCyas+oJflqew9Of3NwF/L0GCQfYX26FgWBZol+eu/J9DErmactb8dEmrcE3DfoO+jN58ffeK+YW7wanN++n5i2xDO2hgmM2XDPnS+mra8ynYAXjY/f5Xx5Hn3j180+/DEHvOhbjYQnupjT9K7tErhF9oXgr+a5SQpVtlrFmvBY7cIVSpYOpm/5CGgS614+RlRmRBdiZ5UVQoaM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a42bda28-d07f-4b2b-8e07-08dd1f09bcf4 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:44.3514 (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: jWFISjRrb8kyYGJcOju/s98C9JbhnLSu+t/Wi6Vl4c9dCs84/WNJPGRsosmrvd5JYn+vcK8hBvbW7i3R5zRfWfOreIwpHCkpfJfNh+Ml9B4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7577 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 spamscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: z47kUkdRIL8Z9ieV6Ryi0hT8m2j0HYYs X-Proofpoint-ORIG-GUID: z47kUkdRIL8Z9ieV6Ryi0hT8m2j0HYYs From: "Darrick J. Wong" commit 16e1fbdce9c8d084863fd63cdaff8fb2a54e2f88 upstream. Take the grow lock when we're expanding the realtime volume, like we do for the other growfs calls. Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang --- fs/xfs/xfs_rtalloc.c | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 608db1ab88a4..9268961d887c 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -953,34 +953,39 @@ xfs_growfs_rt( /* Needs to have been mounted with an rt device. */ if (!XFS_IS_REALTIME_MOUNT(mp)) return -EINVAL; + + if (!mutex_trylock(&mp->m_growlock)) + return -EWOULDBLOCK; /* * Mount should fail if the rt bitmap/summary files don't load, but * we'll check anyway. */ + error = -EINVAL; if (!mp->m_rbmip || !mp->m_rsumip) - return -EINVAL; + goto out_unlock; /* Shrink not supported. */ if (in->newblocks <= sbp->sb_rblocks) - return -EINVAL; + goto out_unlock; /* Can only change rt extent size when adding rt volume. */ if (sbp->sb_rblocks > 0 && in->extsize != sbp->sb_rextsize) - return -EINVAL; + goto out_unlock; /* Range check the extent size. */ if (XFS_FSB_TO_B(mp, in->extsize) > XFS_MAX_RTEXTSIZE || XFS_FSB_TO_B(mp, in->extsize) < XFS_MIN_RTEXTSIZE) - return -EINVAL; + goto out_unlock; /* Unsupported realtime features. */ + error = -EOPNOTSUPP; if (xfs_has_rmapbt(mp) || xfs_has_reflink(mp) || xfs_has_quota(mp)) - return -EOPNOTSUPP; + goto out_unlock; nrblocks = in->newblocks; error = xfs_sb_validate_fsb_count(sbp, nrblocks); if (error) - return error; + goto out_unlock; /* * Read in the last block of the device, make sure it exists. */ @@ -988,7 +993,7 @@ xfs_growfs_rt( XFS_FSB_TO_BB(mp, nrblocks - 1), XFS_FSB_TO_BB(mp, 1), 0, &bp, NULL); if (error) - return error; + goto out_unlock; xfs_buf_relse(bp); /* @@ -996,8 +1001,10 @@ xfs_growfs_rt( */ nrextents = nrblocks; do_div(nrextents, in->extsize); - if (!xfs_validate_rtextents(nrextents)) - return -EINVAL; + if (!xfs_validate_rtextents(nrextents)) { + error = -EINVAL; + goto out_unlock; + } nrbmblocks = howmany_64(nrextents, NBBY * sbp->sb_blocksize); nrextslog = xfs_compute_rextslog(nrextents); nrsumlevels = nrextslog + 1; @@ -1009,8 +1016,11 @@ xfs_growfs_rt( * the log. This prevents us from getting a log overflow, * since we'll log basically the whole summary file at once. */ - if (nrsumblocks > (mp->m_sb.sb_logblocks >> 1)) - return -EINVAL; + if (nrsumblocks > (mp->m_sb.sb_logblocks >> 1)) { + error = -EINVAL; + goto out_unlock; + } + /* * Get the old block counts for bitmap and summary inodes. * These can't change since other growfs callers are locked out. @@ -1022,10 +1032,10 @@ xfs_growfs_rt( */ error = xfs_growfs_rt_alloc(mp, rbmblocks, nrbmblocks, mp->m_rbmip); if (error) - return error; + goto out_unlock; error = xfs_growfs_rt_alloc(mp, rsumblocks, nrsumblocks, mp->m_rsumip); if (error) - return error; + goto out_unlock; rsum_cache = mp->m_rsum_cache; if (nrbmblocks != sbp->sb_rbmblocks) @@ -1190,6 +1200,8 @@ xfs_growfs_rt( } } +out_unlock: + mutex_unlock(&mp->m_growlock); return error; } From patchwork Wed Dec 18 02:14:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13912914 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD9B1481D1 for ; Wed, 18 Dec 2024 02:14:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488093; cv=fail; b=ivOJH+UvBpMU07PKDax/0jNRcyCt1uQeMs8O1wggHB8PhF0BHuCoU8Tbv0Lyo2jGIziIteaX2YIlpG9QYvCPLB30c++1KgAHhYQeuFhTPcLLj2a/xNtgHFsH20lOmYI0LdKLz10vn9B7Z+kmLKagtvtxGKUxtkRzKgZjbqBzmI8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734488093; c=relaxed/simple; bh=DyT5CsR37T1QglstUHzgJTWLdV0MleVK7IWNwMmwpA0=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=uHsrDyola+2fCHonzM/hw09pJpnT37QruxEs1fuoSvJ9MOxhtcHL5gMEG0PmGi1So2kyssCSzUs6vJIFBdUjwgFs3u4P+eEn2FyJpbveq4CQkes3lj14mkcXm8ygMFV6hnKa1xQIrf0lzpgPQxDgJ5HGL16TxYIa3OyDnqk3xD8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=XD3uGbA9; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=CZseFP+z; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="XD3uGbA9"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="CZseFP+z" Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI2BqAZ004590 for ; Wed, 18 Dec 2024 02:14:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=ci6H5fUahLW/ypWpJtggf9+ClHUWMn14g9r/1wXIqpU=; b= XD3uGbA9+NJOUo8RU+bfdo8jKLkjSOmxM1RiFt/8/Pn3niiIaZUt7HitdRrTrtdX V5oJhrSIGvRbCQxX0H0aGlkj3BtqHlD30cMYhoERkjTubxu8496aydlGSnLcU+sX SXVo5S7wSgdsB1xHXplS8afMI9r99Lii8PxCO/gk0pbF/BUX13cUR4vFbyHam30k 5qW/kXKgD6KLa49+NwXyzqBCs1fAAfZKOb03Rtz98RWX5dVLBg6Mf4Wfev8SESX+ PlSvZI1AN/9JAZEigoARuBNACcSfu/VgULGyF5bkUaT5l74b4w4TzxM6rZ9FjOXY ZJrqk0ClrghBluvr80SdLQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43jaj5db9j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:49 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BI1x6Hj006392 for ; Wed, 18 Dec 2024 02:14:48 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2172.outbound.protection.outlook.com [104.47.56.172]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fa4ws9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Dec 2024 02:14:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uKJ0nl51cXtabeskQgOT38GMQYGnsvLZKz+3ACe2cWw4iHCtZW3NW+Wt9jnNgHjfBjd8Vosqz/Efr0pkFadKn4+ySzz9TgSA1gViZNJO5FzCpapyLHZRLkzYgtngDUr2lclnYnE7/Obo9bhtrhHmO59wOCoGBn00y6Fx/BBX9F+EZ760ha7AIFmJjWATjEnWQeVHOTGSeY1xlpyvckryltNFMlq7Z87PrzW4d8bJLSC2QWxFdrgQ5ag4afNyIUEP9hQJcQ44BGOqigT5fMPOqIJvrCdlDnmVHQHXDdjrnAMWNdV5jb/GO3aFPlONPv1ijLnvAFfKLjSLL2yxMmxqEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ci6H5fUahLW/ypWpJtggf9+ClHUWMn14g9r/1wXIqpU=; b=uW7Vdd4Djvc7/Mr3sW76lja0DUSUK2Y0HwFmAbUP1BVncOgo+jEpXvQl9i0atviiYFSjAFOZdNoxoGdYot6mreAzwa6r3F8umtnDzEEnyi37Ui7k5t03dyxcEAHg/qYYRePhXJNOjRtAjZqYSN6wuq1lY0N8whzHd+yGAX26xKtBAdsSzG+ncPCVBOOnLlFfoKNPTri+s2B8c3VkiExWmT6GNbv4BVOFe5IJiDJiEzqdzlVJCFNMUjNpFxhVwKA08pcswEuw49WxNuvd1x3ka8FGVTC+s8Cf94WSPDEPFlCHy1fzYF3r6+yPgVaXiGfS8owjogEVNUFFvbEbWOaWFg== 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=ci6H5fUahLW/ypWpJtggf9+ClHUWMn14g9r/1wXIqpU=; b=CZseFP+zy+/RnzTEhACnJy+7B6cgiJAvi5WRC4yxb0S64sVoWd+9jfdznHwhT6AuH0k4YxnrW37id8sSV3i/qfXb1EgsG/DutuyT+u+EW45IcBnV5iuQfZ1wahWrW0Ojbdq6/8Rpt1xfQtNZzvJdO4EHMy0IdBCdH3xUPQffU6k= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by IA0PR10MB7577.namprd10.prod.outlook.com (2603:10b6:208:483::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.22; Wed, 18 Dec 2024 02:14:46 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.005; Wed, 18 Dec 2024 02:14:46 +0000 From: Catherine Hoang To: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 CANDIDATE 18/18] xfs: reset rootdir extent size hint after growfsrt Date: Tue, 17 Dec 2024 18:14:11 -0800 Message-Id: <20241218021411.42144-19-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218021411.42144-1-catherine.hoang@oracle.com> References: <20241218021411.42144-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR02CA0052.namprd02.prod.outlook.com (2603:10b6:a03:54::29) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|IA0PR10MB7577:EE_ X-MS-Office365-Filtering-Correlation-Id: 1106f516-50d9-4a7d-465e-08dd1f09be0c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: N4C+PI3u22xyaqv9bESiLr0nOFNcfsCJ18w9powtEabgBOXvBHZPZTNQHBfYSEIdGpI0xsWjRp/Ifzdr6yjS6LeRsseHUIQ1wkoSw1HI7gvJBVYV8VFhyjDjEbPoJvLWUZPX05hBZtU5Dwz0OLnlw4IxSF4MZyj2FrelyDp2VtQg4lls6uZbjJv4hSD2kk4qJ63POstFwLtopc1vswXiszKU7lHcPGVSualR2ru1Vbg567bplbcBps4PchotvrcDsfFs/qOzuupKMgJExGuUtWrORE68K8f9rigp4KCWxuv28M91UtHReTFtYIgVoooOT/Qdt5RggYVQrLOWfiwyeFjGo4ykxpJi0lDH8UWgSO50pRbHy7QbXxw26TS7TQUTtP6r/StxuoZP2z/nhzZZag20D6c+ncKl3LLA4qor6gIO+KKBWIwazE+SpBjexg4P5Q7ADDpnHd1WOVYS/l5YyYZmFwqtukTOo/htPmf9g3EauUzrXJFrzdf2SVfQls7Uy297I8it4lF3nKbfG5EXoRGsIToO2l0Lj0CGeUWvw3dc4yZJ+Q1XpYngG2ypvVgfQR2c9cOK75c75VlarW25yIEhGgIg1FZewQtSjLWFXx1ER3EPeqZNrpEw2IxyfAw8pZuu7QlSsVKIJHBwxrgiqFmKjJy8uFBKwDE35lvmIJu0oUi+M7saepQbCvCH/cVdhU6YqTKChqh6Vx5HsT/ZL6BAbB+q8CMsMbBcilm9N7gllZGlc1JaeKUGXYzcjIXIuSF+DRGaoSWaVXSJW/J9V7McqU/jI0mY/L4Y9fI4L0QfSY0D6dm/OmS7yBXMqiG9kDC5PQW92T+HTJQ4y2ySsrCQeQ51PmdvgGJI9BG7bSb+r7u3toVzDDcjznu1xA1/kcGduMzZVOuBPWNhVEiR6C8AMTU0mK/Jo7Xs5lrD2AwW739sYR5L7BXQYeYgw1om7X59RnF8ypcmAjPjiATsHskP8DFc3jnmySOkcMk4+4qMoIDbpDJJGDgHmvTskcSJ5k1XrgFc+NyoyTxaHp7FdFzBdZBrhZ+5yg19gnIreOHNizNi3T95sYsULk269fVCVW2OOOoBy3ipIE0l1vo5l2HXBctTkA0LLN0KMeKufhGZzyJsJrTYPU7HeRMkMEBy2L8kdneXrtroj0mbYgtvTiw8LRkMJHI16xi4vcKcfwScnXbSGoEAGa1/xVec6iHXbb+skJWydjk0ak948nE1YDlF2AePTPtOHyxS0ZBQrZaYiBhwQJxOOavIEwYRjMbZWlDZoJf6ibfjZFSrzYlcN7F/1Ov13rdXLJREwprygbqpMyxODH7aArFijABkB+jlpBUwBBby1sUdicTIVWQ/cMMGgqlyLM9LGAm8uIN2aV3SSFE2ptxh6/falaCJfCH0 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: O2TbXdhEmwhwpdAAiVWWL3qsZX1f/yApmHZAirBMmRxRDTdU7tT9Swbrk8DnBrlU5fIRLFxKiViuLzoZETS4lTYGE9OqvmWzquNDLQlFvvAsnicRQ1xYtd2laO2lrnLi92bDhPDo7O/UvgHZ6jdLzv5PhtDwQ2rfOJQi+1+C48m00hH/taW4Gi4oFXfcuURfRvEDpoZrXB40yFRKDFMTdeFIi4mdVc43QJxRJP5fv9jzllNnHNOh3y/mcWgSM2MRy/HWssswrMmcDM21k+HS0LpEosSqkfrNXOtX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hmAqVrUPR2lS9X+feZqe+L2ylgKobCmWbBkzzgs99utI9I07Pr7hw4PK9EZ+031zwExUAdo/AJzt7YqZAzjDNuNnxoEr57F4s5gYMZ8/ogXwV8w9s4qVvtPbQtlso7yIX5AUGBmiScIaeO7Pb3elreNqXuoefursYV7xVDATjhVncHZU7Ck2MF+biJDTYlcEY5MbvFToWL6zwESpBMpmqiByrWBdL3UZF5GKxm/562swrzzbXotCA3KuH806Iz7tivGSUd7ub5N89irniX/dI/mrwEkU4sYM3ADY7Md/DTQLBpl7oGVUN8N3QLmvKAw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: XHgNp6Nhcx8j9wwd1s31ZFk2KsH4dsldUZR/Yj5aTBgtyHTUsrX/IEhW6yv1WxDlS5MoqCYcmGGemKCHtV8Py09hi4g3oduIcxlOgKxwRSUj5kdxuDLNMIi003eC4Y5QTTi7jJo0U1gs+WYzYtph6mvkUXFr8tMX1S+T1EfCJBr8zUUdzZYr/s3iALet+x8aQvu26r5J7nci9LizPI97Qj5y9jLtjF/P9eywi/donYmyX3kM1j7EiO7l6fgPtXdMxT40tvx8v6mibahDnAiuotSPZjx4hK+R+HX2YCKUu30TnJmHvWdwwdfgPdRDsuROofJ+b1W5pVMrMqeCJ0wRoQkZBajYlj4yU4cZj9E/d6gbS+5Syw9z8qCnc9RQ6QotCEjHyF5n02t7VSVJEPJpmCAuNmOiAemjC84kTM65nP5nQj3A0COrTbeTIBX1ablOqL6FG+X/6taibPCgPeZamZplbZfZ+g6LlCtHaK2iNjZXDGJ5NH0xTRBVuQhrSbWNTnjMlhLHHi5PlUAqHCf2cdk+mheje1YzIa4A2wkCwQA0th2SNyjSRUBrZwqSIRVWng98nTYN+J87Uegh8GD7y3KrwzLASyD3L/pmCarleO8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1106f516-50d9-4a7d-465e-08dd1f09be0c X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 02:14:46.2698 (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: LJ5zGr9GXN+GxvArxE6a5BkxuQ9h8O7tBa4iDvagBiXL5f37ivUm+NPt4oIKra8+XiiDOL9LZ1c31PjFcPL+1EU7i5drgVHiIZ3RgsOJnM4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7577 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_01,2024-12-17_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 malwarescore=0 bulkscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180015 X-Proofpoint-GUID: 2wj3nSvYSp8RV7qpEV8HW-0e-fh4qCUZ X-Proofpoint-ORIG-GUID: 2wj3nSvYSp8RV7qpEV8HW-0e-fh4qCUZ From: "Darrick J. Wong" commit a24cae8fc1f13f6f6929351309f248fd2e9351ce upstream. If growfsrt is run on a filesystem that doesn't have a rt volume, it's possible to change the rt extent size. If the root directory was previously set up with an inherited extent size hint and rtinherit, it's possible that the hint is no longer a multiple of the rt extent size. Although the verifiers don't complain about this, xfs_repair will, so if we detect this situation, log the root directory to clean it up. This is still racy, but it's better than nothing. Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang --- fs/xfs/xfs_rtalloc.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 9268961d887c..ad828fbd5ce4 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -915,6 +915,39 @@ xfs_alloc_rsum_cache( xfs_warn(mp, "could not allocate realtime summary cache"); } +/* + * If we changed the rt extent size (meaning there was no rt volume previously) + * and the root directory had EXTSZINHERIT and RTINHERIT set, it's possible + * that the extent size hint on the root directory is no longer congruent with + * the new rt extent size. Log the rootdir inode to fix this. + */ +static int +xfs_growfs_rt_fixup_extsize( + struct xfs_mount *mp) +{ + struct xfs_inode *ip = mp->m_rootip; + struct xfs_trans *tp; + int error = 0; + + xfs_ilock(ip, XFS_IOLOCK_EXCL); + if (!(ip->i_diflags & XFS_DIFLAG_RTINHERIT) || + !(ip->i_diflags & XFS_DIFLAG_EXTSZINHERIT)) + goto out_iolock; + + error = xfs_trans_alloc_inode(ip, &M_RES(mp)->tr_ichange, 0, 0, false, + &tp); + if (error) + goto out_iolock; + + xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); + error = xfs_trans_commit(tp); + xfs_iunlock(ip, XFS_ILOCK_EXCL); + +out_iolock: + xfs_iunlock(ip, XFS_IOLOCK_EXCL); + return error; +} + /* * Visible (exported) functions. */ @@ -944,6 +977,7 @@ xfs_growfs_rt( xfs_sb_t *sbp; /* old superblock */ xfs_fsblock_t sumbno; /* summary block number */ uint8_t *rsum_cache; /* old summary cache */ + xfs_agblock_t old_rextsize = mp->m_sb.sb_rextsize; sbp = &mp->m_sb; @@ -1177,6 +1211,12 @@ xfs_growfs_rt( if (error) goto out_free; + if (old_rextsize != in->extsize) { + error = xfs_growfs_rt_fixup_extsize(mp); + if (error) + goto out_free; + } + /* Update secondary superblocks now the physical grow has completed */ error = xfs_update_secondary_sbs(mp);