Message ID | 20241016001126.3256-19-catherine.hoang@oracle.com (mailing list archive) |
---|---|
State | New |
Headers | show
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 ECD19259C; Wed, 16 Oct 2024 00:12:30 +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=1729037552; cv=fail; b=EHZPh6SHn17Pey51peLyAgvPz3n6auu+LGWmGndD59+lpDIvNPRJCu/KAjPw1r4bfXj49VOFWqxkKHXHI+PbUAkA4dvQ8MtgaOEGXsMEqWzWwgDsqN4/3EEng6FvuaZOcPnzZQzF+khy8yu1XleJCLm3YORxUPVwt+ubwkMiJzg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729037552; c=relaxed/simple; bh=Kh0BagGJNGvBs8fmT51DDOBp71gb3F/wa0+mOCo0sAo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=LKtuCxhkkIyYSlGeshJ8M/TrLA7N+JxtE0agmuiKNvoP8ctoJRrC1FBHXN14tBT3XQ7ODe1s252Ukid75/qq6oPRhJ9/G/2MdE1vxDqS8DuzcIRWB4SnY2KXcr1pTwEpg6/qK9s/ERP+BK+SWJ04wEEl8q5wCUDHgEvwYNfQcSA= 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=luGUEWZp; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=VTIUX6KW; 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="luGUEWZp"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="VTIUX6KW" 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 49FHtd0Y011654; Wed, 16 Oct 2024 00:12:30 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=f6pO4oukCU5P/fkoPAL8CUuRf49VRR3M2BWC/wYQwMg=; b= luGUEWZpojXMJLjjZbu6Cx0NIny/SLvD/pXlUm2HCEtiWiixQgjvV6x72mEvHCp4 Mn/En5cD9BBObnSWvlBPrlrfEk8O50PPZXYojZzgEEniVp6Z0wG50CgdadIYCJNF gQuyW7wb+UnT7SB6ORIfrnUvegJmoo1NBeA2iWmIvSW8rwMk/2TGDd4lB9YgKVU8 V9+47F3QIU1RWgabO45OyaMCJL20yM78+tOumKMvulpR/POuha7QG86QVLMKna+t O2pBySGh/pjZpPTlBKLg2Az6L/F+GJ37wfVsEoLIQNapEjs9J7hL/DlI1+K8DFHO 8SKz34k0k05b42hXImJ7/g== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 427gqt2fpd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Oct 2024 00:12:29 +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 49FLkLwA026369; Wed, 16 Oct 2024 00:12:28 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2170.outbound.protection.outlook.com [104.47.58.170]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 427fj85aps-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Oct 2024 00:12:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=C8HtD9Scw4TJeOkQlQKu0GFf5hzOLk2WwyhQgWih8IyBjZX9R4ZWwuS9JWnhydqNr9LIV99QllWW4h3gGkmP0/oZ6Oht+DGMK1pBvcn9Gq+RlZQZmlZ36I91GHQLTjc1EN+ZY8+xLcoLViFu9ZMMtlPuLYaLe0ugkKDWQXyQaNTitmgJX5zXtIJaCImBg1645mClx0biF7f7nGfvF6BDI55JvAIykGBgK4xx6SD+8a3RM+Q2/Xwit/1Ada32EJFUvJHypFXvnf8rheyv8IcDGd9V6JmNMu+DX3HXqEIf/4CWyhK3+bq5HcMUYeDBYWsGlqNfD27VZM3SDD9mg88DbQ== 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=f6pO4oukCU5P/fkoPAL8CUuRf49VRR3M2BWC/wYQwMg=; b=uaYZIobr7dIWKjqJgpOXllaeaC9W3Vy2a6Hu1fvaUKW1M9U4NmHEl4SPztVS8PjHKTCgjxAATqMYKdUbc0gGBvttWVbsUZJM23TUH9+HI+oYFoZcr/CXprFqKyU0SiMSTVvDo6MFNyt940XA89n6vcMgyeQtSRt8pyR/KAhdPRS4DYtFxL0cX5jNB6OPXPzR1TdyChfDuGIfR6vuM6xs8IzTKyutGdRy7qp8V3JlPwLvIcwZeGfvb2GDoR/ntT8qmncAkwiSVwRFahA0PKvQwnYm+lZMGj5yXgs3KbFyqvYfdvtisWFQvblwT/ksn46/CIDEp0MLGwxw5RVFge/qMQ== 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=f6pO4oukCU5P/fkoPAL8CUuRf49VRR3M2BWC/wYQwMg=; b=VTIUX6KW1wezC+gp6ddkJToxtsh0rlsDdYYXzK11QJRnSL+cJ1h8aAQYDSKKpey7Kxvmigc6CMvQ5ZPbtzSJp2lyFOmfOGVjgTJWNgYCKMv+wIwzURVPA+5ifldhLavfjrb4TUaovTLMm4UkPhe+uYPnQxxaGiBfBQR01RC+OoA= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by PH0PR10MB4727.namprd10.prod.outlook.com (2603:10b6:510:3f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Wed, 16 Oct 2024 00:12:04 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%4]) with mapi id 15.20.8069.016; Wed, 16 Oct 2024 00:12:04 +0000 From: Catherine Hoang <catherine.hoang@oracle.com> To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 18/21] xfs: fix unlink vs cluster buffer instantiation race Date: Tue, 15 Oct 2024 17:11:23 -0700 Message-Id: <20241016001126.3256-19-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241016001126.3256-1-catherine.hoang@oracle.com> References: <20241016001126.3256-1-catherine.hoang@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR05CA0029.namprd05.prod.outlook.com (2603:10b6:a03:c0::42) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: <linux-xfs.vger.kernel.org> List-Subscribe: <mailto:linux-xfs+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-xfs+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|PH0PR10MB4727:EE_ X-MS-Office365-Filtering-Correlation-Id: 236b6a2d-693f-4044-78dd-08dced7729e8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info: cO6bwDJ/tKe3RZxwjRISwboDv2rxmDUHJFMaX1qvP++8F0qnjofl0J/yQtF6ha+CuTdj4p2lSetY/GRRJWXvZv2knq8X6vm1JLH8ec7pSk0tue21wCQWr0i/TJOvZ/Ss4yvl6nXrnavjhDqN2H79CzJBi0/h0tungddzfPEA4I9nAJAIpqqEoRT0ckb/sHcKrnbJbUjAfwLF60pbqRhtkDrK6nv1SrzyjHyQ+iXGXqKSghtChylFXFeS1LRP5hOwT1dpDFDvtwRO1tcoU3WXoaFnW0rIi9hgx0WF6zRosNAn0AsI1UQM5AXgIT6GeIIfXn6XVG5eqEtZ4smnNoayOruA754fDYkr8hm7knpQBeWibCL0zdeh3UlzYdtVKkG6VN9imyer8IY/pgXbTcZqgPI5qomvjVZuhrdGVULBI1kvtrVBzf9ptRXBikLw31Cq1xZL6TEXK77vZ/R0bXdYD38DXXFEW7OPp3xk/D7mJwjGHflzWikSxlx3FbAcdJWuqAAmhDMNm3LkYjKHO9GML5ROEKS5xhvjB3dyEX/mFFiDQbBGa2MesTLa07nXWIpzpzVM+PPg71a3ntryNj8RRMteFUyMN0D/rksEkqhArTDX9KGShcKq+Dr6IdXNc+5D2U5bMFhJ8c2YADXg5r6ncpyVATazBkqZQxNtaVVx79k9Ri3XCKvSEmHZovd777bnzUZ0tlyahduX9PFBtW2qUa2nEwQU84zpDQ1oWOE9uHjp4+wvroaPnDRG5Ty5DNrMOdstxdIdhpqLgC1NpeysV6pP9HxImAf89HvNBj34nGY0kSzSIiP/PglDOGda+FrV1emFdTRy+Reg+K9zswT0NLSQ1HC2M+AC3bOaY8GYLIQFUebBASDke9GmdmaDXbNWjlDPDxfrMuVGRT+HS89Z/mPdUg/bvmJ+IU95bYVYfPA9mp62IuQcFD7oRSgb7EvsrUaQtWBkElqz1nDm5yrjT6ZxOCGLGQZThYTJsRr187vpC4W3kMHhmWudLmDLu2a7XWrRxDHltuhBLIhFVvbmIUJ9+03HsqLkUDZJf+yFgJIgNp8f0VSaTBKRIPCdfRhiXobbyIek9zsq9W2rimCdQ/lup3XDDWhMCuGO+AMFQaYCqgQ69orko6WYiHnojcsBxED8C8Edj2IM0yE8afU+Nd1tflYgwbx5yQxZHsynIL7Sjx2VH/SG/jsJd8722QkipW1p9eoIBWSrqxiSH4yVY4WQm1JYRFlxFfXwjHp5BF/gUL0vck5G237E2bzbsprvt2HHqPDpOi5qI08kFgTtJg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5316.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(366016)(376014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exch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iR1adTIOH8arI2vSXrNLSltuQ+PQ518YHYjrnb0Q5rur1QQJjIFzcISA+TAElER/NH7NEUV8T4PysnLqRDGg8MJO+pBNfix8vCRRfB54rCZMndJXODGEoONvR9gjYj37kqRbGDhL7+moSK4EwCzS0uTTFQVpM7G2HQMF6ifxG7JEGyi74lOaqn/G/VQPUJ39QRFmKFTTK+jbdpcB6hTLh37wjGHtv5YpTH3f4t1nnGfATFqvG6Q= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 236b6a2d-693f-4044-78dd-08dced7729e8 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 00:12:04.1023 (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: oob3EAYJlXWMU9CvlIG2sZUUf8x9bZwbFo80FJK7Y7SISloClckSwjxxzf69/q+rzRcj789ffj0tRknw90aTWx16x85+dJTuuLeQONY+bXA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4727 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_19,2024-10-15_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 adultscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410160000 X-Proofpoint-GUID: J3M3AopMJpDJT17054SYj9sJNon_JR4a X-Proofpoint-ORIG-GUID: J3M3AopMJpDJT17054SYj9sJNon_JR4a |
Series |
xfs backports for 6.6.y (from 6.10)
|
expand
|
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index efb6b8f35617..8bfde8fce6e2 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -2329,11 +2329,26 @@ xfs_ifree_cluster( * This buffer may not have been correctly initialised as we * didn't read it from disk. That's not important because we are * only using to mark the buffer as stale in the log, and to - * attach stale cached inodes on it. That means it will never be - * dispatched for IO. If it is, we want to know about it, and we - * want it to fail. We can acheive this by adding a write - * verifier to the buffer. + * attach stale cached inodes on it. + * + * For the inode that triggered the cluster freeing, this + * attachment may occur in xfs_inode_item_precommit() after we + * have marked this buffer stale. If this buffer was not in + * memory before xfs_ifree_cluster() started, it will not be + * marked XBF_DONE and this will cause problems later in + * xfs_inode_item_precommit() when we trip over a (stale, !done) + * buffer to attached to the transaction. + * + * Hence we have to mark the buffer as XFS_DONE here. This is + * safe because we are also marking the buffer as XBF_STALE and + * XFS_BLI_STALE. That means it will never be dispatched for + * IO and it won't be unlocked until the cluster freeing has + * been committed to the journal and the buffer unpinned. If it + * is written, we want to know about it, and we want it to + * fail. We can acheive this by adding a write verifier to the + * buffer. */ + bp->b_flags |= XBF_DONE; bp->b_ops = &xfs_inode_buf_ops; /*