From patchwork Wed Dec 18 19:17: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: 13914064 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 AABF415749C; Wed, 18 Dec 2024 19:17: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=1734549458; cv=fail; b=Q8uRCO8LxZSX0urJP+Ql5hta7nfr+Ih2Zj60lOsoEhzpIHRXxc4m017jmI5AzaF53q8kO3zw6rjysOMqRWWFeOLt6EVfL0tjQt8vybgKPy+UC1exUxkGLVt5J2n95dZS7mHXF/BziUXZJFuZMSrfI6XHu760iiTNU5ODXx/P2m0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549458; c=relaxed/simple; bh=7HxoKly9m+RoU18pugAA9ipH7pPZdKfSO610fB05fXs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=hGk/5gArFIUSGIh6lGTAzXuDleBwIE3lgnwwxJYwCNxdq1+BDj/bIc69p3G7G+EaAp47Sv12ABuRiyqDdG2h44Yzu5zE3yupj6Ly69ZvqmFVASU6TzGJJX50b2jsdYiBGYhSMu0YDp1fcWicq+WdQ1JiNA8Dwb5v6pmGkyHcSgo= 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=MRFCbgAm; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=XXDUWLrM; 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="MRFCbgAm"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="XXDUWLrM" 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 4BIHQcm6024342; Wed, 18 Dec 2024 19:17:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=BgtgrnmHINNT6JEU8rfpoYiqQW8BCuWzaV//sNWSHhs=; b= MRFCbgAmnlwNwSgFKJNHIzAcjwtebyDtARiJ6vKp2XDyuhcD+NXJFALYNjbf2lTz AkWHxeru8anXDKWB/w7uJSvfS9UY5xN18sQ3DY3cui4RIps6lHT/ocx4zzTk5wBz yVupG+KTv4NucA39fm/sQ3smnWIk/y64yNJRr38JIFbWdEGIDTpRq3DZ2mkeNzId +Eoh/wD8JFLbwUwPlDnapSsBQA3UcRmnZAoPzkYrmbG7GLnpzoDTaig0oAtHNPNo rOiIzkPhdHLflMgaCAdOXyanZbhTPDSV/McDdvYzJgIhyccEpSojcmx0x3c0XAU5 b/piWNZO1QIRs8h5N+z0tg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h22csek7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:35 +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 4BIIBlko035464; Wed, 18 Dec 2024 19:17:34 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2048.outbound.protection.outlook.com [104.47.56.48]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fa8g1f-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DSyr6kV8Dno8IsA1Spt+44UROiKxwAWkWrD+6VeRxBkYSHc7QvAHi42zPUNQAmaEekEjfnwBV+iTy1vDFlH9fdK8ZPmB/eR1H9ZO9iOshFpCn3fZh4JYFY5RlM9+1FgwL9y32Rk+mya0Jj2GrM7UZ//QPEtzpvqpXPi89wc+RHr+4yX5eaLqvcYoEXhJRfazIOzQyBuW8TZFFaMOhKROi2yod7ikTFjthgLbrfiMy7CBiXnriODJ/eomTH3QQQI9bkv1jZ7ycNyj9NkNLxMTJa9OQD/4s/mZVRAEqSpae2VqVMj+A0ExVSYFlCe7bU6dIKRoHfNTWHRJr/40DOs9Gw== 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=BgtgrnmHINNT6JEU8rfpoYiqQW8BCuWzaV//sNWSHhs=; b=i1mrOK0OnH3CTJWhfmfEmNqnF+jo2MCATM4sw6XqSE+kjtoDCkYFXbyHb2hqs1Dl01zLXcPMA3gCAxOh+6+7lDqAwzNL56uSLOOi2xoEkvLaMSDz3CvCnbunt0zrM0JtpKytXtnx35Imv2xMNTOQFnc36UoTjSI0aMZBlx/a+KfAfD+hmT9RTPqC2e4t2H9hkmr20UV9OlrfcgL3Ioe/zi2lALsZYKWpP/zBS9RU+RPLAxoy8IE9X7zkn+jcSY1ZiRktdwOofdkUUCPQz5qhrhj+i7GmiraZF2u1xlXFQKtv0nEtPCgEk1CB/mYG/zn493tP3HWxcHTvNAAykZclmQ== 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=BgtgrnmHINNT6JEU8rfpoYiqQW8BCuWzaV//sNWSHhs=; b=XXDUWLrMr+06CFW3HULHjyvKsrxRmqOOl5KzGk1Ewzh7bHi4rbYYSpNoLAm5W00JNVKuOrNZyccih73/Jfaw2ld57wYAoN/5ymphLks2YzE+hNAtqBjiLcqSXC3VHQrlxUnqlFTuUP8pbnVzkm7F+jJsCEEnRqUhb7txibd/Sps= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CO1PR10MB4481.namprd10.prod.outlook.com (2603:10b6:303:9e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.13; Wed, 18 Dec 2024 19:17: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.013; Wed, 18 Dec 2024 19:17:29 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 01/17] xfs: fix the contact address for the sysfs ABI documentation Date: Wed, 18 Dec 2024 11:17:09 -0800 Message-Id: <20241218191725.63098-2-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BY1P220CA0026.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:5c3::17) 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_|CO1PR10MB4481:EE_ X-MS-Office365-Filtering-Correlation-Id: 6fa14327-6ee1-4751-7dfa-08dd1f989d23 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: 54qIPaW0qv5acWjC2zwhaYfmDV0YUe3o6nIWxocITLq/a8X6sQKM17tv+94w1rN/zcrIj/uHCLEsGBRLFkMfGRmYDUNqdgqMwz4qkl+r5koyPyVeEoHHUUrPOD6fTpcgQ7+/+HO3rsW5MDSpb7KTDD9RNhZ5MEpDJItC82D0rtcseTOZaE+fbxcTHucudKngUvTIPSmLjfEdRvlQdUlTNt9VqsIAtq7tzjtLoAz0BJ/v7xbICCRkqauA2ZaWnvM7AoHhwqs8pJHvv4FizU6z3i+VORKX/eNZyGE2ptX9++dafZ8+oVCAgfb8quhAqEcHFmKwbyqqlVgNG7E6QrpudyAGofnnXN8wcY5xHhI8pkYu12WiV6AVFSnugtcyewj+bGlfdM6WPAtuKH9aXYUi3grbW8SqSK2CQ4QctCl09ITjnp9UJwQjTSA/NG7Zyh7PrxvgKX9NtFXO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799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: D6V+h0Ps7A8y1rQff5UpRThRvsxA9EV8sUpjXrKflWu1Wb/ZubYUP1hibsyonB1l/Ehb2GDtYYx0X4ilhs51O9jNWzlOkEZQKcOv+Bz1pv3xdJtHNtPlqt0QslBSIeBcFDqXDyZhicTcJM8zl566XAOltjxbi+GfF3L2XLz8VbTrGyBA9sH4dctX2SrrfJ7mPOi24ylGLBsGHPZcTMhkTvLk2RwKMM5Wsubn1/+/It9A80SHkVaWzY1fc1lXv0sTyy+2P8MyYWSIVuOXEhVapzgglA3SaWe8DNWcxpCsDUh3QX/04vBiVkO6cnI+PUcuje+xHU8IRrR4aPb4pjh25TC0BFTtib8XNJyBcEflv1xOih4sWaNDvrE2Kz1idzgbUNKaJq8BztB84JmI5VwRjckmRqXcuSJRhmODf6J3nMBF9Ft05G6qgruQRcYyuw+kUzeJ3q6R/dMhs6ANuOJdwiQqGTS4SFKLkZ1q4orkkJdenZrxcbQ3rsfDXjd11oHJ4iDV9+eUwj+xxP9c13REb1vCoYpNobFfifhmmyuCjriApYA1pCpzOPJ3X9I1tVvxZV/+LidI62xgXGT0cQXk6/A951Sn7wpNMjimognCtu4ZMoW2pKwyCUaXHaEjz+vUjOa3XEIm5+w6EH7LBNUrG5SHgiG/iS6z6ygUTGy3pzJavCXXepuM7CwJE9eI2FrhFeY84UYYokJBqXKgDW90APLAiTwKV2bG/qCuwRimGo7JWcdQAeEnjKgVzJG/CswR9Njh5rYKgEaxkzXLWLQRtWxX4o98ao0U9WaeqjWChOJQcb2OeByeeV10gQUeIl5t329tgCjE8aa6GIrJV+RHoL+Po8CV6nVAOpo19xKa2tDgTXPgqlS0iO+ci+/oz9XALF0xa8NlGQvIRIXkfzYGpvKVZ5SbrSF1CPesIlYHXOOEZuoS2HaocedhXXpEU3dcH7nAIwL2aBua4lmCQYoChhEQCMlNush7n7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ZkaeXuMl8cbfEIvuNARfyJHRdTZgE/7dexEVAwkwABPhuNuJBR9MD21beMCB5xlrybnaRl7AsJmmi/i2QhZ2H0wtqE9ermdpoLfGgj/Fxopyco0ijj4ctOb4OBin1cwegRA9RAC+t5fV/+a0EtORasRqxDIj1YiCN3ZgPpVKxly0wDvwqcqtLJeC7NGavYzmV9SccnFE11KZHPtFAEk/Qz4eG4c8e0mkJ+WmgrwmadizL9ncoxunvW0mUqp9X+Cw0zbC1qC6ND1OVZ3Oen7UlJhv5EXfzGLDV7iYPqxeYTmzpHZs= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6fa14327-6ee1-4751-7dfa-08dd1f989d23 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:29.0791 (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: neyg1SXbsTeucNpnCMNm/I+6/OOd3fk7iN7c83vxPRGvmJsPknEXaIm9vHFmljpIHmkL4lKMn6CNQCxrymfCvK8uJL2kK/85mqSzbdMeDEU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4481 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-GUID: hx1XCtAMEBcg9ZYh8crWXaWH7qn7rtHz X-Proofpoint-ORIG-GUID: hx1XCtAMEBcg9ZYh8crWXaWH7qn7rtHz 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 Acked-by: Darrick J. Wong --- 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 19:17: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: 13914065 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 F156E158524; Wed, 18 Dec 2024 19:17: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=1734549459; cv=fail; b=cuf5nhlL0TA3hSqTBBPwNbpmBlVw/p06Y5E029CJUWeofG9R05ZnVb9aBb2M43d9meHHpHjPzLYDAStMQlXIouIGGcnq03lGaaJ4LTYEceN10SETjwNLLZSvoSWCJ8/egc78s6Wk6XQYdw1YN72fsrex3YUtwty4IXdP9USPp8o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549459; c=relaxed/simple; bh=bpLUzP/Yun2w1ARujcKzU1SmDJiQfjH2GrN8iT+kTF4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=sxOnOE81qG2lLSnXHP6y4HNODTrcBS3JfRJNwJB7AiBbLL0LSUgZlzSXOskfHD28Z/Vlv4pmZ4gvwGtVzexpFdjTHCGjO55o24ZXnra3nZfnrGma8Z6Wv8nU3CL/YZ+AFMcdPYMEhGOrimtCKdYRuBdzc7Kn0CKq5IDQ3nzIEsI= 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=SK4umoBr; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=i08FsZnZ; 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="SK4umoBr"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="i08FsZnZ" 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 4BIHQeLa005634; Wed, 18 Dec 2024 19:17:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=OCIDXfKUkdKdja0w6WSKUv3xUnJSw2u1VeVFEDGDJPk=; b= SK4umoBrmP6hhpr/fMyClCwFXpmURS+0qYUyk4c89nXzqvJE30Kc8qAgPB6h2sa7 gGa3hBhGQFgTOGpGIK3KDqc4BVNWn9o6VFyBZCWfpD3bi8cjaI1N1aB5H8kQC+JB rY/32pQzeWVcmO/KnmFbXHY9INKA7f/y+XxiX9sjDEpCxanmU1jN3QQVnaPms6sS 5fH5FH2m18hrRVRwd/FGMxVztq8CN2aDsYo5PUSfWHvdigs/RkgBLj8vZqHbp8bq u0K+5IEbevDRQu0kB0LNTnJv8hUZosxpF1QuILT5Kb1UvR4Xv1y0oDeZleqQOz7K nZ6TOX7rDMdmY26ym5uWlQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0ec9bu3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:35 +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 4BIIBlkp035464; Wed, 18 Dec 2024 19:17:35 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2048.outbound.protection.outlook.com [104.47.56.48]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fa8g1f-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Gb4QZaandHeuX4bIhPUJo+qGFKAL8M73ydV5pXLivIhlLJmsU+v/tgqrV1KNeYfMGFB9GeXjjxVFLgLLCbnfbBAKRKFcFfQ09/kMQmKnqW5IP4eG01qrsezUuQK0Q46SmPalM5kGeZw+23Qh0jWPc3cqtWgpEFCOsKPhf9AIpLHgJeYlpE5/S2cnvF9lNXjLhvFSDVqz4YNpAIqQ9pbl8XtfXX57Qg25vYTPbwAfikN3NxVRYKjMI+b8JC9BLNnx1r+GpdAA4TUHOCFqnH9I5VHMFPwiK3WsBcfh90m3YCxGax3NW99sWYx94ZxbtojwgoS/hU/fQ/IEj/BgZX4z+A== 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=OCIDXfKUkdKdja0w6WSKUv3xUnJSw2u1VeVFEDGDJPk=; b=pO2wP6dq5jP9FijvJVnIK7AzZlr4UCfgE5a5sC4J5QZ/M0cgmorw3imLGkrc9/mSfGydnfmaka3B6vtrZFpk0YDtHdHsNXsocqemcsuular61Q6xuEkJtBKocM0OAp3A0OnfWwh+JiAaYm8AedcL0tOQNy5GFIZvSCRnYVGrlSx0idR/sTiMgYFBnEuxf8waEi6jRUWukGRkaRk3smfEKpXhPR/xhPsSDhQA5cSj+1CRGTIZw/1frpnFbvRIcaeSC9Tpw5iD8lQquVRAeM+zD+gkhiXHsXJjyYh6lJhT5aJ7FAJIPq6zEzwQYlfPyFxLej6d4m6eemwC6cxB6CEkqQ== 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=OCIDXfKUkdKdja0w6WSKUv3xUnJSw2u1VeVFEDGDJPk=; b=i08FsZnZU3VvoDGoFZc0RFlrbwnJF1EazWded+qwlGpabr7Ga/ad9bE1hTc5B+8KqZnQmRh0p4N9hydElaOZV0Pq+qu/ogqm8Fcqi1EE9Swfl+cDGqrz4PrwpkVqEJ45W5mK67ARruDy43HyVF7vRJxHs5lXT60HBeZDm653LDY= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CO1PR10MB4481.namprd10.prod.outlook.com (2603:10b6:303:9e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.13; Wed, 18 Dec 2024 19:17: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.013; Wed, 18 Dec 2024 19:17:30 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 02/17] xfs: verify buffer, inode, and dquot items every tx commit Date: Wed, 18 Dec 2024 11:17:10 -0800 Message-Id: <20241218191725.63098-3-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BY1P220CA0024.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:5c3::9) 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_|CO1PR10MB4481:EE_ X-MS-Office365-Filtering-Correlation-Id: a206ed0a-cd50-42b5-bd4d-08dd1f989e41 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: J44QYUYHcmW9c3+gg3qpCjeKjVfqPFvhIHMNJ7YabrW0LXU9lBYXMsN15WAryqI0CdlGXSeAprsuDrhBjv0k+m4EV5KHY7gewaY3FisPrkrXpxdq7TxiTdJ43wrPfqYZGUP6kuVsVXhhpb+51CzGdsV2oOZFHIr+EEQYEaqBMr5ZpspmqBxXJEW3uhsOUqsl6lORKN2O/8sUVv+o90+qUOisCGccZWTXjLRlLwIKAW8ziZuT5mboE8hrYP3XCq+IwWnav91WkiHTng2t5ld/6xVIBH/zQXkppIxUPcAetJTPB+L3NWCAvJK3uHyiSfVeqZBDZvqwk2D8gaOPgxbBZaiBHnHy27C95fLA2xN7g6oEN1ILTJB5OMTeK+DNuXQWuYaRVqeYRYz+/jhcQNteISZp/HWeq0YZNi90J8mrGw9YwfjYyBQCGFI4mcEVkiTDkdl9rjHNF6y4cDr/2ZDpZhReRF2OS1TZ+xN1/HxY8PomfINTEJYyDq5ENLxEo2HXGT3fQttHrqWmORVxd+1X2ZeHNYZnjgG/XL1zao4gjI/7ozA8LI3LQiEJzkEd14W4SWrsGlMReXa1RUPNeoLPRXdmRVpPFPURv4QdhQPCu1+RV7qh9EWdQYkuv75I1ovevVAOG9IPsHReyQKwwHfiodNlNBd9tIn7E/tEBgMyyvg0FUotoq96tDgNz7U3L2lzrNUN+wnpbf0T7RtBi0uboeK5v6bwqXwXPvZ5fEOah8RTQjSS2neEesf7CZ4Rmm7Av7jdXC8rWK/KRAPS/iB3uamUW+Ept8W9wzYyxR/nRbD6Tcm+qkELhXMbPGsStbZhOS/StdjotxLyO85vtv+G380GlzU4dswCPFhKkqczRM02BBE4ztb8e96kMQaKpHU+ViXUi5sQ0Yn++cMQIvnsKgOtugBaBnrkeKQtVBxC8MMcTiJHCeJ06nBxDGEvL7qyV6HX+/Nuhlk0VvJEkzYOsU2in0UetTcmam+gb9GscrHTChjRSzC76FHtlWIuWMxy3KZNXjz/QfmJ/RgGOEzndBwUSZebzizos4GNZl2CTxLbxKe3K7gUa/pE5jwHPT+mhIHOWbRYaTUii81GZA8q+lY9rRICi7aiQtW1B9aVVhGBGVfH06tKi8l6UCBTfyQdnnvwYaeYL2MdmNrYXQpUTjlsHA5Fj5PoZvGD9Ds/6LT6glAouvEMUEg3ZnQawtjXmWlcooRrqJRXKDIeOmvyiyy25jU3oIK6llccrLNuKgNFnhKsy0uElhLAPtaP1yhy2PwItaMvukE6dvKIqpft9eblMxNSf3HWb5mqxOGbf2bw9R/lSlIM9Qi5jHnlAF6I5g9FJ5ZCn8DUWjEq+xcum2HG1rpNx49jLdrPXBhAhiaGUQpkaiMmBUWbsBCWRe8d 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)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-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KyJntZAzy8CVLgUO/7joGYvyuNXeyRuOWGHCxqLF07xAiz4SMqWwDK9qmZpWTsJ4EvIXLAtYMlCoVJC/0pnGtIavVVQ+EzNPdXku8zubous6PscOKlIM7B167SHawNYCD+l2brly/ft5mjdXsXYbcmMmeHEQG4Lg5xVx2vZmlukbp1saAeuKc+0SuDYteQsSIHKMekebF1Ox0915edh08WolKMhA3zhIH5xIpWfxN9bq3b9JiSk5jruiY8D4fMtD3id2xATXpcd1wZ6nOF7VKi8LJf+H3BusnEU+rVomhm6+sDLqYKv3NUMRCCcUBIbF/kgOo516Jr9XXbEra+3TR/QjjoyYnaOg8iutrOetGE/V7VVVUA9rVH5rMCHxtGq+0tRPFA3icIK1dhBqZa5RNbN8gMKZcPMgge3FvGA4YDys/ZMEtU8BE7/hOQjrlCo7thUGcz9ueAlJgf7tNP+M196aVChVH0mmGvwIe/SFZqRxTyVgD8h72uDC0HMwRx/uG/rNwvUniBlbmm+URRmbBa/n1La77H1t94Cv+b8D/CHwF5GkJX5HDQOqYfvnsGMWYOELPPEEkJPHtnhlR8DFKG+Eiw/+RyMfd90rykHuK9JMh+VLNoj1HMFo5P4V72qrbpSYA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: +6tEjfQaxtHv06SIP1z+B6BBVeGRtsuCndTfLvjA5RmZCpxsu4XyoX8JOu9XHkVxYMPRO7LByjzJohCEp7jSa/EkwqmgwXbA+s0pYbq9JwddCzfLjlozh3vSLsUiqHOyemjgUXNe2CHg70N5g7QKcOHdiZYoM+M94kHnI5j87J8obhULmx1vi5NqqMt6bZpiRLd/JmTPqfmjsP6yeVzxnvpbj8MSF64bN0s1gUuQCunAiqYpes8j+/BB3saUdzl+1cI8+L64LJRfSlKcaf2djbvafK8prAhnaHC6J5KKD4u76LoQRDkZublEBmU3R2MZEMymgoiGDOQBjyw+GLeqLfgHKr0jqiOjcE+K/RqLyr+28yhp1/wSFbjjiyte+09IiyE6UGRzzNHHhV+GFjJoAAeKdcYMYCfe/M/1uaJ/UNgZIgq/IMoh5Jjx2ZpxJ596ZBQ4RqLm6uFVsfxepIOEozDIcifJ+S3L94TA8lptUKLOrX4b516Ux82Ar3mj0SwnHex+MteiJbocLZ6FjqmjwPdIwVCw0c2boBBzW00w7knqn1JqyVJbGzE6gOrWmovqANuDUnlofEw/uarAdOk87JCx3IlpYn6TGXrzQ0xKNMo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a206ed0a-cd50-42b5-bd4d-08dd1f989e41 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:30.8585 (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: Vni38/BH9wvw1oZmC6PdXebWe+Exhgdzmk3w7VkUyRJAt1/qEmjB3MUquvtg9kZldClCcKOar05hVpul8FngpHj+K8fqLwC+paZwXWhvYFY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4481 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-GUID: PZ24DuhiXUecq4RKi2MnoCiJAQzV2_1_ X-Proofpoint-ORIG-GUID: PZ24DuhiXUecq4RKi2MnoCiJAQzV2_1_ 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 Acked-by: Darrick J. Wong --- 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 19:17: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: 13914066 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 A89C9157E88; Wed, 18 Dec 2024 19:17:37 +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=1734549459; cv=fail; b=uNdMmUCn4QxUrFu0OaYFX1D1YuHZpSq/xaiVDMc/GoA72KOgRXSFmt8Xwab33KHrhqeWZQWC5+TkCz1RIzy97y3IIKsiqcZgSdLJ/m/VEA1LViUvIhkDMHlJCJyQur4T29jZTW4kLiJCgWp1VyLZJozyxsyqZKnStX8Q7VCdFg0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549459; c=relaxed/simple; bh=HlEcayD1xyf8iW8DFGFSi5Y5yNWDyRiBdxfgp7jJ81g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=KKJclpXrNexAbPYqTpNLeJoSamehgOBZyGlIN4UQ0+MyWR0B7TjG+BUGrsTnZmG5rtV9kll23sBSpqCnS/fQUCNurEbMjop1OF6JE293dP1m7OBddrImo03A/EbtMr7DxBcTy2qgbx9Xdn97pL3WP0KvXGx4dqmkbB3ltJltFIg= 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=GdmasDBD; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=dVXwzQye; 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="GdmasDBD"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="dVXwzQye" 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 4BIHQeYN005633; Wed, 18 Dec 2024 19:17:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=ScPg7Mg/0yZeA+OkXXYut4hUI6ZV5gQk944GDbsngNI=; b= GdmasDBDoa+0tnY0qAu1RPHkdRtzKMYvh4ai+OLGiCbO/1HXzKiWf5YzZvFYREKe OCAPwTlBmHmf+PtS2EsF8f4i6v0007Z+osnszGO26gvbkz2hGggyGgIct3oTb8Y+ VgbH46hVAYRG53C5tqM851+zhIuhi/szwaJHrD7Tg+/j0ZBtiampuhOofKXyFIiI WhUo4DrPjDkDxTsW8M8kwjcoG0sCSDkw3vhZmuHb84lBzteHplg9cyUHg71PMCUz LQMffjJLQji6fG/ggf1iwNsxJrSq9SkBn18pvrMmdroMBYCcFzPXu6klALgQdWv5 LYEEjppLK6Sv8X0IrcostQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0ec9bu4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:36 +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 4BIHTSZ2035463; Wed, 18 Dec 2024 19:17:35 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2174.outbound.protection.outlook.com [104.47.59.174]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fa8g5r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TPeZQMxvpVld7rDcl9HZUqImkxA2m9vd8bXvXY4eFvl2Gr7Piig2hVS8MEZDpw4Os/K3P3g09c9fMN5WWJhoWz1mS3hQnT//vASnnYGxfGYSs9WP3+t1V7wCpFxuCvAocZladEmrKfVzckPU5bG5mZA7asF96hlfqy0Hm/t50RIy2clzKDT0eok2ZtZsWKCXDKHVjSt0q7ZzEiAapo7+FFTjEb0Z/vwMaOSbJNf6KsIFP0UyzzYde4GIGq7SZEq8PVWJYteZExNvfYYV4TFZ0Qqr47VJJmHuaVfIx+iG95um9ktYsX9AJs5Q+0G4pSsg0ObNQyopQqLYOwOckSEc2A== 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=ScPg7Mg/0yZeA+OkXXYut4hUI6ZV5gQk944GDbsngNI=; b=qMQWT3VqSPhcTxMwJ3W2K3AhoaJ8NlrvlANHbtXZyDDlUuOjfBABNvLs/96ElUQt3AWsZ/3ux1ALEuwdwONvh+/kakaOUBlsWwLx9sCZzhZhQCMbhqLkCppt7+lQpZVlWWiVRxMCcmO4UaQ9rnngZ4ZI2Dw7ZuZn9LVAZlsopIqtTLRHemUW6FKGbN/N9t1OfY86eAsl4TnhjXeeF/cVGYv+XAFY4idl2rcGcHcJfKe2vAFQ+tUPr46yZsg16Zlp59HEYJxz67xZUufo/m4kRobZSlN4itfIEt+PjGZtxdv3yvev+8A7Y0EZPDt0W66yy3HPApzPIfMw4Qp3TF88cg== 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=ScPg7Mg/0yZeA+OkXXYut4hUI6ZV5gQk944GDbsngNI=; b=dVXwzQyeAycm8hlp7LGsOW8DUDJKyAF/b7BMtXfzmE6s9gtw+R8zSpqQaX3kLBxFMNgQEWMRkxLyOxs7NlKkJB7dHEvr4T5LQ3snRciPu5wa/7YWs6mgKkhtGJ1scvRJGUBXIpUHYjdXykYTZwCype6am/xGNNFw+Mm4ZgmkbLU= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17:32 +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.013; Wed, 18 Dec 2024 19:17:32 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 03/17] xfs: use consistent uid/gid when grabbing dquots for inodes Date: Wed, 18 Dec 2024 11:17:11 -0800 Message-Id: <20241218191725.63098-4-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BY1P220CA0021.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:5c3::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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: 57f61b1e-6561-4729-85bf-08dd1f989f5a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: 4p6K9b5J9VTmozSZ+mFwk7xz+zKj0Q93XNpC9kZcvZ36Ehp3z6YIcy3PuDdW6b6fekjG4X2mTQkGT2WaQXpgRuJ1Kzr+ZbBZ/1GKX6xkXUuLpA6YlnczexfkF4SdRGn2UbSiEWXMGB1aT2YoARqIDT3tPAWF/oCtASrRLXIjzfh+cSjUWvbWZpsXqsnYQYEr+l6hNtDjC76etoRMRIIr1rbXYruas1ALndJQi02oQMhc6cffcl0eAZ1L/4GmXEfLu4kn9lLjTvuVvGakFwL+h2yf2kQkOJMQWAacIcMLS64veynXWTC87/Q88NSbF350sgUP7xoP4kSGbFvUB1DkIiNmq9jaJsckZmkrT+f3DTxkpT0es/lH0Toz+9cD7Pc58wBqfxfgpRLSOVUIcLlWewHEEZqN4R479yZ3V5e/IxCAb3Wee9vy/nosCy7+XZBrcWjMYmoQa9nS35CztwpEgNWwYWsxf1ecV1nkEhuWzAqq7S0fEfAiClXS+B37NG5IaHC5dWeLNJTBnDbw2WrDU3QmVdjO8RNHmXY0Ml8WwP4BqtzbEXNMUSze0orEAPSbz1MkqQafuZAprlPKptwnHxhkxkEab72YQvMLVOozItSTtTy2wRXHoW36BXoT/3iX2/lZW2PHa2Kc6bdTqo0VSmGgOrgsqrn6GKXsN2btBZW4ihPcWBPx/5M8aHR2mlVPp9iB3Uoqwra6r5cgg5o7RkhobUrVGd29nYWQCBN6eKnUN7uh4/k+IXrspt2uLsNSAAFgREU7VdmO7TyZRJDXaxwEQs0Gx1KXW2luH5C7XLJkPCHIvbC5lLQVBuDKfE/1lmAb1VtPCJVZXTs3C6Vj3CMtDyRtDjipicmyFxHJM87X9j3O8VdYR6uFqXgapgfTFulVEAEeIw0L8UKFDg9xCOvVZHYk2jBiTw026NsCrKnzEvUCwxeWJnMk5XjCrDVeKFldeYc09Zgn5gKsZGq3B1t5oSHUFEV6+2UzCH6XaX+jNooFSxaBQ07a3t/ErJEDtqfA3qF0/QEkx3CbLT1QRaHJiQDPlP6qWtF4olY/+NmcZzFe6hnitfu+bVi/48XdUQwX6QvmbqzeZrN4aDLSCj6MogYZppDoaIEv+qb/BajsIXH5AAs0q4kVc7ar1OrQbyvslaJcFNauulDBLLPJwImTV3o08d6Suol51Q9umqlKfFMit+nzekDjnh4NJZ13w/FhcAfwImG7kAmHqZ0OK2rhA1Ii7GLA6iN/W6qI5WuOE+cO7v6NWf+CAaCGaISFqismhZmb0PyC4ww+d3mMuCPT/wDn2cX0jko9VKhuX8/SalWMrS/+g6kQjbd7s/hm2N1/zhUb2m3CWHQFzL1PrHitQOwseGdJLuwPli0Xkp3a9051VOiCDM0NW6twJ7hK 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)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BsewNKRvh/5QY3j0UY/1/CP5IXmsxv2kIqNX9uckWBd513jMIzeMBht6/28VMt+nFKmKqbSsErS8tN0NQZ7BRPWM6vCpzpV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w/phEpRTaHEYwFzbIgTyYi7630VKEebhhnUg/GHJvTklsplz2q8OH+sITh73zGBwsewAdfd5DIAohpGEdORkZ851zugSjxInxRG2h69nSyMaad+0o= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57f61b1e-6561-4729-85bf-08dd1f989f5a X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:32.7369 (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: p6UBtoOtaNLxsjKL4txmrUs8rO6IEyynyXomDHwJaXaiC6McZ24PyYKU3QV+e8gmuJPxRyhHcjeZ2jlSyTiuhDaaikXHLFWBak1htOfCXOk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-GUID: Qf4DQxX1nAjxbilEV-c_1eBYHkmD_-V4 X-Proofpoint-ORIG-GUID: Qf4DQxX1nAjxbilEV-c_1eBYHkmD_-V4 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 Acked-by: Darrick J. Wong --- 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 19:17:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914067 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 5A64C157E88; Wed, 18 Dec 2024 19:17: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=1734549462; cv=fail; b=N9Y+UgkWJDGhOzArlQVUO4tZ6sW3g3Sf1mcyi4uJCcRAp8tlxuODQ9/xG6h4A6DMFi5Owh9pjeOM+7W3/BmXGwi1a0N/vnfOLfzBF+EXG56Y9bE4dM5ukxtdlmApXeUM/k6iJCCSwRPlk5kyz/KUcd6v7jIKh3+U7Cvwg60bGBU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549462; c=relaxed/simple; bh=rU5A1ix8klwpqgOcS3je+akte08S90E7Js43OnpqtcQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=jUcR7U/p9ShseNtb39K2PgQZkAdh2c0AaHXeF6v+/0TdyiADg/0/IbUCdFeeEAwgdzB5NpnxZVArVMnseOd1fSqFKqCAcuvUaD0jIv44CKlQv/U0XsVBCFkyIN1cybqxMzJFcnou4MWWd9P0E3ohzp0f7E7G4Z/VfA0ULT0HY2Q= 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=bvHTgKuO; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=AfB5nbMA; 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="bvHTgKuO"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="AfB5nbMA" 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 4BIHQbIn024323; Wed, 18 Dec 2024 19:17:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=xDbnsAhsWykhd0kUnxWekk7sKX4B1ut0Gm7uPi6H1Ng=; b= bvHTgKuOwEn2L99D4gc1E00fIJ1BZeTX+17T3kSkh4R6Xva75tzzu+mEhkjkn6IG uRvr9W/sU+0B4dFqnFWjLYqI81ED7duH7u06clISQbTJusdfiqklZ3UgJNesVZ1i HhBzIv6Ii/yVHCuAYM5TyvPNNNFykPHHYe3sxoQTPgkswTBQz3F2lL6UbXTigXl9 9zewBsQatsSzng+2o/9w23pBG4IpD7SOY006b8/o9nkpn1p8iwhqG7zvv1LAuqIy BvR6retxPP9WjFM7ikTE1FXJh4ZyNMiw+ooQhQeIFu6BYY6QzgnOWnjvXmpMGa3p X6b5Dk4l5ARFGXHYDmOBkw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h22csekd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:38 +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 4BIIAsw8000776; Wed, 18 Dec 2024 19:17:38 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2174.outbound.protection.outlook.com [104.47.59.174]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fad59y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LP42vZKOWHTc6uvQwFTYR2IAl0gpTi58PgFKGlPQVF+SGHhX8uEtY64KzkVYt44Q/WP//8klSx7KcIU3Ks+jOI0NZSPIp9HO1WwHlvL9O/vyrG10wFLWdztxPqZi4zHKlitgRQnvZOGNs/3ATa1uWTTFj8gIlKSMJ/9QXlSxa+v/IfIPivKHwcIwfRMYN6IOzxbyJ/yWx+BRHAcXcBw1wnu2C8XDwyZViBmMXm2quJZC7Ff8UQxXq1HpOxChjPOH00NgrnHFgdJTobSASRPvvkBEFRm9xqgdnd9iFHxUffmxo65F6I/hJlm5BuEZcRXgpNJ/BDsoIfmK5bXrqzW9Vg== 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=xDbnsAhsWykhd0kUnxWekk7sKX4B1ut0Gm7uPi6H1Ng=; b=rdAdMpx1Q0txbUxQAXGDUAriCYoVaIPXliCNYo8lzraGqdmEZNeC8PxgpzHybh3/J7rW7M2Yn2Xydxq7P2PK3yYj90dtpETR2mxCSs0vf6uFrTwzYBB+1oWnHPl0rUjijwvBCg2axxSvrK98tH4fOg9cz7dcymv187LpL641QkXLTGmfA3nihFyev0yAeh28XOCUySZql5fjxvNVYLz/3qVTznMLXF0dnTOgFVLyo1ADb8aGTq7ULjnDaHCE8aN5I37kmzzU0Q2M/38tOgTt6yPavt8X/qjobn+VjDXpcFXr32cWxh5nfYOb/KKzsXpPZ+oWHUFNytsWIqYrL0NUJA== 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=xDbnsAhsWykhd0kUnxWekk7sKX4B1ut0Gm7uPi6H1Ng=; b=AfB5nbMAejEfOdPF1myrf8ldM63MYMIUqSVJSGtJ7EzUjjQcvSmC7dGJt+NDO7QGBO/xV3g3lyZZCoXAEXylwgTH5fC6haHqwc23CXIXn4yV5Xxbsaa+5AaVqKVdoq8RQGqaUE3hvAUSQ+XsX2//sWg5GCl2Ez3lZ0iUnEuph3w= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17:34 +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.013; Wed, 18 Dec 2024 19:17:34 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 04/17] xfs: declare xfs_file.c symbols in xfs_file.h Date: Wed, 18 Dec 2024 11:17:12 -0800 Message-Id: <20241218191725.63098-5-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BY1P220CA0023.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:5c3::11) 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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: fc1fca48-14d8-4893-b6d1-08dd1f98a089 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: 7AS36fIOHglkMNfv3RkMtmzm2Czvb4vUjy/JnE9XclWggVwi+Jolgtn1lkH3JD02/xJvrv01L9+ffwMydrnZpYTIVSYF79QWOfWw0cZqIIYadrCKBh5Dj0sWV+6MFANtroqCVc3bx7yzXt4er1bg6nGW/x3djbUux99iM9dxnKoID+VO27dR/+KEr1WF1dovt3GdPPW0I07fLneyM3dizrfAvHUHLUAqRcHEIMaSM4otLmXSmGGyev6GTbBcP4kHzQT5aesIMBHfTWLyhCXTgigBYACP7AxSXwi1vFeWVFSQtFG+yWAIrEZcs0mG3hHV+RcsEQXepNQCjGlqEaBHmlbCiq/VPUPfqESQoOptbUepnuNUoUzMper2o1D5j6pY0RfqIZkXWSnMERgkjISotRX6pjmG3eMTsYv6ldLNRX2d8SVQ2G3uvJS4QdMIy1u+1vNWRgliXDmIbyeAPikRNxiotSgOE1NM6LqoMb9VNZdIWvG5wnUUaWROnqBm5ZGp7dC4WtN76Wqe4o0VmKLnazwL4Ck9FNJt4b0CbJrvfuKNghpBwk5Y0DD9wZHmmQxnhv9ldKYe/oHoZFc/9tHYXYTUX3SSdfz01qZnNl2RhaVfQxCdbxJGR5jONB/N17hAqgpGqcZxG6ecoGAJ4Sud0fBYqVRbZDlAAIbsN3aLDBMzURLwqV3FK7R6FNTOqDFTr48jeNEUtSA1FNQYeQ6bJxPQ1uq/sdQJxmoHXU8uYa20YyLf04HxJ5lyfUbvpvynW9pkQQdpUkLHU1zGTKVaC63qeRDPk0klzvE89TlTF4pykRds5Ogf3/A3mWiM94XoznAK4P2ujtxcNNpAXfDlh/2x/echCFrzOPKYyKhKJ4tJ9XhLsdq3SWZR1QOA4qGl3wVo7y3a4HxFDRnBBmHgqoSzocHJ5mdY+Vt0BWi8StOXsn7qCZ1BCDifxGnIwxgG7t91Ey1orh+HnQjX1eEdjCDewapDmkIijgt4rZT+HnUEED7dX0gSsKevALOaOhdmX6oYOPl4NHytGwz3vFUgIF8z99GSGzooyMi1zwm+C03f+prpE+Y/gGGxojlFb9ZJ2j+a+NsehLL/01rajVNEOaPeuJxQe/MmzFtN7IvKJCKUJw3HQTUv6LMj6KGfszW/HD2ipddgHBDqpgF7WflfGOu4zoLn0aHW7tzPfwr3lFxxJEt19sFHGQesvYpJ+jcpzIpRfoAvOu/RKsi7Gmhvw4QbRyzNUSNsubC5MVK23c7eXpyNot5PhFiYX9PoDEeTIphgimlZUGINVk6Kl7R//LrSrAlzc+P3zsI5JmpRRmGBGCtakycTJaniuZsjRZgkY70y4zJrrYnqSlnHHrYNR83ZOAxDmm3mtNwp+vXZL6P1pmgN8b8rgC3fEZlcX4iT 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)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jTCzLDXxZ6B4w0Bob5MrT2Z0C494sjUK24ajTARjUFJaD1o8ILiSjh2RoLQIsKvxbQhFf/mW/GYdJNuFijyZPuQRIyPm+QJx8/VEkjCssfkotrgr/o602m3dCo6YhnlFbjyCC5hK0QjQvJUCcDZtAqpCBP6IDwft1g28joXUiogzapWPmzHdldzDhmVUW4WAe5al6kLS5vglH2+vp7X7XNWKNiQ8uBvxE2F8InKfKm+Ztx4Qq3a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X-MS-Exchange-CrossTenant-Network-Message-Id: fc1fca48-14d8-4893-b6d1-08dd1f98a089 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:34.6596 (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: I41BBlTqJ3esOdDS1taaeYf9HE6b3Mm9s6/f4TlLiWnhlEFLCtrLRh1yCks6ITJbn38lU5Qs7/jDPrSF/pn8VShs4tdxorcWjSqhCWQwJOQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-GUID: eW-oX5djLEKY0fhWtjaqlsHsha13Wp2T X-Proofpoint-ORIG-GUID: eW-oX5djLEKY0fhWtjaqlsHsha13Wp2T 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 Acked-by: Darrick J. Wong --- 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 19:17:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914068 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 5F7A4157E88; Wed, 18 Dec 2024 19:17:43 +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=1734549465; cv=fail; b=LJx506imboafNm6ajmgIBA5yfWxtBlE2q1lviWDwoDm2FmwWiOC6p52DXOfJ0mcJA1XzaRos5qg7Br07Y/c+7CsSSVzRFTwyZMveQtEyuFU8/RctPxkhT1IHF4FK2O0jMVuSSByviAs2umxOSrAH/F8+lQ1LNpVbl8MqdJ9LRsg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549465; c=relaxed/simple; bh=pfmb6bz9MnR4h8q5mIhK6mVuuEfE5ON3zzLlI0On65U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=PtVhA8YNBv2RSbEEUTU79ubRQYfOqoOGILQUjdLTtf/94/2+lvR1hIjQL/R4AjirN9OvCD8VV6A1cIEQ4/M34u36vZCeC+rMxKATjC7syxRCxAdhO697rH5gPbqbJ4VQ2WwHg576tLzHn5M/aj9Lgy9DYj0A0UschRvzlDQONL0= 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=MXw20Z5j; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=x2D7GMFm; 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="MXw20Z5j"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="x2D7GMFm" 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 4BIHQc0J029546; Wed, 18 Dec 2024 19:17:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=hqU/YTse1a9OGgiXsUWT9ptHR3orfDg1ufkcZIrcJ0M=; b= MXw20Z5jofnHYE0glagChzPwhRcb/bE8v4xVwDevdH2RkdoXWi06fEp/xgXAhcgH /n4cY/C9Z5Q9oVa8w8CjOT0pOf/OCzXn4v7gYPM5E27GdvZieyEMLO5jndcspWeK 0SP4myIhloVMyqOauID9yS/pu5bIWsPi5jhdtIPpsdgOQ3AjnPlwji6RQGe1CGUc 6D9Ba73oW9IO2Wrcze5y0N3Nfs7uoQEkY61aDkuZoiaL+QYUPiB9m410eCPX7ig0 5AxQix2G1UPpa+ZV96JDx3DGYCwZxIzNCCbWSnxVRdmuhHC0yVlcrf4it3wAv2YE cS+YGsfemtb3hm8hOr1cVA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0t2hcqr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:41 +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 4BIILfBZ018984; Wed, 18 Dec 2024 19:17:41 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2170.outbound.protection.outlook.com [104.47.59.170]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fafty9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FymqeWbPu7eGyLyF1Znt8C6o5XWHmLDMFeQBTokNE/u46XAtcn8bb9cU2DUoQThllbKaMjq8Vm4iZ+BjN074mlxS2D+yHICdNFVwsDN+wIbG46FYANArTGBpC1YDEoTtHrL3HYmvXR+HGDve+WAphtXBmANhGOCP8emkWiAKO6O/FJhgcTLQPRJBPLJl21YDPt4qi0grCGT/Igg3g3LIH5owO/vGZdUlUxPMyn+CyU4G2YDc8hFjd+v8AI6ZkhrO8JzVU9dv+zDKClnjB4KVqcroRfi8hPL8mUSIUcsXsnbkiB8bx1Wq1b34rkTS/9XHcER7wXZxcZulIvsE4L1+mw== 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=hqU/YTse1a9OGgiXsUWT9ptHR3orfDg1ufkcZIrcJ0M=; b=royL+fRLjGXgHFuHipA/RCdd+1rj2bby14kttHSTB3ZxLu5eEYluiIAlad7mPTMifZb9K8qhHAUZWOXzkyRul0lkdG33MHghxNTl1WEDQpCzBP7T2gnaqWna3jGsC7tBqBcVo5AkXIkuu6/0KgrH0n6uFU7uPvRPXdQsS+doEoAsHP+LHzKWfPGh+hsnmG4c+deoD2srJFl83CaGR5qg7M6PI+YyI49UYDHvJu9wFHI77//klYMcU1de+i1clhxd0RSXHIZSvit2wlUlj5Q4rNgwmAR3tU9mgIpM9CHbS57g18VNGpI4Yga3pudWgxIZiYT7zXOKqHT5C1tQQRnT4Q== 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=hqU/YTse1a9OGgiXsUWT9ptHR3orfDg1ufkcZIrcJ0M=; b=x2D7GMFmP8wQGkYWRetn5069KogMSegQ+iQE1q7wysflUZaCwafiMkUfsTVC+XVOC+XBEzfs4H4bqx2E3ogOnjTxJFfNsHwPAI4N2Rr0cO5L+L2dUi7sd1wsjwNjOou4reRjtiTo8vN2LSGRLGcijB55ykjPY4xjBZp/xdvUKqI= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17:36 +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.013; Wed, 18 Dec 2024 19:17:36 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 05/17] xfs: create a new helper to return a file's allocation unit Date: Wed, 18 Dec 2024 11:17:13 -0800 Message-Id: <20241218191725.63098-6-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BY1P220CA0026.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:5c3::17) 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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: b8fe09c1-5aee-474e-bff7-08dd1f98a18e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: NWUt/EYjXBGJhcyUvHEoD0b6ggqBo4jzROh5ACHtPxW/I877hZan6ykds3IGF9atHLdWpZnshvgXQ4F4fjHR1+zYO8q66/+t4Lo4HkXi9mpFZaJZVxyNDLvKCOWTp6aGEeYbIa2w4H86lnYW+tL4YA4gL+7MsZADowIORRusCI8EKqhkKvTcrSwf8avPGOwOrbTdpopZTlHDbkH4G5xjojDp0jK1xZt6h85xXyjVizZvQrHl/YKV+do7/bEyQvNxR3mk3V3xUaW0jOBQK9aOMkVFM1VQKzf3W0WTFiqImipseLWYg4AuHl2APZmm0+hAJHqI2QrUeQ4bxD6CyIa/cAIcZqqXs7Yvbb4lXqTZcKGs8nyhcFEx/gd2QTFW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4RV4w10XqRTAaKz8uXsFOOspG8BxifguHMTkcOdPMYvtApo0KgMFoTl3gKKahaNErcye8gg+wHnyZ/2l3SAnaFcMVwVLU4Ws4BHtRjjpArf9w0jJv8TRyVNCiUTeF3s6cebwHD2Q8gARWveOeJI/WvrcuBWBtNP4gKOv+Z3MmJTAUBXRnpiUrR7RrYvTLfaFN3fDsVTrbzXu9+oT6XaXa/fcwwMbK9gtce2Q73Xhiqv+laRXjqq8cOxBy0GlBEwnKp4XVxkopNVdzxwckvqLQY0LSUjaG3enwg+i4gpuN+4CH+t0TBYJh88TJBTrsXCjiwr1Os3r0Ly4cr5a0GSdpGy5OHAPhz/vVnN4KTFJWbDxnOBOJeAXrWZAheH8T88WYmEQ7sjaZC638hii7kUII1f0p+R8Ni8Iu+MRGXEyCoKU58WSJZcj/totmihgYPY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8fe09c1-5aee-474e-bff7-08dd1f98a18e X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:36.4280 (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: IloTCGeqjh4f6YbXo+2tsOiJqfKK1yng9Uqz60plJ/qZnoPP6n48dmeeHg+lAKCp9k0PyCtH9Tp6H7oCYB7dB5Lr67ChH7bxlye0S0iQrm0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-ORIG-GUID: GuSaiEKTmJZn-vsDfx3bdnLXuXuWjNcH X-Proofpoint-GUID: GuSaiEKTmJZn-vsDfx3bdnLXuXuWjNcH 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 Acked-by: Darrick J. Wong --- 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 19:17:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914069 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 D22F21FBCB1; Wed, 18 Dec 2024 19:17:43 +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=1734549465; cv=fail; b=AxhmlXafTL8eX3FIjuzMftur9o9ukUkW+LGr8X37tG8hkxPSHDbJkhUk/WjoG3HUSD3lEFFCdrhBkWosSU3Osk7bczsgueh7qXUbu9HtDQYgUhe37jPFHmXsS1kvjj38XK/tQDm96KeZjaiwuWLL4jSqgeJFQ415gpsgtSj4e7E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549465; c=relaxed/simple; bh=bIjWTVyLgbCofhCSZP9/rCsL0Gq2q4//YRDYr/CcdMk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=J8W0lQoMI3BMYbRkJSFbs09q8aIAdTby6UjqZsp0ldcbm2xxtbwF+Y5g7bIE/Jkc6L/Z+Oht6aKpYkLeEESHpgG5GwTASLJ3thzN0bi7+Qt0x1r1cC8H4vMNYDjcMJSBP0xbfSlOZBneqT/jktLxgebUMpQtHe/IcHETgmjV3i0= 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=lIKvCsnQ; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=XCFA2mdo; 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="lIKvCsnQ"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="XCFA2mdo" 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 4BIHQdih029824; Wed, 18 Dec 2024 19:17:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=Y6dU774PrD0orurBtDyEAzqp5jQpAfjWnQY2LowUoHY=; b= lIKvCsnQusDrIA8v2O/fthN72tX4TfrAqO1XS8xUNMjgauxjW3wxPk3IflHo5e+P cw9ZwBR7bMzzP9NAB0tJNBHJWWx9pxiaOXfiTAOIuQMaZwm5BnCqS57G06kswXNE Q9EcWKDEXycv89Fyb1wTYD+lcQgV3Q8at4X4vRKoGjha08DB7w+x6R9kLD9G2jtC Kiis+HiSt44OB+Cev8H7GWN5JWF9LzoQEDqfSrMxKVr3NgCGf/pxm7gGgRoIwO0I CvAixpqNdw6YtWPJXD2QrNJFqOI7goJe29BbZ2ATeAGuN1BRlRMWqv7eWTX0InlO fxyChyd8W5kABobMWc3A4w== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0t2hcqs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:42 +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 4BIILfBa018984; Wed, 18 Dec 2024 19:17:41 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2170.outbound.protection.outlook.com [104.47.59.170]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fafty9-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fAWDSGdztL9Ig5sqPR9oAs5PocmUP9Mn+PSVDdcOJTL9CVfR6BumsjNcb00J6JbwaTpHkfxqJzySUaNrVAfv8mxwcOa+OJgUR8yr8Tv+h08g1D/6Z3S2xXRW7C55D2ILKUUhHYF2919zYfd08Ru5cs4PJfSrWNzKnWcyDhhgCDaC5XhOtS/X8TT+k9VSC04mUlcD7DnJ7cew7izu1PmOc+gQ98KKduMNtLLbqU/aVjPqOsXd6Ft7n1mXVv22HWpn4RqCLTWVj1oz7HstyHoFzeMkr9pkQlkwuBc5AQwBQ2fsSDCq6LUFM/KtTfPn6Y1f4dB7adcBUOE0nQTo0HRG9g== 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=Y6dU774PrD0orurBtDyEAzqp5jQpAfjWnQY2LowUoHY=; b=D8HEEJsJdvEvgq6eDi7r/vuLV1+ox4w0hYZgEGdvvK5X/jbdh1OOufFBiT7xpSEmQDlR5+oNrmD1AgSlfRXBR28cvaAdto8UxQsnPnbi3Z7NhPnC8iW5UHSULY0jI2RN64qssa0bkPH5RwXaI6BpnQUtWjqKWdQzJj9NOKgjAcslb6YHoBUoBxHWLbXkCyzLY2JOTDQb/zL+LbLTc8qHUpwxPv9114pLKwokY4MxPDyT5q0bM3Zf8jLM5zr/QyQDQXA8HRHQNBjGh60SKwAihc7mYfokc1CopZ+bW6kk6SOw6UVKAYRpGGb3uljurbKL2V7bAWFoYDVdDJEIfVJjdA== 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=Y6dU774PrD0orurBtDyEAzqp5jQpAfjWnQY2LowUoHY=; b=XCFA2mdoMxA27Zsx8x4K1RzPrQBzDhGU95mdd1B/3PKJe3PW+mSkYWNI9hSuQ2BztfXSnG1mfMzxXcUZA7o+tL71VTBXT9dPs+3vGKFQ/LL0gt0falPS7YZ1P2chlMkDedcZRorfxL9VJSAUKxLzjc28ukGnmu9CWh+S2ywWvEE= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17: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.013; Wed, 18 Dec 2024 19:17:38 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 06/17] xfs: Fix xfs_flush_unmap_range() range for RT Date: Wed, 18 Dec 2024 11:17:14 -0800 Message-Id: <20241218191725.63098-7-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BY1P220CA0018.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:5c3::8) 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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: 852838d9-b57f-429a-450c-08dd1f98a293 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: +J5xG2v2YZQiHFEMuAdBXf41fD6Q5EgBF8vE6k0LbzTNimnrbxgxa2Es7KKgw8BRfYjJdsV+6alnNG7iw8ISLMnS46bJzPrtq1WdkmbDXebw71LfR18tHmT6Zd6dhwDr8KntJjRMKt/4i+Ea+Z+xF1zlJ6FFvuyM0wPPE7kHgSMRkfXiWn1MtDVCcEGP9e3/T91qwAVHMCQoorXqSUDkjufClWv8VQqD2F+1AyH8fr1Fxm81ehaBDWBvDdkvjLUj27hAmMMAbkAXkgYI5oUGVSzUeWD8Dirk2RM9Znsbr9rJJIV9wa4r9KRXZ3ny10nslPb5nCTJoT1YgtGh6fGHi/2JHneH553I57px7VnJxAw7R88BlVhqo/bbKBTZANuazr3+kbDS6OEwzFTu5R7zTcjbJtwfF/P67C6EQklbNQ6pZBnXbgoWTdP5G+5SiMkuLZ8Qce3jCUgNIC7wniJwAABlxeuhCBjNz5y1Tl2N923/gVCQYuUcWPSJ0HUVJOeFpmeiAHZci6iD1pnukarp/RECUk9YquCdUN/AMaDU3aOvLV3YsrXyDab3Ra8eCic3vgN+GJAJI498vPGC8dTcKEqPnhVeFKcGENgAmjoiBOzBoZoHE1vnP/UMHqF38I+yiSQScn6lmp9kwma7pAd4kje1uKjizluyhxg4qMwa2d2EhUCZi23+RqIhomPrRYJQahH9DXYJBWAK6W9g3FqFNRf4jI18JOtCrTR4/M7EqItRDjZ+BKPW3hFhrMadeOwN2gZAhOdDqHN3W9VtAyxp+JzTVAkAUVmDmZzEKu4cfD7QGwVDq8SCG8tTbEyzxfvNWZmCHMDXPwemkgnx/59DsrhLPCaomhwEEXi1q3lhZWr8QmvPhfu3cmQPJGzFQ54smEr+hFvda0volG05LQRTnakxYT7Pd9LcH5BP22PiO776BN+72YvoxjCtunFAGJUjJzgWHWFVeJnyBILKigRgl+tVdQKrYEFvZCBrO3DfBh6p2uak4n/rTXXXvo1fJ7pTz4Iy/NPX/GXkSSN/cKsrqfWMf0b4HDP+SUEg3e+iSSe2TAnjau+Ve7mRq3xQTF+9t6KBkWbgFuDHUDSbjXPM88q+KGxzn051gpYGHycnWD30PScBjRHiS0Y6MF8b/JSt7YNAr4Hm3zmEKQMdwkDGoL8ZN07LYxj6df3P0AWk3NjydxA60tlVD4MgyjYYgflrEmXZqsCvO2XN4CG/LLM84wjV8dEZPmBu8f9YnHCENDiWAu86wp7OE50apXL2v3yGKal8kd/mtWWSinmkH/l6v+Evvnap1psO4Pf/VS2zJX8t2IrX3ulW/dXh7z3aBK3CnTbd/rAysuxa7JNz5i3jz1iDhS9rKGk4xqdJwhvL1/kCsneRBTWGLC7T7z5SLWQU 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)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange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Wool9l07LcZLo4H1qxR0gGRVqIFxC5S8CqmhwuSPrbnoYo83S0fPkkd8zOYzOBMFc/izTa+Ipty/LkzQmXrmFhXQVQv6/9Js0Rv7eHjJXEaH2aVUVPJQYZoXwdwYMPcHlu/hermWgxZSW1PDAQepLd4Mh6l2+kMhAujHvPn60eMHr+nB20Imq9vqnqrDyXwGdlRNwu1wKQTy6kFDMZv0JdX0kzTA3hSLSFRMGwNKkrGED+lImQS/wccXgv8VBXXFFo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 852838d9-b57f-429a-450c-08dd1f98a293 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:38.1089 (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: vIgQkK96ViO2OTP8UVLumx5nIVjAEYahujko0GMmjmXMDx+4/NfbFd2VW7vXjwzVDSGFSpDk9lPlcyazkjTwhaOfNBIcrNIS/rbY6WZZJK4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-ORIG-GUID: qA7MlNkGQsVhTkpQgWfFFP6iAilWk4R5 X-Proofpoint-GUID: qA7MlNkGQsVhTkpQgWfFFP6iAilWk4R5 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 Acked-by: Darrick J. Wong --- 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 19:17:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914070 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 CE8DC1FBCB6; Wed, 18 Dec 2024 19:17:44 +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=1734549466; cv=fail; b=n8CqjNooikzcqeyMxwVsPnw6PHS1FTQwXSRju3ZRZyQzj9+fVgIgt/qJ/mBYhsQxAPMj0jcYj//qhXeKvPzRheZkRqO4D7jhkmUnqQAVD1ZPjNRrp5Y6KWWhJ4/p2SYz/K4S8xUNx6A9FtamSHdROPbXDfNbXNDC7VvmzxdhKHQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549466; c=relaxed/simple; bh=M4/OUhJDQeTdiA0/y4yRQgQD5ujF7G/kKjV8vbt8gSI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=lAoyzPHjr+59TQbI97FOhMI8AnxuVakJfkKFt+YFRXJ6BpzoAkSl/JWfLqdqEEfKFaoppiuS6wnCmrEx80W/0aMOzQYDW7yo5dGQeoNaGX6wDSeMvIxlISeBohiJwDNcQA2q3QVzRlt4pnqxwniUxtjnDAw3wFW1bRrfx9G6c1I= 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=XNe+CgVC; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=JZ8ONsmK; 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="XNe+CgVC"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="JZ8ONsmK" 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 4BIHQnKs001137; Wed, 18 Dec 2024 19:17:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=gHBJV/ELYVO2y72AYgs0Cckm4fTOyj0ANdcmgXZSQRw=; b= XNe+CgVCWyavoqoXMORx6UMXQBJiyOMHAQnBbC2724g62Ek/TiZgNsfn1mY6RSZ7 B+AsPtb0mDbCqs9RA+vrCvcurmywbgtb1IvnHo75xTgfys3IrDXWzwYVSPRq9sL+ cwMZhN+eRCQCtLkdrweNxbA+SvqRu8vcSgiR9DsuiGkbLACmfbyvUp6wBir0F3tL Enk3TnjUI4OQdzpAswF1hHT6u19pzW+dH+vTxn3W6dC6COlXCgaDDUbZjATYXRVq 108+E+AfaKE1j3IMVbrYu7UcvUWgkC55khlOG9luqMf7LVO8uurmjJTuwvq9snU5 tb5540Wa1Xe3M1BylbeA0A== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43jaj5f706-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:43 +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 4BIILfBc018984; Wed, 18 Dec 2024 19:17:42 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2043.outbound.protection.outlook.com [104.47.58.43]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fafu0g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DueRwwfj9/Cu0EA0f+6XblS/r62pw+pni0vF19BBJm2nsaUSpKt5azBo0G96oUCIY024dgC8p+7UI8trtBdPUJoxRj5DBsLp2lwZeUEtaZio6rID4+zvOtI/ZrmbeCPk1052XgwlCs5dD/MJXDMSbd4p92FS1QmhkSLy2M/EWin9nKdyMjRmnfOebJs/Oj3lhT9eM1yDJEHUAelLKTcMp7GNBF8I1s5cH3ttLAf+a/sM1+5V825wkDk+BF1fWcqPUswSZRQw9DhWYTdiQLa8C5j4hrEtwhPorzvjupQCjWTitRFK4nuZOf9vXxli7zggecsHM8aWkzPP3McI/8dCGA== 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=gHBJV/ELYVO2y72AYgs0Cckm4fTOyj0ANdcmgXZSQRw=; b=Vg0Th7UG95ziFb39qJFRofLV0eRl44a7k67OvxHQFOfy+RjNgt9LpbO0bu9DL2uEQ71asWoBph8g1q92l/xllUBb4EKiToGSqVPxLxHCET1MJOJZBujz5Q0BPDVj+y9atlAlTV9grZLlxMBjBc++e2Z9E9/mmo9ZpihBfmKfhTRzGvmInQ0yUyUtizxKRrE+SwByu/W8WRJqKeL9rlykhGmPD9JOeaYww4GLR+FjxTLhy2BLxbtymUcKDt3r9eN3o81z30sbGy7hQi0xzOkwDHMbo48OcZ+1vv+YsmEpq0fGPrqT+BGNrVbYXe+5WRVDirKQFUPf3DYtOOxXEJqbkw== 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=gHBJV/ELYVO2y72AYgs0Cckm4fTOyj0ANdcmgXZSQRw=; b=JZ8ONsmKY+YIlktyhoaH3qFYr2ZZYlNjkpOE8EpHEAk4IY0VqTRmYd4KnpjQZYVnv3owxPout87FvRtA/ugvru8U3Rs6a1U+XUkhtxRLkIQWZyruDkGG3/CJfM22pclUw7PH1C0yFeSe1dvG0tHYa6P6xKgPDkNd/SWLKUQlwQE= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17: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.013; Wed, 18 Dec 2024 19:17:40 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 07/17] xfs: Fix xfs_prepare_shift() range for RT Date: Wed, 18 Dec 2024 11:17:15 -0800 Message-Id: <20241218191725.63098-8-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BY1P220CA0017.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:5c3::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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: 203c685c-9a0c-4f50-ecc2-08dd1f98a3a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: llsZsGuRvkDnuLNbFk9EBj9jIt1SrQA+cQ/k7QyaNEKkTqNfN8gP7Nqk/Iy22XG0FX6CpohvdWGQZyEkFbvZanJY31eltx4WBYnCFvw7YCvyjYE/uKw6o7Aj9Cf6G836mHoteQhAJGfz7gliVTti7yav++ENHIKEQjtwGkOx/tBPOyDXvvsZayHdyKIIa8W2UzhTw+AtVxgxbpPinLdoP6sC3BubWN3YwWQNqh/0zzoUkfZSO8bE6qfLpxqHcXiArJ9if+AYfm6iGqpeyuCyb5Ka5+2niLiMaih7JSTM5zDq6CSLSSzJB7L8uEJ0fxySzW3KviuD76NHKTjKh5Ys7mYn9DUDCMRU5kxWNSuPkOl8QwL0Xb5Ynm/8MU+RO3M9G0QnomwbuB3UAFV/FxaAcnly8YCvgvs6gSbimjZgirMRpHQLa1pWMRfQAHj6Bu2fDvDo0yX3PqGLNATeiZGH2Cv1O52J1Lzg6+/6W8iL8zGsA8usoce7i2Dl14rc15g9uFuehgkD6zNn5sxhZJlzucToV6sZwsBS+Ke9eQ5iZ624IHKKLWkuh8pRserMb4D+IxC/XQ06KhepvCrUVLSCDKluwXFZVJAdExEeqPe1lB42MolCvsDsyPnhqJOgR2Wi8a/Ki5WUC4+Vgu7vREUlPA2QxRjqSENDw4Dvf5TFPNC+ryKtCVifAZfTPWxFegmjCc1PPuhNIKq5FbkndVGPLKA/fN8jxhvDc/m/diY0qValIDeZyVQ8Ll08fGk+ZkyaH9SFKeTjmfQPuAP0Eb9fvNKP77tGxol0/sEyA0RvD6pEzrYyV05BiqSY3oRHRIr4a93vEBsEh1/mAS8yXZcQBnDpKIAp8PslQK2Gcn2aiSczJEtwtkK8vycfXa9n2iMTxm4DDEqhf4yNHX1RLoaHXs5NCWZTK4Wyrw8V/BCFnA3szOrRP0F79Lk3NNE0lZJ/2iYLQZqXbcEaYXujJE4uT9XMtMTD+kLajFUHQAtC/8VhlhcN1T56bMbmsVf2W9bxlOwVVkBzEzxTkM6wRZVdMgZeoGkjYill0OfQPdI7SrpJf4AKTmcQP0lBDMihw/5IYKJohtfDW9/qZpTlLbkPVGkBcxQ9iBNXLoQFsA5QMMw1DS1mFRCLZPTUt4/gJQkOcvz56Szg4H7DFPkDexbhZ7uZu+6n8TdcREvXQf6mOp9yN2oLf3BZgGPZOgPK/peLKYXlvu/IAxwahCZLpTR0KvxIqxcxGKPmnYF6yLy/QZzljT6HgVWSzR0JOmmIiFaTKSGZrvt2UdmmFcw4SAMMFjoSdh638I/qgXXaagojAdVXx+EXY7cLY5uLIYObP4m/oH19EzB+Yp9uXDakWoUORXLE12BZhSjRauXxCuHPTbyEH8/3nGIaHhJUYp5vMwgE 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)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8/4eJEVqgtVxP3BbqMi+2xDvlbG0TpH86j5KtZJI1U0AJi3dIeS2dKSQlBllwwyMyhdP37YE2xV2xT9okvJcj0p8doCeu2ctQYIdMB0nbu7vFnx0SAcnE+Ma/zfRw0FLzAwSp+q6GZ/Ntf0sukSr10f6jpFV4KpXg7HR76PAohO5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/B/oKO6DKE62DjPPPa/NowcOekU15rqRF259q/4WfGy5tLgMs5OINHrfragD+BSkk//JFH6SiyOuoYBNfhY5yDwIwY+4iPsUFplja89eRc5/KZj17XI8Etsp95Up/CwS4fAgjtqt6ba6bf+4kcE3hWrlCZXRq76fkIc6n7UnOn2334/do+gdWrMQDfMWZibogfjj9SSx4cyW8WntX1Kbd9379AGNWxn6eZrHlU31Qu8iujhAVYy4HjAT2WbfWzxvxN41xoofzFio0LIgy4/l+Wc5WTlYysdSnbRuWjpS5sfo5GMNUZ8nCDh3953PerUTI4RDi5QvAyoiAsubNhK2uGXBg6GBCh+8L2v/G0CX9cuvJcquuh3hDnqydtf/DYVMoneKc52lm35evg+FdnELrqZOlKIgyilTdbnUrZny/8VbAsFTDm6TQw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: jiX92j/nJpnO9GfRi0GPRsZaY2WK66TxEO6BOh24MTwpU+abxt3e+PqFqPGLXeRK5EWRt8qNJhwPWTZqjjD00qiV3drLL1ShYtD7nmoVJU2TcIeFxFnxp2ai9voJ4jSF68p70Kpqe3O0DNCeW8LHzl1Rb39K9XGfazOehDz5s6NJVIGgSDwUt0oa3/827wjkJb/CW3BxU3M8HCQU6mp1OfB2Cri+gpmDqrHj6yrKgxbUN2ithwdW8zr0fPjs8Mkvzc6mATz7QXqV+84DYLj3OYz1l15EzmyMl+99OmiG4eNbeujM8NLpK8/yE6+yu6OXaQtr6uJqPF5RfNoJo/nfbRuHjj9xXPQaA+eD15A71zOTq9nhkB3zakBygEF5u3gqPPKewQTkmzJWfKw7q+OvcT+ZlsTrMcRVWW5hwo4Ts6048jlHML866O7gW5pl2g2FB2z+V+ejpzOAKt4aKRB/trik+EjGXSmzzzXsCZyuPaBgwdel77Dfe3tMLlxIjRAYPhOY2QKV2OMgaWnIJ9FmPJHVt3oPisVRDmKl6LdQZO8ofs8QCOsmLSAiFgvImFpBHN4MwZ1QGpgdbpk57wNSIGErnWIXsFXMLvSb2o5vcmY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 203c685c-9a0c-4f50-ecc2-08dd1f98a3a1 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:39.8672 (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: PV0or5Chkm9rwzP1aoxJlYudF2EcQKwjFxSg8MKPZEWQ1X4e8R1f+CCnxB4IGlI+5uRSjvDGyTzdrEBpT7b+bZS4EAasNpFI0OxXr00cFlI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-GUID: sIIfbREMRel6zrtkbpuMA6TbZE35lkaL X-Proofpoint-ORIG-GUID: sIIfbREMRel6zrtkbpuMA6TbZE35lkaL 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 Acked-by: Darrick J. Wong --- 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 19:17:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914071 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 4042E1FBEA9; Wed, 18 Dec 2024 19:17:44 +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=1734549467; cv=fail; b=EwygDib2dk4wffeJQzRLEvsCIL4h7QGfIID1G228cR6gr7SiTJMsbRYdd+eyjWkHh3AdI7/8MonIscGKlMS9anvSukQdU2HDuhmiE4UK8wssXHnEcPf6JgnGgTlFWfQaAosLa2klLSIbYnYsnOl/K5bgzOSCMkLSA6BXnnqqwOU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549467; c=relaxed/simple; bh=e1LKVIhTbDxpOxBh5J88cIQIoP4yTbI+lcb8LVBh/NE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=KL3qoYmLOSVNB0/HyawZkr+yrI7AZ0lket9yYImxHXiMND5Ez+GHmIs6w3CdUpAXQ0gScegyU3js8tnVB1MQ1DfvEXut2IV5KqG+nIUUc0UICvONSfrIIMtWXQybVhAELwWlyfPoTqRB4duryyTd+hqc6ID6HQmnPgRLLEnIPH8= 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=C4zSDC/I; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=ZTURjZ4T; 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="C4zSDC/I"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="ZTURjZ4T" 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 4BIHQcjL029670; Wed, 18 Dec 2024 19:17:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=mGn+jCOxOPPI8ohhE9B6ENtgDYWDIzypUll0fni4hN4=; b= C4zSDC/IH3KLBws9WkQGtDOkhAfGQlZu/T/egEB/dWA2BWREOPPUbZP9kLIpBH5g SOWkqnIpHym9+xcw1kkOpkagASY9oCxz0kIiUbVJm2Hde9Xh3yD0deBvbn3zWZmL lwx3YUS2/Z/f/yAW2rJyJunDquGJTeQexf5kZVC9cg/+4YtuGjDjWbGYXOitSNhd kI4eLlTX/ObyjmQGFnv9ldJXi1SplAqcuGFrVhWunWcFGNcPCZP/l3FI771hxEZK Mw9yXTSFKFqlmu2mB933vvonVJ+pwFLH0zIiw1kwn8+kwd0NL2wgCjndejDbjb8Z 5XzM/j8M0299GMzja7Fykg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0t2hcqw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:43 +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 4BIILfBd018984; Wed, 18 Dec 2024 19:17:43 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2043.outbound.protection.outlook.com [104.47.58.43]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fafu0g-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Fg25dlBwUvBvWSHFX6p9v+S+fupPBC4j+5WYizVLj0B/d48QYSeWYleuaYCtjERHDtP4nk+WR3YmVL+coligBYFP2DyQn7RZ3SY7mRoNE22XjG3b869Fyz1XDUDuyVB++lM4BQe0IMGAXJbQx9oqvrNxtdFDX5hGWBnlJGP6MB9jMo89kUALBB1uMfhncMBsM1Ms608vP60662oYDTiacFORs8OW+QWKW0cnJcaP3S+L7XNmBoNxvlasY0b2EQCazsYkAVFbk1zuxQOfI2IJBzQIcj6z/Nf/xP0M/gm1LiwivI+chfXgOQnwIKaBcR1/hE7ZJTCMjoCrL/0PZwFCww== 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=mGn+jCOxOPPI8ohhE9B6ENtgDYWDIzypUll0fni4hN4=; b=nJ4vXRQ0cyIL6EvtKJ/eT9S8zx5t67FPedYIUZUu6MQuQh3uuo6+Y2Awo3foSpQAEfC3V8RLeAwpr/gVY60GVPzBqsnYvyPQ7vYnO9ow/JshX4Y7M3SFPH/AASZBxVFdBBxpXWLJLpitloh1woJYZR3E7xs37TpHWH50dGvVnsBzTDKIIqHb5WU7rk1awMJjRII2vPc/GBE7ULGJQW+CSsVkSeMsnqw/NnkaGhI95ghSEtQIo9yzFHXYso0mPhiFgghd6xyyEyPPLEkeXtkRETplC+5juCtWEySqTyJ0mZ1kB/nvv2cRZB3ZoQpd4IezFXMDxAcV11gDMIAxF27qBA== 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=mGn+jCOxOPPI8ohhE9B6ENtgDYWDIzypUll0fni4hN4=; b=ZTURjZ4T0CsC13MNQocgBaPsK+XbvOtsPFFy18gJwfaynhNaSxfYX+Iu3mW6p2iKKlN0rV+IDqm0uIjEpI/3nEKBf97JdYJHQnQO9dlWS5eNCVotoaXgpz/HCvtAYs26DcqLN+uH4VgzrYxihGY5GzZODH48eOBp80AQon9Iwj8= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17:41 +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.013; Wed, 18 Dec 2024 19:17:41 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 08/17] xfs: don't walk off the end of a directory data block Date: Wed, 18 Dec 2024 11:17:16 -0800 Message-Id: <20241218191725.63098-9-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BY1P220CA0015.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:5c3::10) 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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: 5ded68a3-9a9d-40c7-fb2c-08dd1f98a4b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Rel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zgGq8HzPqKEMN/d8lj2ibuBZVGHjnXb6CPk5DJ018Wl94R3ecF8TvFyPaD3okBJoq2ibAKuf/CJfS/2NHW25fo7RR5rHOOfJFoswNd/buWX+s11PpxDoaPLvhLnXHDeAXmqzcmW5JiQ8ljQkI/ECom1LgXrH/7l3kqnzw4WG17QrB74EIv/UWD22tJt9MmfFVZCdHIB5jmhCrBy4fd81JU9oX6thUSUaHgQSjiHSCPkUfLQqnzX6BWmLWNk3bWEgtYxfm+8JlTzr0RNcWfc+ey5aWv2UFuFyEtTafhC7gKZgsQgdYtO5DKjnmhCt8xkiP70iTGJ9s9vFVdYHRlrjICuzDrGlNKd3o1Cuvg+jvEbu0UhakHrteJXkciFpMv6gOr96S468K9qyy5AOxHf3lh5E 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)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LLEbqgqGmhRN5uA+56ST7jOF7yRK/ZIO/0Nb8l5YP1eveF5AXyNZglEokk1yr8SUfDAjq1WoKpUSDEq35IQM448GHirSwheoXk9GAmlwl3KNXMHjA4Ouy9wRr3mrXBYFzgqwh0YA1RV+cqp2kX/VA1DXDkeVhFEQypLfmQakM6vmvQ2If/wdSNwrz+FbYUC398ZJn3G9ZtTDXnqK6QxUtmAidUnhjEZK1vpbsc7tnJv7lZE8SH7+ohYRpwG6aKcjf1+ZRRdAF8y/gaZ7EviEF6qpUHIuZcpx4vHqzM0QsMaVyJPanZdS5e18+234z56Vjr7YDNd+nweJhyHWbpC04fG139Uu1lhT7oQ8HGNW8TxPNq+M1iii4qcHh67oQzaqpSCNj1H4x9mDmeZIOvT6KSxPCdpwHOZ6WJ6RrfHdYQdG0REeNXmsbCAMZ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KyOPQhSvjtCRJ5kODnnXtpX9/ipDv23Qs7fg/omfUdjoLcEC15bM+8o+BDfZ+pvdOizHmZKp+sMifsqWyIXsvrtd36OnKd17glNnyZXls0FKe4EphAwn9/3MvMYASi6sS1w6dhkbxHjAaToMRBfXjwt1acTbFLjJmMDnajfvJA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: dFYnS2HrO7Ws+vtjOA9R6IjyClAd8GT37oPeolAkq//X10j2M5ayCVZ0B1LUCi2TY4CeLc54pWvWiM6gOpDZ/ckbECsL7eINxlWdaS0LD3djFsiflAjbaTXt8wN9meCvactEu7HWlghYnLEVq8z3wpns0q2mSbg4ZpnLKRsUF4ufIr444pv43693qDYEKFEhIvSYuwtnV3ojp3SBWYoEXtEps9mC5N17uYEZw+fRuW2UAdihTjCXQQNvESZHbt56td93nRPH4yGgkkrmEtHh3LXjmcPVcfN+oCZhERibPEV6d8rx0nJx6+P3aF5mGwjdXF5vTpBtnYjSvDIHCQCiLHdEQtGia54HYT3bIwgPqjVdeGYpv0XkqGAHPB4YzRAI7UlYUxxaMjTL87c8othO4siPqOamHExXkvRBmrpgDesRAHSZLqf2TKlqQE6YHCwNpLgi00kbpeZXIfLGJLUSzXRbW3eAis5Uz94oCZn8uPCY1peFZi5o5wz2VNq4EIO3ycVepMT7Q9d6H0hw8IM8kipQhcwWMdxndbWWyOh9aP/zBMvJOWom5XrdEXvzvAUnGmHsZhOXL+oVsx75hgZMu6f/T2MZrRBYPT5M0oiESc0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ded68a3-9a9d-40c7-fb2c-08dd1f98a4b4 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:41.6816 (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: CRjjqz93O6vSBRILumgrXCR6TRMU1QeGYabule7/v7luSjdbhwk+JL5JdS17lB30gA3OidUw39hVZc/auma8caExB/NVIwMZ0FXmkWpEsbg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-ORIG-GUID: -hGvnETYUJPpvUA-_SAaWJYkr0zSgu6c X-Proofpoint-GUID: -hGvnETYUJPpvUA-_SAaWJYkr0zSgu6c 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 Acked-by: Darrick J. Wong --- 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 19:17:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914072 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 73D0115B547; Wed, 18 Dec 2024 19:17:48 +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=1734549470; cv=fail; b=LqhMEqeSJlrS5Pmez7qAaaB9Pm8JgFQZnrUG5g4h9SL2DNK6Ae5M1ArVLGQVnxgNTxKV5dsgqoXtbHKma1vGiJHXMJUWi5SzB9CNqRvzK0RF2qqmvtDycowuKLqd7NhaV0K0ZrxbnFfB5FHIHId9GxRPUZVZPTx1YLuJZ7Ig/Yg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549470; c=relaxed/simple; bh=4/LfefC99R8B4BrLYyxyNHT221YnZhR6QE7WU2us5U4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=fX78jghQrukD06uEUqkSLq8+O+cKziTrNDsBh5Ttz52lbDd1++eM2tu+MZyllbtpdhOcjQC2a/lzNBpk49phTQZE4eSwmCxHmXplDu/9VJREUt3tCnNL7kpKpQs65HkjJiPxOUSB40DOKsjlsvhqe1fBhyWwdIRnSS+/U60UMl4= 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=lfzuPpvB; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Quw52uOQ; 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="lfzuPpvB"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Quw52uOQ" 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 4BIHQcmA024342; Wed, 18 Dec 2024 19:17:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=kCTMZ8qNR4d/HNnY4Ii9wavpI/BBtPDG0bOSH7PkxMc=; b= lfzuPpvBCDFUPxM7kV8YAV+sMjBH3atIngHyp82vVPNsQyn9Gh6jhqZ2/6ftNXjg FFdn29Ekf+hetyuV4uJJ6D6oKTwXgd0Ca6PRV/a6Sm4avQtqrFutTvcwSrApUlqr 7Mf4wZnAQS2MMV21YmiYaEjkmNVYWqP5+K/YqJLwAY1XMxWTAwT0SRs52xYSfMBf Eaom3Vxd3a5IJUalq2P2DIObEFIvxJTx36xBQ5kgp4oQZYQt5Q/mqLXpY39gPfcQ OJBz7sZ2+eLZ8xmQI0B24jJBIzvlY5cBcNyxNF2yj3nCGu0sFlwVT0HEgLLj4cwf qZibUTiGOhh2PZ6LYoNE9g== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h22cseky-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:46 +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 4BII1ATC035673; Wed, 18 Dec 2024 19:17:45 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2040.outbound.protection.outlook.com [104.47.58.40]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fa8gcv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uLVBp/wzaEWw5UgRQT3QN3RCd1n1Nc/WQg+J+oXFBh5YM6dEo25aJHygsrjndISVfP5YV/ruJoz4FG3AIeyjTvY+dGLzQqXFxPJUEi8BYAL4IxUH7JekyorbkioMP1aV/Bo0tSr0B2DUaFo4XUJFCP10f+Mu33cm/5d4Y2iqdCoqRXM2Kj3UjYtqQ54SGDGMpEnC5wgS5iaz6Fz4jAYcZ3jfRvQGkXWgn9WhO++SX9hXCyD3La5+WLzinKEWuGnkJI0QAkoAcm4/hvftzvJJGuiAf/8J91hEG/MplJEXYm5BbefiAE4fJJIbwBbAz3m1XG1PULHrVFjhJX5VtE6AHQ== 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=kCTMZ8qNR4d/HNnY4Ii9wavpI/BBtPDG0bOSH7PkxMc=; b=mCdj/ufS+SX8kaGHrcon9aV3hglx6b++D9uwy1ZBpJngHm2BP4STbeg5L7AGJCJIX7p9CDVFZJjE8WBMB9DDNS1KbhL76uUCv1Ha1ZGccrsvSzk2E+kVnYVyP5wbeJUVT6rRK5FNaRF7lck8G5czLfGGdo7MsCdAaxepFC9ioQRf9N8khc9s1IF1xzQgGW8eBeWpX0WZ0GL2HShYzRIACOE9iYbBNpotAtQAFX7c4eeSTRjPgJobya6rryVTBf+1RBkxpw+rCsTg91b37OrozVF/fjrHL9PDFay4HBmi08yYFBMLUD+24YYsr36VM9vf4UZ4Z6J+GTZsVpC4ftjoew== 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=kCTMZ8qNR4d/HNnY4Ii9wavpI/BBtPDG0bOSH7PkxMc=; b=Quw52uOQY8kgW3chL4oAf2f6/erW2jNdVzubccKqfdu7VW4OrkCYsn/ymr7nHwUSjc20kydIGmrO+IKTiE9klc1AFEqJFjTmfO0uNPbDWNAxc+jGtb/NleTT8/C23nBFEkTWVQscIgcNHmKmB4Ks90/wDLY1TpxMJ1j/aCp0GPE= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17:43 +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.013; Wed, 18 Dec 2024 19:17:43 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 09/17] xfs: convert comma to semicolon Date: Wed, 18 Dec 2024 11:17:17 -0800 Message-Id: <20241218191725.63098-10-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR05CA0022.namprd05.prod.outlook.com (2603:10b6:a03:c0::35) 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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: 73dc8bc7-a59b-4bcc-9320-08dd1f98a5cf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: T4OVMKeLl4POFi8fnoCvSUbMktTOvNHnhxG1OayT7eVCRwP7jBWVmynS7Ey9tjR15MGU8T210K1LrtElVceoZuy/jGNp0FHA+vYPPRCMzvWDP9drb4GrKbG5L0ZS/Gm7dWG4ErkrFSccZLf+jddHvJ9hcVyxb+kfe4oAJOlFit3icfumIqjwEjSqxnAt6ajz2cyBCvR05a6R/aIsmEVjTQDMp6Rg4oeL3s4kMvjIQ2OqtLooRbdBhz4zYmeaD5R08YKWk1ko8wRHXwm44CQI9573+FJuZK+/cYVxi0iguePQO2ebjGfgvvaZwth4qBmvwhynOGfN4d8u/sgJFxiR3P8TtyvP8Cv0+cgfDCHHNjSoO1xRj8ZurwfcrjrheThAsTB8DkKiJRtUBqD3GmWbNHZVoCqMAM5Ek+DceqS7UTE+oQ6XckNd5hOyJ4CR2bd4L4VeFC15PHQo+YIqwvczvnUS+hjdF6oDZmU01WcruDPVX3HbvhSXiy2B2sF4FQd7CCNurrkeNbwc3jliYZVN4cJc1sTeWZAVoB7uVYza3kKwRO9iBIv7vHVsSjoaGf0SaMqryJwSXfhuI93zvCdK5DBjZ8R6Vliv0XMsznrzDoc3sBhqwWbxbFbf7YxBzztR08kNcYQ+8Sv0OlX8K4zyKpHWi4pxk8SGl34akCsvrhsaZp8lBC4t/eyBAkkW89xb9ygk9HQl0dbW5vr21o5Fy97IfAwFLIWyU6INnydIHE7zdLlBJoqwWyUHS1HtWz16rV6Rt8eRyTqA4FZU8lPsPvFhQitwfJclvMP6L/JIVjozl8M7XIRU7+YxSy0l4Rky5sDwO3VtNbZMzG8gMD1UO5jnHyVuNXkiAR69U4IcbtVkHzw86OPR7hZckZb2BbDI+yQy7Ikm27cvHg2AUSKw/KYuJzeEwmRxVrTgueMc2XKHkZwhVHfn0mlxzSZUUIW/ZxPKO6QlVFiFWlhu6JCz0Npg30QXDnzSoTp5+w5D8CQsFgOmqxjqIaHk+JjrIBwzPf7i1+yaIoPGmNReddOdVuflZYpQrLLdtbFSmLzcrhocM3k5mtH+fNRYd/GQLwUVk7jSHq22OwRVmzXsiTE3D/iwf+TvbxozQfkY9nMkRkhxTDyhMYpvqDOYCjckBZaTfmAmRVXxtPvu5mZ78iIG1YsjDbzW9MiXXLspQ8DItR7cIKzXsK3dLKnYDVR8/e4UA3FPaUuxothNYze3qztoCgLy9mp6YVgw69pW10CFkxf30wAGmrADepiCRObpBEwGNNE6KmfNXDDZBG3c8ftfeAG63Yx+fXgvIzzXyLYcJEXmDsMFWU4xO6nt6cW0rStk6a6FRGxHpaUHYjm2S9AJhMgLsokei9ySlMj0T6shpV5DRuBeI+2If1isCg0pKeQL 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)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: p3o95OrzfMsYCkftN86W4RHpMN8cbI/sNeRJwwrqpWmq+1R4lHzFzZ3CVcoMVQVG5Su1rCWmiuECzQgkkhRTpM3ymJCe8lYfry37E8z/9TB0Pk8+qq64cPXSm/KbP4DVEKPxXQnI8XRsY/CAaWFULoO/VPJOoUUvyOrpQiq7NWAKwwJvu0YSK2fmgEoW8bSWsrBfz/wM/D8ZPf6UC6QuPdBSJGBcG/zurUOWkgfa6WpDbW2e1DluyoS0oge9me+lBgsrV5HMSPLgdgCFzust9kth3TGV2rpKYY+mcf+0Kb+N5EwXYPvpeEt8YJXMcusHjKPn1LccpO5OWlEZuMpoe1BMHb8H6ZnVGdmTHEzd1RKnsCstoLsqbTJ8xWtYoG48ks+TpuLvWLnW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TWvBssxovlJ7RGb4mjneMk3Tw5yPNOELY3CoYY+6eUmadXVaF3B3yhSS1kBrRuZRpeOw6vW4k6ZSZANtmx9qj9BpnkgKqePV0Av5Gj+9bbpqsOme0AT5gBS4jQErEbIFWb/QYaxtSmG5ySk21imCxTvpF2Bb1kfduw+2vThTvhid0FZyv3chnuV35hNAVpihVCfbjRDOozrfsF1+FutnSMrTX7nKNOJZLQQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: XDXetbU3vq07nN1BFAbKhjrKHpREE5X3/2k35KPavO7H1zoPzliHOZAo0fxldlFLb1LGlSijNnt/YiZpySsuO7hURB8OPkepY+9tInOhKZsTAE0rPKbGstfAj+DG+LuIvyhgaWFpPgDTfiXRTq4tWGHZR/Q5qZhJZtWaxg9pOw1dqrEsWPe1gm2FsdA8NPQi8A3w14n+ezBdpmPJe2tLk60d8WgaPDlOD4AHMG/hSJIjlgapUi+YW+H5vZGT3gw0BuKrL/l2hk65gIs9BefNZebDm8zIWjBgHN5yhBSXLfbAtpM+JNEi/uhl/F8MXGkbLbuPXRoadrsk0VbBoDf3t30VoN7ivKz0vSsmmAqImjzR2RcW7FgoPMQelNji3nWyzwM8B59qSdtQyTSVDQ1/zkLqdNLlbXW9jCPBgMFzvd4XoFMs03+nx7rzkodLW5JYvlVe93sKDmmEyrXsvTCa4Wm+WNn/wmfaL1BcV4sfK6GJj5rOXJ0riZm+6qI9jmSzj1nQdiprKpb1fyfmhLZ8+1Co5qL46LSUA+kysAkiSFn+CvvVF3yGFJOV+FzMPxJ3K5Ir3hz1QgYitstEAUU1TJhovNw7E2kyePMHMN+Ur10= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73dc8bc7-a59b-4bcc-9320-08dd1f98a5cf X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:43.4782 (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: qqquw6Rw6Du66Cdsc3zG638Kq/z8B4pKmcuEFuYp4RG6Jhw9fvEekzsPANPOr6WFdES+h77hVI27TjDWzJrExOZxlQCaaUW9lg+CG0fUCMw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-GUID: lRzUXqst4cYbiHapujG1Ga_ENw3mou20 X-Proofpoint-ORIG-GUID: lRzUXqst4cYbiHapujG1Ga_ENw3mou20 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 Acked-by: Darrick J. Wong --- 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 19:17:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914073 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 299E61FBCB5; Wed, 18 Dec 2024 19:17:48 +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=1734549470; cv=fail; b=AeoDVKsQbQJeHeSxPIULNpXnCaRxHFvbRKyDw6vd/97KQAhlvKuSNR+xUBwksmHxJMLlQjZscDlVDIpCqA+bD/pckE/DscIDZcunR3Df0BP92N4TZOR5ZPdPA91WXJnquMW2C/cRuFHgSS7ezJY0KO7FRF2TpKK13WmTxQGaF98= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549470; c=relaxed/simple; bh=Fg+JlYpAqOiJHXu1oMI+jVXa1h+KpKg0jyIGpaokL2o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=c3hOmwLtpY66vssS5naiRkQ1sImQa+wvMN5RDSoDa37KNHOt1XO4JTnUGAXKwx2zQzSsotkQ45xbh9OdOiOWXWInXl+/xldvEl8wChjUC626XB2XNWl7n1MtkRP0FHNIJEbhrBd/G5//6ICcq6IUchmPMRGsNfwpEFLtgVRO1FY= 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=TZW+cE1j; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=KM4T1Tl0; 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="TZW+cE1j"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="KM4T1Tl0" 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 4BIHQc0M029546; Wed, 18 Dec 2024 19:17:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=f+9HP2HdKdvJC+P5RzVn93Ab04XUI3EqmNo0GNsVans=; b= TZW+cE1jlFwt04kMXUKd5ckdgVUY/44GOKY59fP8seEK8huc4C52Z+Tg7si7s78J mCpnCDVeJr5AKAiV+P0d4t/mJV40OngnwzNKT823R+12J9XTrUd9vcfRRY7KW4aQ OuxomMZGTlBVvFR7QOrOe0PT/zXg5LSIqkWV1VpZgLiuROCGqu6lBJY6ZvLasqVp Ta0bsuwNfPME4jTajAIFr4vlwlMn1lLWUFAwyzQHZfYNW8+j2UZ8VljaIu1q+4i+ NUnCJsHg22R6i5+pqaltQiS3eN/ZQ8kcXDWQLyJ4tbaz9KNFxuGBrDp6PA6e+++y tC6hoayRF7BZxI0fHXnNNQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0t2hcr8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:47 +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 4BIIUIXj035296; Wed, 18 Dec 2024 19:17:47 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fa8geb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RwZbMtcVt5zscEZfCk8KYtXNiJxYFxg8opUF8M6ag93a2uVFyw/5U3KPkZPLpZ26ww+zsYRa7yPU9h3s6HlDKvdl79ks+oOpGNrcCqT9qwVF2wMIcfdd+hbJFNk0CTm3jcujTDfvcqavNYvOZtGiC1IkRlIAk7m2uwbBHC19B7SbeC0Z82ts87TChwmzAGml7d403j18c8WOeBVT70clDirgt/WXc2am57hUZrivKh0YL/QAJ+NODfNJdEVs5G0nCYG5ImYZ8sYSFyV1aNWDE/4F2Eh/3mEm0h9Rv1RnyJcPavJv6yT2j29bZpOry4MncWIbQWYrCB2jjDWmcqMemg== 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=f+9HP2HdKdvJC+P5RzVn93Ab04XUI3EqmNo0GNsVans=; b=q60Of5eYRxKSWdpQZyJAB1ZvGRxF+TcJkH7PE5QAwPdiCDiugB1xzNVDjIUiUul9cUVFfX+dzoRps3XtJCu9MfTSjD3USsysZd5+Z1AkfexhAU2sSs+aeq9/0a56grk4L29QMuSnmRtdtWZdpeKYSlEyKGKWP/egWgm+0fwysvKQtWFbQvgcDtQvtifWxusnIQM9fl0cLXSASnjdIK2UWn7vuVslVaDVu3ZjHHPs480Jy7Hpd1g+nwj/EEmcnMdgScr04/oF8zQTrrQmb0gxLUhcerZmweQfkuhzCcT50se0cw6EZ+BPkQI7q9pkM45eKGT+dpXKyNZHGyUR/kjhYw== 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=f+9HP2HdKdvJC+P5RzVn93Ab04XUI3EqmNo0GNsVans=; b=KM4T1Tl0LS+89g+J2L/IlD5l5MCCk/QtuveGkLl+cA/mbnKzZVL4edQg3XlnJnv+La8STuoKf0M2Dlago7ArlG14bWLKtDjTokV410ANQTFZu25gNm4LM623cPb6bamjpbEXLFnodaKuV27mycUsba+ENWJiLYtHeS/NtWDa7a8= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17:45 +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.013; Wed, 18 Dec 2024 19:17:45 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 10/17] xfs: fix file_path handling in tracepoints Date: Wed, 18 Dec 2024 11:17:18 -0800 Message-Id: <20241218191725.63098-11-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR05CA0012.namprd05.prod.outlook.com (2603:10b6:a03:c0::25) 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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: 485f2e31-c00a-4a01-ee27-08dd1f98a6d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: xQFjSF0R9qsYIE9OLmlycomabNUUOROKqmQPzyjBSRslcvuZKT3YAntClLt2oXM7svn+w0yoYwHl5yPb1H4rFiXffUhJhFpWzq3Qwn4w2hLkxhV1wuPLCcydRpJsvoqyMsF8OX2eRljUSXnlPpZdADJA6iwxVe/ALPPxd1Gcc+0Ut6f/mdvorB+mEbcN/Rsg6r9TUrDPQUL+PcS5iLlj6y22KasRT3hdjdHTZ7wlZWglL19ABK+Ru14KDE7nVAdbMIQsoRg/COUQTLUdFgUBD4GHowzlyPBIAc6WQAcs6vFev9Ku2RbmkxwnzOImUPhKl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sVhLmfBsU8+V6ateV4+g 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)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yRJWkUYCU5wk39lNUINB/um3fH2aV6XFOgy2vHZABTg3cN12WdtqQgSL8L3VD464nXiEjS3iYcPKSYD82Iu3l6BMb/gYZihWjeoUK62VrjmEkmlRKhFRlUZ1JEt/JDv7grvvNJvR5klhZOYD6vwsBjFugDjGC4KlaHOVv0grRioctprMGJwFmuWGOKLy4N2vWURwqeY0k+N8qIDO/pbP3xiSMF0J7m51yoeq9AQnefYawwFzS/rnOy1gFvsEVj0ToxNgJZFFc7Rtmyxvu3nYvfK9taBAxk+QO90CSoXvsSI1Y6wD9rT0t3A3Tt8USss3P9s1kpzrUFxzsBtx+pbPMLJ64VQxOpKfL9Wcy0uC+wNN25KC2wpY80Dt3mram+Y02lG2mIOy8yYB4DEKJ/V2OS9zEYH5L539xeeYHXhfgJ9QdnK+w6CvfeJ5FEP5ZVLdYqlj/X+xb+A3dy2EBtgkyEc5QkQjTE/gIZPBFXcWJuAWb8vVJ09KGdw6wa+GVIlMry2IY8zRYZYE8K4NWLbBhUKQIof6HWs5+JfzNb6sYInfrO42g2SA8TM/QC8xB6M5l/gXhNxiehL/WKpkBomEduZQM+nfmVIAHfgxeUm+ExRZRN1PFZM9RzwA20abGjZ0KxaiRpvzPtwDwfVouDskAOdc8FRxu71FlwtElF36hDDW6Ic155ngYrIz7TtwzC/da8G8cXxcBlGq14Tp12d4znjyOPF6BFsUK3/KvKVYDT6uhYqPl/49NVw2GakdVasfUTquV9zjEU8FPIXMsusrzdNFXvD6ivLVxS2fqZ/BpPYGUp4LWrzKzLppWIsysxwWUqnRn9AUB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E+Rj6tfmfKu/fhNf9xdKDSMF5Nkm6nZCvk92xUJUaUonNB7pKQ6zSOrNAyuNbRm3TqY6Q4CaEAXSZbGUqrWFLumfS/5lD/ZLBy/SHRSLU7Q6mKmEQjOcKWtpvH2J4+0+URXSiQkd1P9y8gJcKBq0T0GRxDIZGwbItj7fmoTJgitfOHf3XVGJ0l5DunQtsbTBi87077qc7YDl5g8sLgnG0Mmqso3D2+ecVzqM2xoxX1sC5Z8Mqsuzy+oJWU+rEPhvEwMcOm9FWdrtU0MxqIZxOT38dC0nsTJ3PjtlAe3/pYVYHeQRhq4d2IztyBnIgT7XzEm9gmwjO1cP/zpPuZso/vwlXwBC7F9znxfUIKZftOn/xb8nnwOXQyw3aE6KM8G8FNDet7bioFphwj218irerAQh7pnqRDE1x/QtWgxBJvWD9LWLLJ9EHwOTG088iFMQTcfWj8GhfkWKofi9fvbwRaD5WU0Q= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 485f2e31-c00a-4a01-ee27-08dd1f98a6d2 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:45.2313 (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: SOj924Ru72WR5CU5LTYxXCFG/ixDhdmOHN8RtrYxmCcBqX2ed/25CM2V1lZbY2itm+yqEY8E0OLCnl7KYYuBlAS8tN+G0cJBVYX319NIcCI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-ORIG-GUID: pFFjEPuc-Z_QJM5y-xUgbYRKUAvEP1RL X-Proofpoint-GUID: pFFjEPuc-Z_QJM5y-xUgbYRKUAvEP1RL 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 Acked-by: Darrick J. Wong --- 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 19:17:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914074 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 A2985176ABA; Wed, 18 Dec 2024 19:17:50 +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=1734549472; cv=fail; b=n/dwu2HflAyo1boihhISTuGopSmEVXNMjBhVsmP92V091+7vhU0vGk0gr/a5xcJYzw1g0zqqTSDw8nCsgFyq6myoWd4IY3Z0DLh3Cqk18wkzKLNAO87DTNcQKFlt1B22WnpRhl+DsJ/9JMg+zcyqqmGkzGBqpDRgTOMhggDnPLg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549472; c=relaxed/simple; bh=z79gwDdl79XyfZmcxtIpL06ReuSOA86MmkGJzqo+NS4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=RnlKYRcVpwbDfPcj6L81EfgUM8ypFSqeJBJmq36tCWG9XvLsei/rxLU033IXymsFh5MzM4i5gXri2HIbPS3u1yCOhgkStPRpxS1M9aj4JW80ecVIDqGA431j3P5WepqeQZ1UFxVKBvo4x19ndLPWKv7sQf5PckvoWnwV/SewTfQ= 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=PQ5L1+bD; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=LUKUcHD/; 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="PQ5L1+bD"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="LUKUcHD/" 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 4BIHQesO018530; Wed, 18 Dec 2024 19:17:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=od+Bv4JAYxk08jiyfJ4BnzaM82qz7UqpWN8cV+pErqg=; b= PQ5L1+bDFN2jZSnG6GREgZya9iGtoQhOFwOHjiNOEDpvBTp0z624VE0WqfarYLfi zhgLPG+PFxcv/TxJAWZJ6vbAVvuUB6Gr4oxFKS6vGVrvdrVJOEOrAqYSDxajTOmw hYl9i1JCZZrTWeOIZbKANE2H0/cVJBNn8wYd2xa4m5BBtXIKagvF/BFRXobZqLMK f3qC/AbIMuVCjNtStENZKp8Q3VCyj5Vuc2khaCqYnGJUmxEbbcg7nAoLhQxWxv4m s7ePFLO+V4V/3Biom6ghvFKXYM3KP4ikT4m/XqV4akIifismCraClODuSGKf78jt 4l0pYs0HQHEQJj56v3zI4A== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0m09jfr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17: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 4BIHdTBK006497; Wed, 18 Dec 2024 19:17:49 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2041.outbound.protection.outlook.com [104.47.58.41]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fb4m98-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bSxBHxjjn23+dwaYpERJ6UQ1qCbTzY+rEpn/bCiUNI+HzxGbb7tEGFvgSuMuV1Sf8WcdIjARsJU6INkX63e/9qFTrJUGIGXqdr+CxuUcwawUwch1dlHC9k3LCrFmVkgULQsxGLzXS2ITqSVYt01FfAxJ7ENrD2gI0XbfsnZluduW/iQiN2BWwXjr6cZpQQw1gJvSaChzkyukxa1mXgU/zHMVQdHcv/vW2aHOar6LYqiXSllR3ez1tFoRD+B3RemYeFAIKMzSIllmPxWGgQzE2NLfp/JFj5ywM4BZTQFazxvM0avDbhfueZpJAB90Ws49Q653qeCXzyECGZgCbz8Ycg== 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=od+Bv4JAYxk08jiyfJ4BnzaM82qz7UqpWN8cV+pErqg=; b=O7aIFn3avNPtmnHQkR+D0gLbbFbVNoXAOF/JfbCLtpLY/gW/3lskUzSd7tRfVl5e0WNLrr4WvIon92n/aWybo1JaKkJZXPcOsYMYo8kSHnJFZ1oCIjZRLSn8iIWlg2zg2JaUDkZ9sQt6ldWMRBvWEII5+im/no2bAv4IfeHbOauaqEKJr5qtzjn6JXgscUS4tvT9vwoMEs54ifkjFDNc5yZwSycKHG97hvQp6AMqoy1E8JfyD+nPDbz9k+Fxy/RNcksr3ZezAX1dMhmf71L5Aau+lKdSeARw8hoY3FRwdFeVzTIavpfxNbiH9AePx9Jz+b0r2wUZu2p66Poq8OG1xg== 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=od+Bv4JAYxk08jiyfJ4BnzaM82qz7UqpWN8cV+pErqg=; b=LUKUcHD/Z22jBcW0F1k0y/5vIIC6NsAoKQAwmV4rt+MCHJl8rupisbm8C6JwxoR/wf/OObcJvdXspPp9Mir7dKfn85IjxXg5qbdW/H3ZiIxN/4XWPGa/nH0MCpKc8QNLppdyuZZS/drrZ2B6cuzdRfKTQd4W0S6p/a62nkZdLfY= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17:47 +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.013; Wed, 18 Dec 2024 19:17:46 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 11/17] xfs: remove unused parameter in macro XFS_DQUOT_LOGRES Date: Wed, 18 Dec 2024 11:17:19 -0800 Message-Id: <20241218191725.63098-12-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR05CA0015.namprd05.prod.outlook.com (2603:10b6:a03:c0::28) 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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e6a73e7-9d59-4b8a-ba31-08dd1f98a7d4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: O2XBnT43CdoZDvRPFzSCDA2WKXnxVpf/PCKravcFhPJ7fEffSFtt1maWRrOZNd0ReG3qX8Bl7Qgmif4VvYYl6XyxiwOx3bHQ5lU8SvezSm6z8yoLXPvMVzkW4ghSF5/Tew6paPtpxoKihgEDrkaeCo/fa+L/yu3rSwYCSxZfhFiUtUAPh6yUJOT1777AUlyy3Xnw/d+PP0JAiGUYq+pAxfvFZujLz/AcIFqybQ/h3xkRelWI2FUOM7RwWFjxDEMhb9na2kFr0XRTVSuDtRPtIsaBb0iBC5vZfewFQ98ZSn40+4z+j0UzVR8O3ptvjIPdrJmfwQrbSGd60eH9Hd+pIJyY5GW/UA9IXk6O8CAU3eUoJDB/EUfBU5ANtCVIfUNh/YysWUupaPY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PM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Bmsi7FkUEtU+3QbBuvZU+OSfAsxQcK/6OVEwX0zY5CsotgkccXbemiGAVCAxs0VLmnj5GAVaAnCwMFHC9FIkQjPfQkm5edsgHpzmISXhJm3NDoGs+BmK2+8K7Y4p/nlrr5fZmLGBibIdInw4c6Z1U/eev33I3XQsGm0Lnpy6whyMOcTA4lFK+8WwAikBx5Aid1vFhpEjUThkN2YEdsnNeHx+jKuTpheaiuUtMzyqyZems2KYQQ8LfMvEeRv/66PsFv1h2+4+gCIp+yAoSLJWshAsE10Jv7zdho7stC7V2nOA7h6lILQnc/tGdsgdXQx2HiLoU0D+P1TOJkns1hS1yEP+eGoRuUP7yppG1TzM48VqW1jvU/wLfAG2aOJY+9RkdzeNVi/ugrg6EM5wuWytKdGjG3BsD3nhhMaChD8RfAaPLjBeApjeauhG8es75C63sIPu+f4BXDRAhD99sGfgEjZukrNXLp7tN5JSp/TBmLOPEcTvBuMliumgIN1DOMbohPEsuHMhAfmhmGVjYCrWET8gAD08bZ8BNO+RVfNXLWy7bw2/oEkwhNY7A4to9hL3+GqYpxv1jpmCbrT2LVYpx/CfE2hjJ2cpkL0PV/eiMsNuobyO7unm3ytN0RLfN22dbUTNyoqC5V46glBG60DngTQaVvH3RK6yoj/disd4fUtj7nnQdbgAQ0WZVUePrufU0UcBaqgDh/bJVvzUnhNYeVkjOEv5D+P+CYcaFe8zmOI9FCPFrIv+i6qAdEr8BOmMs43dyBc8JWOOhxLkZx/BbsFqmEXv6UjYrKy+VyPv7EN0mf7yjTaI0dBLLzwJal/9Ps4ugA/EkFncP0/LWFt/3GAqc6LhlS6fb7x1qhfras41XWPjvHYuKj/Fpor/z+/52Ouf4jv+IRYNL3PvPhMoiO7eB8dsLiC8RysQ4bThtKoWeo1OlDI++wKgepfvD1KVTE3mDjl2WYMZuq62xmFcrcExX/YvjU8s51qlALYiAW8eyenKbEJrZinK7EKS8z8gajlVRPXmkYOQHZGy6gf25Oz7BKl0csF/jYdssXHpAW0TISg/MGw/oFh7jt7hf2AfNkDSy/x897xSo89OtOQV19PrdMoBZCHwgkGtXuVaXMOe6nKQqr+Z2E532BsMaRkr381W3uiiAYP1gLZ7V+feSBwQXWXEJeegGWeKGEOroZTftfJXNWtm9qFma2aakY2rONCjZrKu6lpQR2sk2U1w8Eu7mswU3pydpI14+yOU7IDI5Unmyis7ccz9lilQ4ZYmCzDl+fVbKBBVYpYsATS2LDwhr0fMkC5VH5+8tZ3wIgBOzsXmHZq4f8/w1czx3yOfGR22OP2QKpC4D/8hMHauNZ6ChuP0tbyUO34PX0nIpJumZrmFlKkdOkOL2pQEFUB5Hik7+UVF7nAC6AjXlDFEod1UGcJhQugWh98/0ecZ/P83RHnBRRVpS8vq6n/UVcVKKCD7wuBdOYN8rXiJHGQkjfr8lPb+y9urBChcXflWnBb3DsUigxCnWxb3iHgYXByeNfltSfBvHVr0F0eKStv5flXlSFN+bwDmYRryuozkEgGhIuZQ16T/Xt71sS3bBecGcSaz48maFHUhbXCG6eUFFOLU5IsaFmCdCd7K0JGVwSCwx0M5+NuhvyunaOs/458a0N91zjI4rcQu6OvoqNfbTg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: wIkk/2AidMOT+i/VuFIH6VMZALOYWFLOzx31O/NZhVa4FpBq+XhN3iTEwGjsly7AKvTyTvnjzf3e0YNeMjiaiHV5SDdDR7uicpnlxnxWFhmFG6VYOLWRAfaI7SMDfN4Gn3WQn1q7FT1eyepbziu2ufm0QVM7K6jmZTyG/pHiNXl0qOd1NsuvMrOG2UAxB9tIfUBwWlE9egCQaykKFw9EIl13d/mGaTJ6COnPCr1PannQTpj1G009oC2dhOSrL0MVpqwPG1fQ0LmVr07jD1ijO9678l6qJYidvzlw/tTuHPDU9ZpTD7Kjq8+jbLnJ4t+vGYgPppVlWvD3xPKSjf/amPjmpga86LWUGMNyX5sEfe99jNh2sWcNpWQAi1RaV5X1SSuKC4lZnQQ8QwWSwVQrunELO42OIEI74ywVgC+TYNdcnggAJGCMGjVAtfVL8g3OKkb1t4t+0t3MutWIO8MdxIYtoEFsB5QsijyA0UphsXHuCaZk+YEY62hoOWK/3JDnIGBDzrP/l9i10LVLnXH+hvun68WxvEYLKoz6t7dhu0XQFyMkrCYHva5ISI9qmgHe0CEdLaTzabR/sjEFcoDC0ic40Gya2zrY723lrrwIadE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e6a73e7-9d59-4b8a-ba31-08dd1f98a7d4 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:46.8944 (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: 6hQsvZSfu8v1QuxNhPShO2GVr3u+52Ei+C2vwZB0Kz84dUxYmDZasNiyPu/ahJ+ni0fmhOUPjQ7tppHopxP+njq1+u9b7Wxfw68m/c6rtNI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-GUID: Zp4E74no0cLm3KhW15aP5BaflTVA_Zao X-Proofpoint-ORIG-GUID: Zp4E74no0cLm3KhW15aP5BaflTVA_Zao 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 Acked-by: Darrick J. Wong --- 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 19:17:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914075 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 2641E15749C; Wed, 18 Dec 2024 19:17:52 +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=1734549474; cv=fail; b=ouDZUNNHcVuHOZEPFs4X79EbINCBPTBY1Sew+oklwhC/akqpg2GEJFE1f384O5NkLtajQpApO8KRd37KGNWaeDOPL7efoOVVyFmpAog8Vufu/QYZOgYrj6n+VFykuGqDRCLy33P1pPKVrNqUK4XmQUVSrOuknNmwD6l8nMeZiYI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549474; c=relaxed/simple; bh=xKi9EZDiY5rNk6BwV0uT5e+uX1J/F58aYIL20AV36dA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=L54uZjaDde6BiNmCWexELxq9kI13gjf04vMjCNDVHYYgJGDgrx8uh1OI0NdJQY7je11/u00mwPibygWRUp7+tD7gWLUzURFBp0iG7k4EJNP2CX42Thojnp00971NIpwUqflb/6c6xUbwDAO9Mm5sMG2/yZRK5FPxRiypKBBCt+c= 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=GtWyyHls; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=J1zJD/bK; 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="GtWyyHls"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="J1zJD/bK" 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 4BIHQc0N029546; Wed, 18 Dec 2024 19:17:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=RHqdy2+NcoKuM3ni/P7CAysszxfZSmvt9EYE/btj2cM=; b= GtWyyHlsCde4Y1sDQBfkjf3B+vGvi3bm6nbCIlOGIRYFwc/B2bMosGBuXT1jZySQ XI2smVseddqrLGwwNYXUhITsknet4EAmdJvIbMp6BvXUhROWa9HZbZD3q0U38tay hpQiaW1dpTOUeQcnb8hITp1v8FDL2+urSf+T5lznkVLf7OamyK+Od0lMDObDqNLq FatyTvOAeva68UhY+Qi8qimlHUqavwtbBmHO1sTWARMyd5QM6OgI8r/UAXXryB+6 CEv9sEZ268NMDSJ883fXenWBqqOf79pfwGdiOXDeLdEekEBZLCttNj4l+tWFB1Lu vCkrh61rP7Si87YPIFOoVg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0t2hcre-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:51 +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 4BIILuG2006563; Wed, 18 Dec 2024 19:17:51 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2171.outbound.protection.outlook.com [104.47.55.171]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fb4ma7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xbGTha2UO6SEfhsKQwma4Uu/ebYJ+ogbWm6AqtPBf4m7AyYtacCPyJpYdfhLgUk1kvwXtSKL3y495K3VStgZFqfxG38maVHmmNpaBH3i33VV8l6n94ZoLH+zxi9yeXVIRZa5ZZ7N2AKT/J3F2yys0Oo4bY+VypeQMeTeruSC6HlCyxRCfiG8baKU3HVF1w2FQql8WePvZmI/22xHPHZnXjU7v++lYPzLKnsIanfo7hBM70Rhbn5YMn9MJcrLkiz7PiSiftd+jKRRMfHsnFfHM4aNECPZVDToukJmCiGdoIGaF8+ix5uR6G8XVRwKA3K/3D87sO9BX/z+Wd97ZOdTTg== 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=RHqdy2+NcoKuM3ni/P7CAysszxfZSmvt9EYE/btj2cM=; b=wuq/ypLzAQZnjMXfWgd/0+6IFWCXEdUrnAFUumWlH5TW9Nqd2S53KoUu1VDGWxbbpJP+Hjj1WtMztpHRuXXeOlfBRHwJ/Qbqm4Ncknr+sQQKcvmNn5v4qfpTQJE2mdcYFcnx1jIj8dG7lmOSSWZtaI4tUzozxF9jSajazDtVO0YqJ0wBoI+vxHvTkaLvS5FQjFXtAeEcsflIthS3OE85/KcjQG13fehFkmhh42ruaEWd1vtkt6nToGkDsikp3qmsmyzsE9I2OPxSTVou6IpVyLwVe/jRE944LVkLEMeA8fZyBPCKevAqYApXY71jc/zlLD+sUUniHBBbbgMRooEVkg== 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=RHqdy2+NcoKuM3ni/P7CAysszxfZSmvt9EYE/btj2cM=; b=J1zJD/bKAUj/JOVu82RBGGRNjYRwypDdozKLx0j6GzdUWo5YeEfA8LYlXCiomMuq05+t91MpaDJeSvjE9QMm928+Bu9A0IK0Ni4hfmYnUI0yw93w+kh1ADC7RdVKJAgRrHSSwmwVCq/eip8B0WUKlclU1to8EF2+z3JhgQgQdvs= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17:48 +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.013; Wed, 18 Dec 2024 19:17:48 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 12/17] xfs: attr forks require attr, not attr2 Date: Wed, 18 Dec 2024 11:17:20 -0800 Message-Id: <20241218191725.63098-13-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR05CA0017.namprd05.prod.outlook.com (2603:10b6:a03:c0::30) 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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: cbf235d6-41a4-464c-8e42-08dd1f98a8e5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: oOltLw33xDPH8rzttr56lRm45CRzRwuUTsHzzLFJSW6M+9V+/gNuj3vL3soqC1N06MPU3tXP3aPEDLo594zfmO21OYLKwy57cf2ShgDdmm2vj6q8dHamcqf9nvTE3JNp6re3ru79DLGd1lXTx96+ftH+17yI3lmr2ErpJajo7VnOTvaJzu4kK9jUpxoGKNHRvdZ1hWY35Ef2lWpf0ra1IA2tsoCa7gEpoD6yWGoGSlqD61GHgc2bOrpSPFvOzmIqqzMS+shovOLcOKtHc30239wqKoVMz4rb/heWEgSEYZU4QYbqQZljNJ2tVKgC8RUhTMI/pOwSooJBv6ySOpn4RX+005kdbRNezUQRLbFm67U+pPud6hMBF2pkoNOmhaqEbwUXDQBY9GNZrHK6RS6e6Bmds3kXUfUBL9VhcNjc50hINcm7W4uZpeK9D6yI/QmfTcoCnSahQhNXOy1vCKYTFrtB2d09+PGyAfZZ2jNi2fGM8D/1i8aIcpUITADPxlRkubAMgFcBGHUAq6cdz+ZlFNPe5UBFQcZtBjNmnRPIdF1RBwjkNjkjOMFRsAuYdv+rcADBmgFKHspHXe96E0STaz0rg7L2Veh2XOK1Si0Tcem/tzGUWklg68HVOM+3ddSK5rXfPIgezgGli4C2LkjHdBJWskVg/uPsy1dGLomQO/JDyEX954lwzSIRrUq+MXlnkXpWY/q1aNFxG9Z9XFRMK8MR6JUHqRBIputoQeOYWyoFsn6tDfVT7yMoamoumSZTRme7FUJE5lNNW1cXRUP0F5mFkTY5iiSEEB46zJ21fsVOr6RN2cCbGASXph/A5SPCFRY1MSYyUmh06gkq0Tccb0CGCSvmcZ/3lI27Y5bh1Uis4iqot1dDesHMsJeyqAfpxwDTuMPupi3YabuGbxWSPFBG7FgJcmQTzRXql0zQnYBvLZVGkGY+n1WkEA6ERw5h9i0wSLjEEwGQtr9t+uBa5FEhOrhBw/x/5ZWeysRx2AqmARd/mobmk/o7XSO0B2SOsdGRd5eKmfg3xUOoMfwBFxS5mQeb0KT2uDpFacgKI/ZK9i9JabjBf3hzGUXLLh8rtz2xZCqrEwNtdK13qIHH5dJYKLKCBlv7N/SU9hj/hW1i545qvA5842w732wBmSJy152fckwbvQm+RpgDFaCUtAw46Qk0zRIi0mqr/T+biBp6+8VNjjK4FP/3/EHIJXroNIDlChZ/qYz1Y3J0+Dho8FiFUpAKPwZKTsObogr959IQkPjc80ap82i8cUC6S9sigcwsQbh2Hyfm6r5UG2m7CehALwB2XNpsIz8Epj85TIQ21lPlmgMuBsVqCwMTckXm9MZ5wFvGIFElbBr+6b/l6etmCgiw8OH5quhxQX4tj/6NhVk3nbJri+zw11DLRIz9 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)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ma93wejw4jIvq3K5BkAR4DZqEicSgXqtflHLWuyn7x70Yfft6Vkt2k2FV12EA0xnS3YCN8msoVLqGB8THLa/5tlYKe1XJCHKJeDmU5Hz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YxKM6f+tMJ9Y9H5ojFV1Tq7wO3ChOYVqBAeKOARCHT0Kf/tSsFcN9rE8PV5b2+lmoVip9Ussg5uWY7YvQsAVDXU3LeJdu6XjUisAIl7AJYxl54XwBdGilwv6pbPjk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbf235d6-41a4-464c-8e42-08dd1f98a8e5 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:48.7092 (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: p4BVJCdJjfOfowpNaWySq86aXM1TzYQ7SIst3pEXeaBVf24279RNGkNk5xp32EPOmFqGndj5UoU95GQTcbUvb4UxthQdZKDJBzEJ4o3DdGo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-ORIG-GUID: 8wQuQXhsNVSYiQy6FbB0JDM-0NfSO167 X-Proofpoint-GUID: 8wQuQXhsNVSYiQy6FbB0JDM-0NfSO167 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 Acked-by: Darrick J. Wong --- 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 19:17:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914076 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 0F1221FBEAD; Wed, 18 Dec 2024 19:17:54 +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=1734549476; cv=fail; b=IWnRLghuvZmXDJneU816Dr+foW/6gp55yycWg/JPm543EzWoAAKVAAgvZ6B4BVvuNj7o3G3HrOHEderaoyUfeZ1KiuzhpeqUZ9qhBbMKpU3yPogWMpIpfx7OWPijmRj6s95Eo7bby++XNrAnOk7jz7JIlVpOkE/EblKj3g40hGY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549476; c=relaxed/simple; bh=mK5cvSej69KOTCBcWeRUethCUN47dGe1ow4fGJKawrI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=gIli0oDXglYeRITFxFsOJjDnFiABofMlIca/EtEVJIozxDnScnafbriAl/mDU5F4cW4MHTMQIRGGTg9bGDYTsA1Iyt3uL6Cm7ILsW51H6p1mhKIQ1AfwDDiiHkau+4jVerIY0ZZP12JsSO3mt8+7Dg0o72IfcLixfwuAzlNNWgA= 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=PuP3ZCCx; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=vUxy6X8L; 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="PuP3ZCCx"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="vUxy6X8L" 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 4BIHQea0005643; Wed, 18 Dec 2024 19:17:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=OtafdaNCMfmpWvH4shF/VFEGUHw8+wrh0Mcd14NRETM=; b= PuP3ZCCx88BCxImMMF9GT+fwMFZqzDGQuTP+9UbvtIBONjmzOUK2dL4ymxOFOozp /ZQP4qZZxs4C+vdSQWptAHNbwdktofvv3GWbsgOCmZU8uDjztHRI0gCWjOyPZPPF KWqcJmuYkDZmebeQxZyLnPn+ftryxaK9IHqltaQqzl68UpZkKqapJxZlY6zkL++h 0fmgEDRAOxI2DBXNqcXI49BiFWLVcrD8bN4aBor/XAw/bSs5PnKzUwwM8klSPjqU uYNG6+T70VqftSeJkDuGmS7cEJkLgWgdA2g4OMGcg0aOgEC+SvjeAO6kqJUqrbPr 6/tHTnx/YYyO3gZKsAm1+w== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0ec9bv3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:53 +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 4BIHdC7w006388; Wed, 18 Dec 2024 19:17:52 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2169.outbound.protection.outlook.com [104.47.55.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fb4mb8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sB7V6mfCl+cn/gS13c1DDM3lYYRsSTGtHa/gCLUeXJbXTxIrlE+XUmkj7xTlDUCKWC9Rvq5+Ne8r7iCtLbY1o1StD2h9f1/djjWbMfCAsQCCpP6WupZllyUk7ClbfmtfD6h3RHBSyrEi50Wn2XsKPCcDLhmgwKo7So1MAOEatdz5Dqd/QYhO1d+48GXR0mfqyF0mAHgaTU9JkSXpzzNNTPAlU8aveFxJYjBZ4vzZ8Xx7gm2AwPRfWLoQYSRSsrn6iDDH72LBQv2pTeicRe8nQSYvAoCzV8DdLNfx+MYrVINShU9iWyZE0PWy2cBQ9oRSIPUyijeEa+1c2RKvLHjwWA== 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=OtafdaNCMfmpWvH4shF/VFEGUHw8+wrh0Mcd14NRETM=; b=OqnWU6RWpgL4zT7Eg3V7+3ecWUvYtf2zOsmrH704VehAlbSgiruhkv+MsyfODPXJhMBI82SZ/KnsF9HiQScH739R6vaFYLTPZQ97g+ReRfSFy2OV36/jp5Y92QJ80nvcNeL3BVgvy6Y1A9Ido1tJWbHhYahwM91jgOvX+TRnNLA2mv4Qti8o9Syko4+MlvJEDyV4Ra21nprnHSieSwBTXe/XWIMTGCEawvhfmf0K46obx7zw64KrHEHpeQsnb29T5tpdVU0Ey95vvhKJWnBVkl1WNXL80Y0DqGtf1ooDoMSTkWZAhb+y2lsgfF+qReDGvQL1jNIMwlsGlg9RVn9YIQ== 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=OtafdaNCMfmpWvH4shF/VFEGUHw8+wrh0Mcd14NRETM=; b=vUxy6X8L9PjpGVn1LtFB89lHdMnisvgBsINYMt1LcWQUpco35ZCt6eNV8+xYdWB0gaR1I7jyUs6MjtIS+YAJXK7OhAmGyaGPcLTrlc+skZOhQuVE51VS/5L1Wwt5uLkBXMyFaBtyPX/pByK7UaefJ9qSys5gUA9Pvarp6RI0KA8= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17:50 +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.013; Wed, 18 Dec 2024 19:17:50 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 13/17] xfs: conditionally allow FS_XFLAG_REALTIME changes if S_DAX is set Date: Wed, 18 Dec 2024 11:17:21 -0800 Message-Id: <20241218191725.63098-14-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR05CA0020.namprd05.prod.outlook.com (2603:10b6:a03:c0::33) 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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: 5e15db9b-4147-4ba7-5653-08dd1f98a9eb X-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zh39Hhqyqr0ygctXYQDn3P57SFY2VhelC26ibdS14vgZ95fXdwTFcuZ/GDth1gXVWlMGJdkLMKJHsn6REKkkzQhsgwdleML+/cmYSAzbCWyE8RcnNo/Dp+Lvy6Sc2MX86z0CJKGTvVEm7sFfrP2bgCpYbbq6esT71aVpOKX+zZ1pyzM+iu5J1jS1keW2n/MBXWSn/hj3cROS2eci5APaJpA8rTHDnyOswKLZBZPvpDbCEDvbGz+ER3z0MmfiXsVOXxVmQe6MBMd+70ioKrz4X2yWkVu8cbzoMu5Srowx5CjwMaj3S6o85Xxx7zASoDrHTec+Ve6G/919zVCADHg1eKzQWMwmrijjUgo0kEkpEy8VUaJryawDq0m0cVlqZnfiFtYUFh1QQFGTwNWIn80s8yyDa1LyyNx6n64dJlcSzaKsfLdXGHAfCSnHiO1mHdFh9HHd5FQyVqLY 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)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /aw2UsB7nnBrtTYRkRTyaOZ5v13ZT/2BEdBERFXtmBrNEP03vL0odYEijiK49S5POcePhDaOfQylFUQUepHu0th2A30Md4PDsgNKgc3Vd0lU9GLBv6L0XUIv47LZUC5U1ZvmaJRmRRaOIyXpYxJSO9JQutXG1xQgJqeQ0zUA4D4ecJkSEEZAElV5Ein8kADT3PDhahm+8ymNOA31OaPL8qpTPodGFgZvnEcsnAtGpAZOCFbhTcr+h4jFQYuJWDpQJxfsu8DAdPYauTYnu6NgiPoPmdtxdUfhNX2i1LNGXcAyyDifdXpXmNT7skTNlVl5Cn53+zoCCafPjcFJayC65IPc+VKra/T6sOXa40hY8O/vmVJo7zSr7m3LDP7GcSwdW+A/O1It4ycW04CQnjo2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OyVhGzYQnKdkQzy67NycbWSsFUgdwAF6D+hemEL2Q9Z4Y6jCoJvSSFEQrK570UziND6Um0t5L5e3KiH8X1Lfmvey7ZWJT1AeblWfyoA3Ibt+fgajAHdmXPQrQlioZcT7cMbY/jBCddOqOpSF0ndhFpmOM9Wx1728jfgQweoTpnjOICG+dugNYS12bSRYiFzOuetf+uRf5CfD2fQKEObeiSQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: W1v6v6NM1fTBz4KIJTnwoWVGnYspUg7eorNYztv2EsDzmVpZIl53bbIGSIeEzDi5NNV7nCJVBtiA4BlkYaBPbyHMHILFaSreL6oVisqpN+sVpmhMe6IlqRVOhiYcr7oAeqKOA/rmOo81eWcHHvKGtfQWaSE48kTTy3mz4agVTcQxYi9Y9lux+cD83nX6wonrx/uuT0N4mIJPW6t15OGPP4UeoVVSpSYssFKLGoQKGtAl4m3YbYSFxMTXdnfxgvfXq3Y212TJbLoikYc0EhfgqV19k7dvesov4X2aNo50XP2fGK4b+z09phEnx4jlYD6Im9wtWZPFk+beobHRexg4S3++5u82g3+PNrSSOqRht9eDnluyF4z4tPGba7vk+oSZbD53KZVJQ5dKcgr2/EAdGb/qpNYFLxFGMwvz4Nwq9htf6rFw01CfZSjJjZ7pVVcGhm9ntKWBVgt9b0+YG1nNmQjKgr/9G8WM3oJikb3OMBPnfOlIquYbzlGIq/Z+FInUkWxZ05O9yjKin2vicwY8b4McCGnvi/6qEWIg6KkBM6yZTQS+t+/yJf+JIVsubWJF71dvr0/XXgPCITy/sWZZ8FShltFs4jW/wi4Qax6QTm0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e15db9b-4147-4ba7-5653-08dd1f98a9eb X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:50.3731 (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: CWnLpyCKGHpsRM4OI1LvfwiL9Nssc8tYaRdJwtPG6ZPqImScX7YnQgkb5cQj/+Iv7Kl6Gtq/Eo4WVileAdv3k9sjvrn+YU9ld60fwTO7YPk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-GUID: 5EsUpoV-vw8uxVgUZ-iqJ2L7OHIyxEnI X-Proofpoint-ORIG-GUID: 5EsUpoV-vw8uxVgUZ-iqJ2L7OHIyxEnI 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 Acked-by: Darrick J. Wong --- 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 19:17:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914077 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 31CC4176ABA; Wed, 18 Dec 2024 19:17:55 +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=1734549478; cv=fail; b=iDwui/oJBIbnixeUvMJMiBiBbpJxbcgB60+GGv3upOPHnFsIYpX+HWULD3tK4p7Edh0YVtqBGBhU4FQbSja///1k1XPiIFKjtioBCFzYN9taxZFqRg10orCOPkbuQiKFtwmal5pt6Xpt4OITBHwsRmfoXI+fSGzvYOfM3rkoaVM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549478; c=relaxed/simple; bh=2T4Ei7Wgs0/7OT+59xDta2Zxl8Z3BzZQWEQNaAQGToM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=C305I6a77F82aFqXR43wEYr7Sz1HKXxODJGHiZXJ+BlDuxzC6RFLaU60pykg6UDpGB9tZWNwdi5IAvYLXl450aarc8zpkZNKNbEOzZIQ6260yAYrgRze2yKyQTFNYPE27ybGdQ9SvcCaE4VOGv3LzMery9IKq8wecLXWII6ff7U= 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=dv9du5mf; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=nmA2y49Z; 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="dv9du5mf"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="nmA2y49Z" 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 4BIHQleG004411; Wed, 18 Dec 2024 19:17:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=1fxEN4VpKLKXrvHf6wG6daBykFCmmCHiUPRw6FDbAFA=; b= dv9du5mfkBDqeJbKXnLu/9zk8XtRPUUJcBINOvP4zS7cnTQu0hYo0UdxwG07jxRV zV1IyrBgd6ve1xbHY5Ka1zTeC93zzKHJLj00bbHum5VPp+8r2ctFfPMB13NnY5ju YAmOjbRjSXuLSFeJyzrg/RXTu3LW01jeD0j95LMTSxkmh3s6CuOaYKzkuL2Mv+a6 aPck0rMo5v/8NA4Vh9cr84XlMTlS8eKamWbifQ/NKD8nsRTWmGHPhGbPpXQMo6jN FomzBG27tZwDLgReol7mqMFYySRt2xyKa1I2xy8npCYJtGrVwa2CZ2pfxpedPv7B 4Q/Atk8r6sTEuz1UTrdLmg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h1w9hax1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:55 +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 4BIHTSZB035463; Wed, 18 Dec 2024 19:17:53 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fa8gj2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:17:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Gxz5hmLgDw8M/Pe2DpjM62kumdJh7MIRLu7Ii33L0yubmAGUxzE7GyP/sRcYbOqHLOwn1f2y5D1rwT5GTceIXIrBrPgvfwAavp0iRfpGxAjpNOI+xTj4uFfO5jzPC/MHIG5mIMHC37PeSofvBRXS6YYOiXCq2EU/Y4QthOgU4CcGN7Chm7Jmnj99Q8WOvcJWS4vkwPlev3CJvMUTGHXZySnZ22BYDAREA/N+x1mtdl/W2d5w4PMbCnsvEZPp94ZwstQmcs7DbegMbBh6/r97Ej5hzMF5jmV//pB/UjlNcwvBNsVzxYDM4OuUUpZfOob3ghtfAjQgK342Umx9sieiHw== 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=1fxEN4VpKLKXrvHf6wG6daBykFCmmCHiUPRw6FDbAFA=; b=Ogvky92gXeJlArLrgORKznkayunjlo3X/9x9li3ctyA7hw4ljE6xmeWnyWmYds8dfec8395sEDp5Do/n65kt9YyrZPoNwkeCEHxD830Y1v5x4JEufBgYGVojMOT028GTPQ1S6a2qgb8yjcSUwhiHIdNe4OUhShHTeYH2Dw+Nn0iKGL2MAD9+H2KljifXNtf4KVSkZvuvxkM4HIjG6ZvEb/2oYEe717wPwe90RS5A2nTLhxqp3on9GZWlYqigizFa5rz0topTzQk1+4GX+OwWX5sOfBU3gvObbhPxL72X2RSrGOWFIRA7VVxL7ugmDQ+XgkfWDQbGcW1pFdz9Guvqpg== 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=1fxEN4VpKLKXrvHf6wG6daBykFCmmCHiUPRw6FDbAFA=; b=nmA2y49ZyKKyUJsIxKBftZRqhxrY3pCwHkN0jG/lPT9qhOqevcSTkBg/vS7p+DFo0/w2jyLE+g5ALQddBU3rc2uG/MVsq6Syc8kLEzeIuGRtE1rNoi7kvaGOdpHp/Ux3Eqyppaoh+TPAQjQQ80mQsITDA+4yr2N/5ePrYW4Mmzk= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17:52 +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.013; Wed, 18 Dec 2024 19:17:52 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 14/17] xfs: Fix the owner setting issue for rmap query in xfs fsmap Date: Wed, 18 Dec 2024 11:17:22 -0800 Message-Id: <20241218191725.63098-15-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR05CA0021.namprd05.prod.outlook.com (2603:10b6:a03:c0::34) 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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: 53246d5b-bfa4-4a03-95e5-08dd1f98aafb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: DZc3Zn3+bjqg1gLiqnIA45WAI08Xp6RSgK74DjdWo2Z5kx/3BZMQN6fe6A+ccVpmFCjf+5xEnzWYkywIiycdhqeesbvNqi+O1IENX5i0j2077Gt5xnvpEsVAmC9fRMD4LEtuiOvcnjlCZXd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jKyAv1IfzysnrRoDpFrZ8HtICoa9qDkCuxxOMkZbNACJ0j66+ZcR2+0Y5mqJQorc+wNn0IFCpo6p0hJiRNa5IAZVZDU9QB/3BQzK3ksm4/VExK3hS/h3hKa66xJRrNJ/G7HCNLHPDd7fFk3Tib3vBEOs6+mwYqk8j 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)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1DQX4piT4rjcjI42OJ1/GJXzRhD+pUrH2Bdle09PDi/KCUk5mWPkNs61xq7+7IKbNisja+qNq2JUuOkuCT1/morNjFI2lvBVS3HvxzPwP2pvQubzLiE98SWJedFRSdcKGHy8gHUjzLffctu4GxNTP6A/EGfieV2pIeEGnCVwVZzx4WDKPsTJt+qQGGUodoFoQgHq5eQW1DeB9xbSOgoTsQVGlp8Xpxmmf05IdjMUCBEcO4ZvZngyxerc4Lh4HdLXyUIIhL1VLDXCQoJVtsx79bUFPT0Z4FRDESLsax7wctIkmlgkzf2KF47UObnhFVO9QumO1c3LYacX9t4HXpKpvaLAxI7tQTeehmNAUxfK3zK7nvuK1sg8UNuEBGCUHyhdSY0c0bRBuj8ygVG5oJ/fNlsmnEb0Qm1+F1jOjQ5FEpzSaTH5c8lKWXEOdyMjS1xfec8+d7oGa0Yffj89xdjHf/OD31VvlLRrMX585bVC/Cum04/RZKj7jlZUIGrtDZ5KHyW4I9xP/q8VsJRA4WgKBxFQbE+pglBYsJPRhBTaz1pFIQKeB7b/s27opZPYRhfLwJW9n0RBixfqLaZ/+BgqwT/pqQX28rs9Ma9aIwraxYg+qmyQFLm7t1fqNMPWLCE1Lia2XILDDAnDpDPzKGRjtX1ygG3lw3ri7zRhUWSLdf6cuS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alHop-MessageData-0: n+Qiii/MouKVYjnUc8+zUnp0diJxS9hGR9XuGEfuUZ52n6zVE/ThjOvvI4x0NA28isvwo7qEOK6HY7wV47zgfJRrdgLipn2JNFtg/4hMSEyZG0fJYXvyrfRBc+Fmpp9sVt1dcUtCSuR+SsJiJWCFFSBFwTCAQEPbzFd24G2ueii636C/CXw3+7ywwdNE7naXam75TB+ux4gQqVC58d2PbhLpTTHad3pe9Bzp7Tu2gKf+nlRkBVKienSTOQjbYW9MKGYlbBAlKL/0N62a9icF983GGHSuI7rCy0Nc6S0Sunrg3XXL+iJiEO5KAUT7+Pqi6RHBl95Kge94Mq+KNnK6ByhVsJvtGcKw7js6JobeAjgTezql2SjF3M6wNqE3nJoigPPx/lM/GmRHJBGwvZEOj03rBvYReSrs59X6+h27x5+oDbeN/kfT/PTiOcWVkvpoLoRAd6N84LMLxbD/AmzN/2rQq+ae4zu3EUKE6lx3fVVCUY3cSvQlkd7ep7XyhVOVX2uRtPKq3iswZIoiKOmZnvVKeU3RwS8a+x+efZTavC+T8frdqtfhxc76TRFulUeIIiXR/zmVjfuZBNYozXd58FTdeHbwLDkHO0bjxOwDS8I= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53246d5b-bfa4-4a03-95e5-08dd1f98aafb X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:52.2135 (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: GH5BDAOMY4xkWIYhXqmbbUHEoqrKXwmMz7lY/AUP+TGOTXB9CeIPZa4KSsImw5/O6CyigdJUEQ/RVOMcLVSeHBy9NhccCyXYJ4TaLKz6Cl8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-GUID: pHWJXNbYLqXrtivjdRKXTQdSe-gYJUGV X-Proofpoint-ORIG-GUID: pHWJXNbYLqXrtivjdRKXTQdSe-gYJUGV 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 Acked-by: Darrick J. Wong --- 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 19:17:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914078 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 C912D15749C; Wed, 18 Dec 2024 19:18:02 +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=1734549484; cv=fail; b=AS7JniNCBC0+5CKFEqwsu1twoxnBs2s5nEIM1IppgeuuXAsv90gldmITdy7nlTL1L2qbxa5Lr0x+CRI1Uee81p3Eyfke8cI3ku5gsWHdqaQejvDF14OTmYJn91yvXgTXXB6LydElZCVMw/9hrmnPIvw74yQk9QXaX7sUCQxhPFM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549484; c=relaxed/simple; bh=TXd4bl8cugnlVSyzTtz0HvhSDT2SkrXNW1t/Njl8vLw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=c1k0IcgmiYDDh590XM6+hJpOChrIPBFr/3DbPDEvJv1I//GDGOwSgC/vCoOwPL6BgIb5e1U4maFVNlDSyljovpkQCQs+ALJFUfPN0+QOrEtA1c4LDHcYhJ4gQi8EqVG0P3lsY9GWrPpmA0qb1XgFWOGimHi+s4jIayK7cj8Klo0= 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=O7zi5Aq4; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=pIobLkDQ; 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="O7zi5Aq4"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="pIobLkDQ" 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 4BIHQlkl012926; Wed, 18 Dec 2024 19:18:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=M5hqBXp1VP9dRMkW/mIo7rnXW5ncHroe+FsN84CMAfQ=; b= O7zi5Aq46NXbqLB7Q7DAjW8DNsL1wMPBDmoSGgHJLp3j6gFni0aIYy+9q/Ss9KM7 J6grqSAf2RpS/HydaYQzcdPkSTSYcyHLnqDlq0E5eKnbrE+DmJR2we6lOlsJmY0D T0alV30wutW/jR0rDUUzhdWiXVlIBncI6ej7yxxdPucRPksGJ/gCtsKr2XX/ebUX SBVjnXJcQSzPdbeJWUVQgpSlrkY2PkKRLkZbElVuXFE0+IwNeTK/E1OqKhV3en66 eJYcd59DDiyUeVTNw8voj/me7tYrY09/Bj+FArL0XH+Po08uXyNijGZdMdjgFoRl 8WVckOQxAhpAxgX6ZqkI0A== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0xb1fjt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:18:01 +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 4BIHUWou000589; Wed, 18 Dec 2024 19:18:01 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fad5nt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:18:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cvFKOPUXyavFrzf3QbAP2TuHvMvQWPIGBT4gl4AznOudm1wU9O0kuaLxgW6f05tG1iZ8wWLfuEKJNgZdJHs0ium8ADJya/7/mJCEO9/rs0kOpqXIZgt1OVWIUouxMR13oLIKC0XIHv1d3epcozfpqbAFVQwBS5bW4ipr3YScEUKZRZJVh1308gW1DApJYOFqFtPrVGNNXjYmaXITSfRKbfxEy/XZFKTMgg+YvpTGcN/3YXE88+1v6fbMQ/H8kqIzraEwgwTGUzTDERwW2dfivVjjy1BQmA5rj67hEgmfPkAtkCWTnXDxSVzoQQOhEFLBo5Sox2mMNQppcjci4dB6dQ== 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=M5hqBXp1VP9dRMkW/mIo7rnXW5ncHroe+FsN84CMAfQ=; b=tQxK0/hxEE+tIu6OMqcvbSL1ITrmIls2bit9KENVp99BJuuT3Bb1g3aJMo/DNPdBE1hktCPXcJSBIdf+VESxlROh7u76ySWJ/n8Hm4N+kv8eot3F78vMpgNu/I079sBti4//VkmYbUV7qSdiREM+LiR13+aF/1douMTfzUvIagTH7kmYFUFd7LFGY+/r5htaA4iLe9UM2Hcb6yOqcapnwRPE+AMvq6+AWAov8JO93Xl6uhBLLwG98yhoEnUjpHj+7dZyKPNtjyvEmdGaahVvceUyGPO39Ok4eglF5Lc1YA4WutNfykeuZAPi2cxXt6fq3J7WGB59qWqKpWPj8WLJuQ== 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=M5hqBXp1VP9dRMkW/mIo7rnXW5ncHroe+FsN84CMAfQ=; b=pIobLkDQ9MtSf7FIkZA4HjrbZOMJ0Yw5/NVNcQln++EGEaMFFucLaF49bovRjPuT/I/JkCaTF6elf6slBgGqR57lcuzLPqbs7MsBAPC6xli6r6yaghSRV5yHvuWvMVwgM7A5DyjI8bXAaumkHRgW3N/9nK7H6j+GrSfA29MBhjk= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17:54 +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.013; Wed, 18 Dec 2024 19:17:54 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 15/17] xfs: use XFS_BUF_DADDR_NULL for daddrs in getfsmap code Date: Wed, 18 Dec 2024 11:17:23 -0800 Message-Id: <20241218191725.63098-16-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR05CA0016.namprd05.prod.outlook.com (2603:10b6:a03:c0::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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: d3cd8b23-ad0d-4d84-608c-08dd1f98ac05 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: TRabxMsofoM3ufigxFFKwFhVqiwCUzfaGkvMOEnYRz4qyx+bQ3TKkRcXaKYSQkRJ03EFDElrYOOF028gdfqVy6KSzAk2nCevUz/W3+x3Toz1Qbh2+Cbb0Ch4zGzOUgD7gpTCy9r3JR+xmM4rGvy7cAEep1bOwdbwtXBJQFe3XvetOLnrnTuKoolTdpF9OsaCaBBNbR/9Wq13/EM3NS0Q9YUJ1CBxiDR+QFJMFHIcuWj3eVPnbuAe4c0vc9dKNkt7gZPiTb4O66czO5tcagKL2e3O5oBJKO/ZpHHsyboRdVnZwozY+mTMhglYOQZaBmLAT1NYr76jLG+nP0I+ZGe/7V5JL4/rKVnY8cY8/v1VzVhPPJsoUsX8rqXf+cDMS8PVTjhi5U/dsFpDktG9b3hRlyAIpBURGqtpVi4xif/y4TjLc2jz8TXq5bH83uoeHH/6+mG+iPoW3l26PSo6LSR4Vwo3hUHKKsT8ur2Ij5X9tC5ik5DURe/tGigeDxczCh7dkTNy+uTqIPLmblbg0lfhajrtzMjbkQMhQiGLl3B64eeWXOfVTvCE+ipanEV1d+c4b9XV/YWRlcrS5Kmdt9fnd7Q5PO6ld5Wphc1It98ILKE5tWcQBQNtS8J0pYWs8VVXqIcQhfjsGjvYnCyprNexdMTP7dzbvmfQ+SVJz62/wnmzVwhhMyqGFvVu2p62hCVSuxXmVX1k2EhbBtB3tuEFLW07r88Gj70QQFXQ4f0ciKX2VYqueRZy5Tn6WQV6A/dd7MOAkO7Br+adx5vy5bghiQJhouBJonc541abLFgh27tkDbkTaztQpLkzhpCV6O/3fjFlCwBmtrUuXl1wTPQ6zDOWKpZkk6Lho7ir3rY0qGP2TRp3dOIb1vjqWqmrmxSjdk2eAF0DiezpP83QnkOOG1lvQYoQMAq0TaJzAR5dIQMQnw4z2rXOIiDiBA4sihLUKrW6VWVdyQQafgNCZetIUbJFFNHTcPwsVLh2uzTO8qr+2yKqayLjoRU4NGSeTRfeX89oglqOilKkX9Hmn78oSbLoLVEQx0DogaUZEo7lVc4AhEJmu2OqatRQ9nd+JiOBPajQIxCyV/XiQQai1xKaGZ7PVGSyLA2cRl4ln16380yfkO39ex3DvaxbJ1lhgL6I8xlC/plxmdBIiEpuNeB9aBtULG3Wd91bMuRH/MZ1ULkHil/JLUrgCaYiQK5dx0fcPDHW8VAH0QYqEwCm6IAlnj3cAUCUeheItNm9DSRWeh+qBRiDjuajbSbXIDn6cAYjAEskSai5fxQwCG9BKBYJ0qR7rgyTmhxM8b0QZlhX9AJjoshAMM4u1tqeEB9l24wyYq6PU57fr+ZKJBeHsIP9bAeT/710X4rbaDlhVi7032RbBBW2rwVAol+5+58UNxFD 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)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cFrb7bTkpq8EbUtsibkiHDhIWxhOTnFC3FoOctJ3p7YDLuar3L0NNeXhgvve1FDKyGm0pyvADtCi8rRQn3bdwpM8y624GTnoQYT5qVSXT9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YKIbb8pgoaWlBFOYZ0ZK5lRmCcMOEKmAqhpm51JugBX19rAgVcrGBku6EHgBriG5N3Zn7YVTCfi2w9Oj7OdDdQtSUL6jJRL4cz6OZRsTCl+yWMeHJhlnFIXbo4goqtIhLaMNaEyxY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3cd8b23-ad0d-4d84-608c-08dd1f98ac05 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:53.9844 (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: x2ImPU2sDZbNLThusyqr6U0vBqBzyFMUisGOnS/y8UAjID2n9AwLjrf2XGnsFpNH33a0eL6VfGthib549/MXD4A8jphO154RNyAZJd9GhDY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-GUID: 1BGLA1VdAdgQXJyF3DWt_UhmWnX00JvR X-Proofpoint-ORIG-GUID: 1BGLA1VdAdgQXJyF3DWt_UhmWnX00JvR 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 Acked-by: Darrick J. Wong --- 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 19:17:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914079 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 695B8176ABA; Wed, 18 Dec 2024 19:18:03 +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=1734549485; cv=fail; b=kVQ50Pw41GRM8wrDMF+ez95GIsfj1Apez+Utuc9vkPyu+vg6AhWcPpH/DY0JlB+vewcmczdLgWwKOyehoklK4aRG1B2xr+WBp4MpBDLXhaApc/KJ/wWZRKIq9aQ7aFIRfFMCLSeiA+6NqJwpmxndSEeKayQuEr4q4JV9CUowg5E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549485; c=relaxed/simple; bh=2thgi1/9WqaVZA+zrrfzOA9mDvE/FlXDAUfJ/1ctKuI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=N4TIQs4C21AUQtwbtS3l9ytivqlREBpLN34yD6xd0CI7OyVd1xKavgK3sNAy4LC9vooqll7hToCsWIrD9ZiHfcwfmgvAaIObbAC7X1jV6E6yQNNlTFXORlg4imxCtq17fNdgmQLaJeLv2alEf6CQjyQUlCe6MKggEQK3e0hIlS0= 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=J1/mmJKo; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=WkpHxmew; 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="J1/mmJKo"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="WkpHxmew" 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 4BIHQlCI012919; Wed, 18 Dec 2024 19:18:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=7Id6XwxjqnOS6MwpTtVGAN8V23g4tkkNTtrZVGRjsng=; b= J1/mmJKorm4UTlUDy6L3O90QYSHnfJYa35u7/231age53obVb3o1TdSQZFuObbBx 8VjGPMXjuhZiPY/buwCLOrBsyTvCveqA5hF55ApaSTxCscO5nOEV3eZcHE1Zdzav U5PTm8hzoaCurCZfKPPrNiMgvlYkR687lkc8Pu/GGAUoU/PotmpZ5aEBWr6ZPFSe 23k1y3QYD3pDhmwOu7QEWN1h8hVjBJnYKE6Frzdu43bZuUVnSZGjB6n9xSUOG5WF 9ulS8ia0imJgXrvcVgIBZqAy2/Koiet35iMoonnMEuBy3pjD+odphXjsnL7VhHVL K1cHZnAb2GyKKOO26Xa/1A== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0xb1fju-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:18:02 +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 4BIHUWov000589; Wed, 18 Dec 2024 19:18:01 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fad5nt-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:18:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oYRIRB65cwB6jLIRImVJUoZ3uq3hMdmdaDEGVvSpFFYkqvGJpv7OkIjX8PDDGaUzQLLMOrRiY7lIWrGqaQMC0gG5FehngNb/AuJtEYvn0LETTq5xYnnF8PAe3zBNvySOH7enEt+EP1We6BOb/C9eyz9QVJwuairzoCQ6uuU9cwt+LSQkux4mR/izCTew59/m5VGFHgIhf6F8U86uCfibXyJUHQLprncQLWcjxKYkP9DTNlBDLn6mKB0D7++vND0tjfabURmHs9Lkxj3uprxuH3gEwB9La4MmAEfJKtE9PDc3FADFAJ1k4dqAZv6VToBS1jqpMAOPsdCN2fI6uee24Q== 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=7Id6XwxjqnOS6MwpTtVGAN8V23g4tkkNTtrZVGRjsng=; b=Gp5h4157SFil0FyN/XWoYMQoxSy3RVNmJ+hUiaF6mGIgJsMcHn57NxTGV5LT56a/AGXZZSTN06dRCmrM9D5BhDgK8Q/q9xgnXC1gl+b9euEom5AOwg85L6vh7fd47uC5gKtdANK/nLSlY9wPq7jLzEMB0OAOto1AdBwJmxGNSg+agqOX1sBT32oRzyU2N6e2jE2W1vIq7Sv6nQVII1UYz6iLYiNvwgNUObjp98eKSKLofi4ndqcx6CHFSpib9IH43DUWa+orC6jH2nDwv7rVjQCh8G6Iw0fmqEVcgdGQTyrATYhqQZTp8tO4zLIG8xslrMd2SrlQBIBKiwYxMuToUQ== 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=7Id6XwxjqnOS6MwpTtVGAN8V23g4tkkNTtrZVGRjsng=; b=WkpHxmewGyXR6JeHYmFLgojgwkanUVQm7faMKDcyxH2sz8/x0rQI8EjTQIXd/dHo72nFQCiIQka6mfPUb9ViPOREzoxVSlwPJwVIxfZytzg9WaA8gxnsUmms/thgOzlXYaRlacGDhf2CB1WwIjCsawkYIBvT3XIuR7h+BdMz5cg= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17:55 +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.013; Wed, 18 Dec 2024 19:17:55 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 16/17] xfs: take m_growlock when running growfsrt Date: Wed, 18 Dec 2024 11:17:24 -0800 Message-Id: <20241218191725.63098-17-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR05CA0010.namprd05.prod.outlook.com (2603:10b6:a03:c0::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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: 48a56300-b217-4ae0-0cd7-08dd1f98ad22 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: 3Qb7CWfgA3V5QZq9mvhZOjD2OYgRsYyPPreX+kz0ipPW4F+D86cxEkFmcCKSE59432KekC6Ivr1ptnPhkT7tKl8gzsHow8deSfsJGLklFSXDzKaKwSJ6SmNiICyEQaXOPO/+4Srugg9B2vKqwWcei4vY0QcF9687uvN5BbVZXP7Xp65imph66KvjePzVgeDrazz4IYSJheisl+XrTZ1rEpQjPNsKo8Fj8/duJcHZm0h4TTnvFp74j8ozmK7NgX4z454URFyaFLAWeeO2d3+LTFcrVa8A4bsQafe9CctZc2CZcQsu+HWp5NBZbVofDOxqo8KmHIVITu5pbzgKneDLfEk+3UPM3TkiaLphKBzeNywRhVc1wf+riH1Q/KdNEK1Cr9lZe5Gij3nMGPrzg88c/oaC9KWKcS7wIx5Wxpzdd9aJY3aW0g4BW+2CLfK6lbRLCWQuimgVjYQ+NUWqI/RPjSop76xrDcazkbSz1+J7A8xWXptizv7FpunbvoTa86A50tqjuYZuBBpJTSw2Qy8uJRHJmRDsqhPx4NUDz1yS1gmjP64vzG6IcKoa5THwbVBsKtuIQUSfDyGzYzH8ej4b7WHgiK8JeLKLzXBJA15Es6X7XufvB7KVbthsMVgIBjs213B/iScyy8lTWtZKRxN8HXs2oz5SpFwz5ANmJQltUjHhGmCZW0RVW25TBUHQ3L8zENeqCz9TzZiSN5GRX7VemxJ6UhXCQWA7myb7+W7R11aRYvhjaZc8KJJJWwRW5q77JoexPLuQjhXWI3o08EoV/zjSRL8OYQz8jFrhRtTDsudEhd1R10+T7qWjvGGOP4Z6GQwYWkrytXL6oVRNHnbhLOsbDc5mxSQeIM3WlLjFjLitx87nh/22Ay8ajGv0x5X6AUGuNWj8thcYsvQp5oG99b6zOXCfCTICfA/lhJAtmJOJiBUny5TJWAXvY3wKy1Y7uSzc0v+WWi/5Wv5UbdYTY+8enWvSsuIc2cBYOnNeubHYT1J6EVD69u6E5C5kV57cqsFFuDFsfc3wDBtQCdfjO43KwjXGEZvAdauUgPnLhtQ3w4ACyIb0P841V95YAosv79+WhcfaJikrFaUzxOFNR5ZGBhISbQ8yLQfRIp5sDXv3BujV097VSt8KIXZy7Bqz6XT2nlNrgjD+W2tjzsUsx5Ks6i6EubMa4UaG/NTJ3Y1AzMsdY6Ffc/UK5OEC4i+dCzaDtv6/JLMr9/ZrZKMRY6/r9mEoT/kGcXeNtzwg2DdXufdTOew/n+VJBTgdmF82UGWPhd6KyRL88jpPdh7iOYZLCCJ0Ys5k63o6pbzQbsMpMchAJsVH/dXlcVCXuR50TUYvo4HXkWjuPHwR6SPrJkuYZaG+w188LIwrU1Tnle1tJVqLpwFvLf1LBBclujIC 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)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0vulPxYgOWq9r7yCakzb2iOuZLPpaIXVxvPBHcoH04PkbnlJefraljzNz2JwMciG21hqt7CJcwuua/y2crWfuT+hK9N8+HjCOZzNbl/s0eYreAGhV3kROswGlzZYgsHHK6Ex0j3iA2yeykOLgf0xXjoyGHFuNAN0drlvC8lYbPH8jMRPpfMeQcMU+68MQ5p8m8mW2TvQemLSpRLd7pMxDpMYJkqxC5JQ4JvStjTyZ994DmgYHK94hulsNprzC/ShA/eK3TfSTuvKssCsTb2LdL8BpI1Aw+VkslCpYHMG7g26VQ7HGCxW2/ubuauLHAEhPr5OjATsezWLTMeH4Du8lohWH3jm84YV8LdhoZZEK9JL6sc176mnUEK2lYt5z/9bD+01TPqbwxCZ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wvOOWVrKh9phs1V6Lt7mtoqo0LaNRkTaqo5RUwBpYLczHLz1qzKx/5N3zOJV8ABkUYeoTwrZYQuc+MILnpVBGVOHQ5i8PwV42PEqDa+Wtv1kV+cnQiIIQHMO3PTmRCg2zT92n2SgEPP0FNzTgXnQkgh2UFdcx86/xE6oPtt0fwav4skJzG8Hu24gdGtt3hLYVZ8V0E6+FYnrEiQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: MjSiOh5HIKbKss7CaVPCzdjnJ3ji2ax/WLbEA1SiJkxMkwt0WwNICLZoj0Lg8othan9q7IU5kotWr2IC6yS4Q2NvTSNVP06wen/7RGkZ3vvVN9YXgkDpw8X7Rk0Gt0Yg2J149BaXuZjh0jIAwOjFeHoivDc2NOzB0bLv/5NiDOSPgbCh6jObYIBH/vLFuQfgadWfrgabC2i832qqUtOxF9cZmqnXNzo4LObyCkRNf+OueFDv0U2FUhfk3MD+P4Z67LRb+Ly4ZCn6grG84QqZZkEfSGmV+zT3VWRkAiocJcBlc9ZA5JIi0wNQ1oCVEFoxWvkliLmSjoqdSSJN/ZoRiodLUGkM/eBCubxkohlqtDj4JAA5oeo4N5llr0653deBUQ0J09KpwHGnXrWp+2SXMxmPRZ8vkUkTQnybPdTZombAt5AX8T5tBTVDpwdy6gp4CyyjA4qx2cAqLbETIKVCF3Tx3Xp8R3IodTe1scUpGQ1Rz93X5pWhOFYhLBTOJjRJax5h5QPY0R3WFRoJmCyaOOwJ8qnaitdv9BF7vfOCPicreBPn0Zv0ZCVLmYaQuYP7OeQTaH5U3z/UMO/h6g979EiX4Ho27pPI82eaNnnNZKk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 48a56300-b217-4ae0-0cd7-08dd1f98ad22 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:55.8224 (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: FKyYdM1NUo45jA9hJyhJkOQBo5OtpUQpcuApbQkOAvTdjQi1Y9Ubxi0x7d1TVwhAPAD07edXkhlHsOFYl4X4FXR9sHIHpxNK2FKN7eSVupw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-GUID: kfJ-FbWnoosnoGbHlmkC0AIfbzIPWwFy X-Proofpoint-ORIG-GUID: kfJ-FbWnoosnoGbHlmkC0AIfbzIPWwFy 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 Acked-by: Darrick J. Wong --- 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 19:17:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914080 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 94AE1158524; Wed, 18 Dec 2024 19:18:03 +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=1734549488; cv=fail; b=DtJXcqwb8xouhzh/M7bBGlHLMimrwSV/LpvUv3tC7f10O5Kz2sYF5XaBO5Lz9+er7fpvHUJh032QmyXvPs2vVravespkce4qgvMKjeZpBCipgejh0JD5+J3bfd0AgG5jApyFUbpXYogfV31LT0H3/kNFFMqtTp/m5dFDG/9stAs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549488; c=relaxed/simple; bh=PHBoGT8gnlHecvpt67kbD3BgVagM9Twn/02QrNyTzNE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=pcT6S1I7KXZ8ZB23l0QaRgtlAAKp8GQQwscsHL8aL9961O1jVGrJhKJAkz2m8UJbO2SATHpMYspCAefUCe/O9724XLm8oRXKUgTdKkCl1BLfC+NEmMt+eCMnu4PDibaU9NItrozWc7tFUZG9Palv5gjV1dqYGE1wepUSP7ZUi2w= 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=WDdxIeI6; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=eWZQQ51B; 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="WDdxIeI6"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="eWZQQ51B" Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BIHQdpe007799; Wed, 18 Dec 2024 19:18:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=NDagatAf/Kin4dQWrwDS+8SvuTxGdumanGW6JdHdpf0=; b= WDdxIeI6+1JMzxJWbJZtPV4plXxV0dVGttGL66BTiAIcLWYBOhKN9A/WZFwdXB+M Q1p5Ls87TIUmQFbbQODh18QpjAVq/dBmt519nIg7Jl2YKMqk/mfvtk4nQ2eD06JI ToGvNXY2bK2Gibh8h0/EQKok4H1yora/4v44omSrykUQdehzeFWVupDZ85sIa+mC gmDkxuzwyBrApGEb+sS/C8jYn6F0PHNdRNZkUj40xXMQgp/ljBykaPZ4YyWL0NGs Sw0VmttDN1KVOTcxbJQFoy+N4FA+gekqDgBHqKoFQ6vTeNuXw8Eu0PhTuoxl9ng1 EadYqMJh/uPhvg+l8TyBjw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h2jt9h49-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:18:02 +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 4BIHUWow000589; Wed, 18 Dec 2024 19:18:02 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fad5nt-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:18:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fy6//T0c/YNkhfwMhkYr+BBxxhE4mKGjyXCG0QxVHE46cmqVBjfwFidUaTEEKjS5YEVG0Ibt3ozRMQ+6RN0rpK1RsyXqdlyysUtYXD+LTlsMLGpJC6Ax1uvh4U2gH3n2lDxS4ghtfKCIunWI0LOSsv0Dlpl2PVMFxvuCtCmErmQjvwOXswsW1NMLp0QbuDuoPV8z+uDuUKljeym0wyLn3V5wCRxaOkKnJQ0ff1c30Ho7tZ5gP5WnDqNi4IuVUo5Ya50SvLTK0E9uJGbWiin+9oBCMNcUEqou/jrMSpND2a1T5MhGE213PmhmHITgs9K0uZ+sBFn+krHq7JKDeFDbwQ== 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=NDagatAf/Kin4dQWrwDS+8SvuTxGdumanGW6JdHdpf0=; b=a/AI6aSR2xWzroQ5JXVFqfmM60sxstyvDlaNi05tv1FJoI4U8vp7RjkqFVyZaO5j8ewi2UbgnQmH+3lQEbOv4Czu6bjpx7xFeJYvhE+rlC51jDev56FSHxk9EjudryuYLZKkV7wI0vYxFsciMQL9G96JMU9Db6ttKrR223oXay8CTmDqI32sq8HgErd7rK6UVDXvP5+bvsz1B/RVT0fTMQUeKyvpiCjJ0JhylKmwu5AUvYqOAD6QcGRk1c+lGKd42KB5GuxLchNRFME/Ou6ICa04RHjkekmJ2ZOgSfYONPYByzxpWmGyD9LY2USJCr/RBFnIfw0suD9AxNHvieW/Hw== 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=NDagatAf/Kin4dQWrwDS+8SvuTxGdumanGW6JdHdpf0=; b=eWZQQ51B+XRSsoTpcjluaH0SdSXzNK/wvdawaOLIkZ57nC/QMNQx86fnMWODxZf0QqTRhSS7j+eJMgdpgW0KAxKAmvBZXkI317n6FthbeJYnvpiuSrQ7GK+zUYeEZXoK+mOBVHQNitIxP/tc3lucEQGCP+fPfY0c9HUnrw9urL4= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17:57 +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.013; Wed, 18 Dec 2024 19:17:57 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 17/17] xfs: reset rootdir extent size hint after growfsrt Date: Wed, 18 Dec 2024 11:17:25 -0800 Message-Id: <20241218191725.63098-18-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: SJ0PR13CA0132.namprd13.prod.outlook.com (2603:10b6:a03:2c6::17) 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_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: 3118b383-3207-4ab4-f6bb-08dd1f98ae3a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: 1iu0rt3r8Ipm0vn2pfNaJIl4g3pSuqqkfrNnR+Gw3InElG/Gn1DDV4ZO1hteyo+WG9B3YgsD1SIa9Dpq4GQNzgb1t+oxLG+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nOT6mdqW0BZrCLr8YTpDrlL8VeodiTMd3itl/cQk2gLL08qnJu5hWPgSDPTkkj435PCXWXK/bvuRyJh6WcTMd6Ir0LEFWvL9OGZQo70k/sR++KRyPXTf0tfqN7kBEMlq5DrE1Vs50yWGYEsOdaKhgsdcJCPGbUXnMVGJ2rQiGg+Yj6OqDVHIYxiEvMY+W3ZsH4Kp8i4tUXLNTECAKUwVVlPe2L4j+dQB44agAOe72c 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)(376014)(1800799024)(366016)(10070799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RRbCvfz6kDHTTfnk+HFqQb6ih5ia08nwMZFvyj1K00pnsEdDDcbUc+soKTTCNERs8Epy/walx1+qdQGXvl38drE5Bv4NlCUPokB0Ka0olWuU8Z061IQXr3vayNQWbL0yXEV/UoO6ethKo8NSKXUAacaZWh9DV7U6pGHNIVlwsJ9Qpzz0dKCrkI6yM+fJ6E3xDz0AaLEJoTXc51ib3P6qt74OrnZ+GcgbvHKEfCaUl11CZ5kmGz4ufB+Aq7QFpFFIqtu3wnTJuCaXAk6mRL7yUvp3RRENLQcKOi/8MZr5rPczanYYME08QA7b7BA+gYpahYA8Wh6AmX6Hz0NCbN+0qYcbSdApPNKD8s7ePHj10K5Qm+pBq2HC+yNGOrab4bDU3D/R8b+dAZp3qw5V+kxSa30F7E+9dhqyPo7puka+oCKemO62MYpvQhwmFXsEHhPCCEATIAOWs0sqBrG8O1X3cDLpRnq1sEeD5PyBzQj7ALiG7krO4/OXAErpBD5JBBMkuZndKxFZ4pna38chg3B/C19huKLJ20VpFBBMNZ0CJvAPZXwozQCN2Hl5eobyz85xalWgxkjce1W7VeN062xRVYB4rtbzyuiepcljx//obh8Rt2qJJ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pam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ZWjPNX1lD6rMpKrQ0aXwmLk9kEEhiyXIAKetFZADi+helWJhZ9x+0KJJo/aZXipa2SH7QVoIA3uQOPAOxj/gCRybVg+6rTqvg2KKSNmkSUfIUugP0EDvQoOOkZxmalgXmna9briI2AJBA5YidsYVW/GnxnMmZxC15ymHeIAj3wAX+5axa31OQld8IN2AqZLOkOwmyxJiCbRHO4WMiNMJTvowUzfnUHFwOcONFlhs2g3EiYoTn4BkoPzY7ZSUXamyemQHpi6wTmSJCodPFprlWfWTWEkYBHbVxwgXxxZZLi7r0+kL+JwEMAbvxcKvznYO62lC8eSUgNoax86V69ZwoWbqNbEBK1glJQXY4fVuZvozF4kfIlrdVudcYiqJudQ/2O+Yd9gJZdEHZGVX0PTUrhqutZKGnb7mA7MOXNVV456rd27URBT1yZTldpswdJ0fmONHv+whM0H005WA/mRgJtdSjGB70lrq12uyP/rmEx9RlUaVw8uqubMzO+7F/IKHI3GnFe1GarK62uQp8f/TBwOF+CfhroJnjTjgNf1vhI7b9dDVB+FJ5L5ejGjbONIzIxK0weOZAD5z+053b1obabpNjiKyTEkpw3mRwrB0tZc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3118b383-3207-4ab4-f6bb-08dd1f98ae3a X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:57.6875 (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: nJ/iEVeJfqhkfkskJJgEo+QzrU4z/FmbF9nFrpQe7wQJZutrBriTrCJhHCi7bT7vxPuebJj6ZOJaMC3T2liKUL8BWy2c+YJElMVLGkRA1Fo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 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_06,2024-12-18_02,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-2412180149 X-Proofpoint-GUID: znJggbcBKefxqSPvX4qGuQtvJMXJHnWQ X-Proofpoint-ORIG-GUID: znJggbcBKefxqSPvX4qGuQtvJMXJHnWQ 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 Acked-by: Darrick J. Wong --- 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);