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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OSWGSVeKXZC4ubQgMJBs3g3Dh0PfI3c6FzcXyfeT++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