From nobody Mon Nov 25 10:57:32 2024 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 5396F1D7E5F; Mon, 28 Oct 2024 15:28:03 +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=1730129285; cv=fail; b=AzH1tp+yf/frTUadbBrP7ub8o+KDb31tx6T2SJabOf6UddqOltYixRYTrPjpVOeDolFtU1JZBFnPOKlgdbRjIsz1Ru54UI8woQ5/CsxHuQwNNGgGFZ5PDbLzpLp41Sw/cbX/c5wE5b8/7a7AdGztBOi2cMKgXU3McPmSu0kubQg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730129285; c=relaxed/simple; bh=/4omSu4YaAMpctlgfIn9gujW/VBkrN8GppceQWZl39g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=hsHk61JsmBvGP4qip5b7G49r1gNz5M41Ve+r+yd/wLPDv69Yqw+R0nsvxKCSxlyGN3aJwHZp13Jq7Uevb5VAbxlBOPekRBJepuUW1MS79zjdJ0xdU1YJWSTdo/ejCqaqcE+eNlQulJBXKWeO7XGfo+lGrwY1wiUtG31t2J92HdQ= 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=E9sMpdBD; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=LApqyeeV; 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="E9sMpdBD"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="LApqyeeV" 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 49SEu6O7030117; Mon, 28 Oct 2024 15:27: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=og8QgRIQ+tfdEcc8RIfmH1HHOLcNejdMCU4XsdgeyAU=; b= E9sMpdBD1mSyiyhCTxhzUQ4PvyKQ2SW05J1emIMQgGUWuajQ5SKrHxzncTODScTe 131Q3R/xjEGsXIR+k58NlFGqZDvnrJyRqTdo5r6kQvuCx8+bMiHOIWhcDyggC1Qh CBHEdbW0OwRrOJ77s/xE1SmNzBifxpn+SxNOIMWzsk7xHg/7Rn5uB/VQOs4O1Egq kifHrLnbby/YcBiU2ZVWv1gcF9W6oONDeVjnFkc4sI0Ud2SSMl3cOufiyrM/Ea22 lWZBnPyUzZWPg9GiAJ/L6+GKK6Fgbyf7tdrsrTUBrhjUDCCkN7yu2cbCifBlqCUi IyTGOiQIeYKGY9hjUNjZYw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42grc1u5a3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Oct 2024 15:27:47 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 49SExQoJ008380; Mon, 28 Oct 2024 15:27:46 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42hne82en1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Oct 2024 15:27:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cn8YkPPvaeeU2E3endDiDg7WbylE5/YlpX+2CWnS29FOv0RD1VG37mJpBKCmZkmIV8sv9ifBB+bqvkcAdRka5aSGywreU7Jo8rwPUYS471twpTry/3vyYpooV4sdRseHtDgyhbbeJdXrzyBFxmgaRsetXIwvsdh8XoxBrQwaugz0pEHbtP4Wv7Y9vQ9ew/GGKiomviF7rGixDvyenTheRkzGGfqi2gj7fznhh610jA51zxMJZMS1Y4He+kyx5aM/2++brXjOpJEHz3y7vx6kx5eNo09Nl4m6VlDMum8VzdERCmEKCSAEpeB2KgyiG5ZSwvnMGdMDHqlFH7OPUatkeA== 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=og8QgRIQ+tfdEcc8RIfmH1HHOLcNejdMCU4XsdgeyAU=; b=yiPSPh5VAzQAES4NP99UkUFcQDp3oLuUo7j0BixNIQI9Os2ShMmRE+xK8VfO1NYsedlE5oE4LsWiMqhVa5hsrZ3yO28HiOrlyacyqZNXvI8zpiWFMHOe3n74PrZf1dHCgVVbHfMVgG1TynlzhPrynEgPVYiXKpFsx4voCqbxPwXg7CPtQUTr/wXFXL/AoTvVO+dqph7LT9hSYdxWQY2magblanWkFI6PNew/lJEvtph/a3HK7I7xa+r4CBi4RPL3W2Z1xe4oKZR2gyZYpoz2ClDfW7sZQhX85zVcoRXWmm7xKKLMHqazxUurl59RFgTQVXuQM/m9EPpzxd1LCFgfKA== 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=og8QgRIQ+tfdEcc8RIfmH1HHOLcNejdMCU4XsdgeyAU=; b=LApqyeeVWnQlWoa34q3/cv1xPmZd2jc7m1acgfKZ65Nor+uORyE574KNr+99PmU7mQABnnxk6ZRIc54jigcYOl9JN0W1QGWCe3ZnCKsI9CWRTYoUH0aZ/UZggRh0pco9LqRG8pjA1W3LiAviLsmQ63MMhO34C/YXszHWmLApKSA= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by DM6PR10MB4170.namprd10.prod.outlook.com (2603:10b6:5:213::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.27; Mon, 28 Oct 2024 15:27:45 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%5]) with mapi id 15.20.8093.024; Mon, 28 Oct 2024 15:27:45 +0000 From: John Garry To: axboe@kernel.dk, song@kernel.org, yukuai3@huawei.com, hch@lst.de Cc: martin.petersen@oracle.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, hare@suse.de, Johannes.Thumshirn@wdc.com, John Garry Subject: [PATCH v2 1/7] block: Use BLK_STS_OK in bio_init() Date: Mon, 28 Oct 2024 15:27:24 +0000 Message-Id: <20241028152730.3377030-2-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241028152730.3377030-1-john.g.garry@oracle.com> References: <20241028152730.3377030-1-john.g.garry@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BYAPR04CA0007.namprd04.prod.outlook.com (2603:10b6:a03:40::20) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|DM6PR10MB4170:EE_ X-MS-Office365-Filtering-Correlation-Id: 2451c86b-7690-4e2c-466d-08dcf7651230 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?1YGyraYuje2lQZLJIsB/rQ54OgiM7M6kTnbWMoOQlV66NLzBgbJM2ik6IWAG?= =?us-ascii?Q?nhZd301z4Vic5v0OA6Wvh5LKVEbSipTzuiJjTFH6JZDtQBhIrYSS7Hnp6xnU?= =?us-ascii?Q?3WpdFTea5bTSA4xpOckVWoefXD93zX58Lzu6GjUj3S96QqdgxU/CUugjoBO/?= =?us-ascii?Q?/1uZKmWsSiTtBdE/woPeqbfS+Okn+DYyi7xjDIeVRdo+tGVCFqbsiSmDPVm8?= =?us-ascii?Q?dJYQD9SKtoUk9Ua+3AoP6IstQWyx2GDTt8OG2W/1+IvOupeC3C02TnP8XrOl?= =?us-ascii?Q?6uV6Y/9h2QjtgtgNnCjJ1ehvlasBC8sKeguPhLAhpG0OlLtpsuoyKkJSELwR?= =?us-ascii?Q?KSw/SZeDdDC5i+8HLbAQXJo2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?us-ascii?Q?2ChfuY7blLxf+DpoWzwzipwH2EatD3lssdEz5qmxceUCyU/3PYqNC8zlTnaS?= =?us-ascii?Q?zvy4aU6wqLf9c/xpY09gsO2Y?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?G1u3wJluU/vU6Z2ZrN8xA+F4krIvkcJWSYWrYKtJS6BnjcuyjuN7OXzLJRix?= =?us-ascii?Q?SO7k8Kve72QX+9dd12YhwWnF+v6zzZfD6h/GA9CVNA+R+FRQzntrg7TBoQLH?= =?us-ascii?Q?G0Fti6cR6xgiWlBrwTmmdIO5LTlYud0D2PyuU6zZ4vCdPBe4KIEumAdzzB80?= =?us-ascii?Q?EC/4ziC7hbFVTeRnZCuzLcwUwCznuHwbNXgouNJkhoqkxj7Oy9l9xHdKDIjO?= =?us-ascii?Q?7z6hNe7tTQP50TYnKgupyR5xvsLBMBpFpSJmK6txRwYpSyEpEMfvP7KUl8XB?= =?us-ascii?Q?UCAyUksFqPvkTIDLv3Wr80Tnhq/qpxDUAD4ugPCtS31p47lYuPcoXT27Q8LY?= =?us-ascii?Q?s4/JXQK0FH2mXB3jJjVQupqvM1t9+xbFbeRxsbYanCSvyXIWPQNdsw56Op01?= =?us-ascii?Q?sHtigDCpGYS1uMVKIz659YLSAKxJgQNAzTtjPxBF/vjaCblh1M1OILrfMSz3?= =?us-ascii?Q?HCvi25ULgP3cy3ma+a0Cq6mA2GYYlexoQve2IwH9oQXSb3THHQjFLo+XG4VB?= =?us-ascii?Q?IFzFfRw3m11FlgGqmvoLqQzIlq21zfSU8HzYjiJ2t3eVXxJ5+CRPov4MqR+g?= =?us-ascii?Q?TQS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3xQa6uMsnxFXFXP+?= =?us-ascii?Q?VmmWM6RPAAvgTCK7eaifsraMZwnpTI8lEUGRLbPOXQ3Y6c7k+u0nVmrgvZs5?= =?us-ascii?Q?Bjd2D9YGiRch0d2TCFtaDh3WtssNVLuuEL744NPlOZrrM8AivR4fvv9M/dX8?= =?us-ascii?Q?gg=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: jaVSgbKcA11ieTBAlzI9nAcjqvHTXEJSin5szwbnqfPTSwSpyk1PekdVJTswsiHTcX9mtR61lz4Gzkabvm5YlNcVMbbZs7kF8mBSfjHPymzPx4UB/oQnJ4TcpHoYLc8QeindMYV0wLwpACPiW5j4HZmEjeqCR8j45vaBGiDOaTB8JTKcyok8uLG56lMITl9HoJPkIZ2Htv+6JBr8t6mKy9kIKI8IrqkKxoCTeX6btbikkhzBlpQ0AQGQnU0pHPBFDyhetuXV6ZSpcLGICBDvm+1O0m1c7fkqa7ciyjMyb399oqKh6AK/e83YQbdaL5MrMQG8XXdJ6p4U3e4bbp/M89OOTB2r82MR4e568oYE0aHMZJqH3uIMMxZ+XmXjaAIMqBAk5ngzqVULuibWKkQFvMGvy8ZCEW2tZua05SBkM1YXRNZ+fsSMUJX8dJEZBP26kc0cVFfngQAgHUnZz0j5opoNuqciRa9MNMRYUjcVhcTrRzQbMm32MJm3jaIWtu6vlVhVfIl7XUwywd095KA3Hu2tPIT1hXFsMJYMFI9S1q0V8kdJkceM5UGQWSL5eDaSI3OqinqqDIJVfROVXyknjRqEGTNVphR1EtxcGZbfSKA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2451c86b-7690-4e2c-466d-08dcf7651230 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2024 15:27:44.9789 (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: drukg7IkUA/I/Za3XWgBu1EHWQTxzTJQLKeW3+WaZPoxJaIgpKh1aMQbe2zvs/eBbr6U0WWgY/wp/5C8tek/vw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4170 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-28_04,2024-10-28_02,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410280123 X-Proofpoint-GUID: 0HPY0vj0JDkqoD5WDb2gbmbjqDxbjJoI X-Proofpoint-ORIG-GUID: 0HPY0vj0JDkqoD5WDb2gbmbjqDxbjJoI Content-Type: text/plain; charset="utf-8" Use the proper blk_status_t value to init the bi_status. Signed-off-by: John Garry --- block/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/bio.c b/block/bio.c index 95e2ee14cea2..4cc33ee68640 100644 --- a/block/bio.c +++ b/block/bio.c @@ -251,7 +251,7 @@ void bio_init(struct bio *bio, struct block_device *bde= v, struct bio_vec *table, bio->bi_flags =3D 0; bio->bi_ioprio =3D 0; bio->bi_write_hint =3D 0; - bio->bi_status =3D 0; + bio->bi_status =3D BLK_STS_OK; bio->bi_iter.bi_sector =3D 0; bio->bi_iter.bi_size =3D 0; bio->bi_iter.bi_idx =3D 0; --=20 2.31.1 From nobody Mon Nov 25 10:57:32 2024 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 5392215E5B8; Mon, 28 Oct 2024 15:28:03 +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=1730129285; cv=fail; b=XjARmuRp95XcSnkdUQg68VU22OtY6cOVtl7S+Opgxhg08A2PXSbPDa1Ekn7tyoaVdU8XYVefqhxQsO90AOwP/EbMVfAdeSgmRQlXiyyOU5SS1QSSnlb07GNfPmQcIGYqriOpIyxKZpTmAgtCELPYgUyiIs8SY8R1cFUdI5PGSAw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730129285; c=relaxed/simple; bh=WOytXhGw2l8zmHcugBBzMEkDHojRhg4cYilZsy1hGVA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=A1z1VUTjPhSybmDeg9cZwGLWnRbTerlqiV1NAjRtR7IJIM30ouqmNR+FC2bYv1IcIObRQ5P3TvooQtFyC44dkowgLhe5HMpYo0uUNfQSIV+Z0IXz3DDQ2Y5K8lr5q0GK0m/L+ZVxLbrbVc2KdSMHXuM2chZ4Hp2bKNcnV8h84mg= 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=C6cjIEIs; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Qm6GYEOL; 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="C6cjIEIs"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Qm6GYEOL" 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 49SEtaJN007132; Mon, 28 Oct 2024 15:27:51 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=cAJEcTdLmcQaI2cuNpR/9hiKCLKV1sOWvUvBSVSEV6E=; b= C6cjIEIsJz762/tKRDdTFPNZDiLDHAvgV/Ziox1s6dETtzeirCzR53Zta4M3yaKy hHFmWz8x53dOwcksOARn/5Yx4wp82SxmK4ulvJrO+1V3jzeWtkrgQ0/rSz0fbsds 03WovXCGcA6BZ/UmHVFuVAlsl1PVGlYstrKZeL/vQPJG7kz79TGqWMzOY46JDs+p Qi+i4K4VyylMSj2aedJ5BKA4CeHfH2Di8wDge4Cvsxl1nnJXUoz14OFxZNkjPrkC lL6KibdMU6mR/vpMcUhKIzc6+Quva+j5ANEExEiz+HPLbJpXbgqp1h53fwsh+Wrb 9rFRNiSrWRpkCHpG+8HnTg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42grgmb730-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Oct 2024 15:27: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 49SF0FsI040424; Mon, 28 Oct 2024 15:27:50 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42hnamj91q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Oct 2024 15:27:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cdzYs4nILQoyE9GDxu+L/aUHboMGiYu8LMU/zPSG7JYb/dMw380AoJzHcP0c2MCoAVglcAh/gpkqG9BKtgZGIDgF8JNXzYCFZuIyyJeMalqUvu544+C2FJt0PzJUqpgq4ogsaEUQmtDszWPDyPsW7J0VA2hoNI/2dawkkV91VjRWXnHtgbVsez7VJaRtxzCzVWvABn6SZEckty1UMpl3rKsVhyEzm+ZWBIrmRyApdp1B/2PuH8AP936TIt3eDeWl8LfCL9SSXW+wc6RmPhD+krdUVrg7Go79KOu7GbfeI6uCb7RVlbJBcF6YNyuUbCd0SBVu0ZLOeO+yp5iO76QQuw== 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=cAJEcTdLmcQaI2cuNpR/9hiKCLKV1sOWvUvBSVSEV6E=; b=MQ4HfmptVUgdLxBGWeYB7FIZCmH6TlRkK8pDgSih6V6/XX/nkoZGMzDyzWNjEVnM50KuJ8OSOkDh86sNixODNbPJ21cLaRKBG3hhrwB6hKVARFL6NtFfZYpQ4wE5Nm9L6wxdFFXxOxEqrz+pD+twvreBepH5PSSbghIKDCM8Mc+oBuSrE7X/HMaw3C9oFTfUpgqvcQ6IlIwmEPiet47HtRZDIlrVqprBRcHgidKXhd1HmC619U/VL3R3JIdeHRtI9TcFlug9bm63vK/k3qazfsZOOPcTbfdmn2fl/TOUny3khhMY2PhfX/uKrE4elFghmMm6P8xnkcqWo7xdlfthUg== 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=cAJEcTdLmcQaI2cuNpR/9hiKCLKV1sOWvUvBSVSEV6E=; b=Qm6GYEOLQYUmWDxXkIxUEo5jRRdOk+w5exKjtudMJfgu9K7qIPXirJDU8ctknSG5WnMUe3eQrOsNb1Y8+D4Mjz/Mpiw4QOm6qJL4LwkT/k3bZZnemB/cT4Nqdm+fA1e0vZ4yRPkRZkoYJtqueDlANXjJvx3Hc6xstzUUuV5n7A4= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by DM6PR10MB4170.namprd10.prod.outlook.com (2603:10b6:5:213::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.27; Mon, 28 Oct 2024 15:27:47 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%5]) with mapi id 15.20.8093.024; Mon, 28 Oct 2024 15:27:47 +0000 From: John Garry To: axboe@kernel.dk, song@kernel.org, yukuai3@huawei.com, hch@lst.de Cc: martin.petersen@oracle.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, hare@suse.de, Johannes.Thumshirn@wdc.com, John Garry Subject: [PATCH v2 2/7] block: Rework bio_split() return value Date: Mon, 28 Oct 2024 15:27:25 +0000 Message-Id: <20241028152730.3377030-3-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241028152730.3377030-1-john.g.garry@oracle.com> References: <20241028152730.3377030-1-john.g.garry@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BYAPR04CA0012.namprd04.prod.outlook.com (2603:10b6:a03:40::25) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|DM6PR10MB4170:EE_ X-MS-Office365-Filtering-Correlation-Id: c38979e1-eee2-4110-38a8-08dcf765135c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Z/RtGmrplEDTR/ZELPdBhEAOivbQKTuPKXCzzlMwauZUFQQbOXY7m+PbsN97?= =?us-ascii?Q?z29Ie9ZpODGDjjH5vx046aQ3PG9qrwDHyL5PfAbt+LhLirZAjIt8OHHkvLKW?= =?us-ascii?Q?9GDo1DN3IAmWjc+xBujHlQuj8gD2ECcTq6/azpuyPzFjY0jZaBQDNdKLpglk?= =?us-ascii?Q?NMIjkeU7DMj346GxEVp4CRb7Uuz98i7OsX/X6QkLbSOxbnLcd+v8uD6+80ea?= =?us-ascii?Q?1La97+arWBN7dxtwO0THqX95jPAmHXyQtjybZl9wsla/gga9VSvABBdlP+Lf?= =?us-ascii?Q?qy3IXchvZPVMWiW8sqCfseH07sGAvt85i8f+LQfzzkeGwJqk0OZrse9iIwNg?= =?us-ascii?Q?q2CSMXLX0skBnMBf+nN2S9aA01RJiBGaVw+ImeDbsz4Z4X39OqSE9G9sR5Yw?= =?us-ascii?Q?ocT8nrNFeeY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ujv?= =?us-ascii?Q?VdRAtpegz6q8aN73S2+5HFsl?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?5u+q2AIuBF+x5E8KvQ35dRdgs8uHpgGdBmpqnYQaBSIjM1go4u5WA0y3fXXM?= =?us-ascii?Q?n3NbYj9Yyx8YAZbbH2zJW0GR68d5EMH0vAcoONycycAzQ3Xe3vbDqooDsU/T?= =?us-ascii?Q?pqmq+Aj5TTwXaC38bhkvm3cO+5ibtTwssFezaOsyeUuSVFAIAaN5ZpDpwmHT?= =?us-ascii?Q?/zUL7J1mxeOGEHl3dkNM/AZ4DNEagWu3hvFi+2rlPj/NFDUyC5dkWUgv+wAw?= =?us-ascii?Q?7RN2Zt1JpY2Cqq+iehibTFP5jLWz+QMJL6p3etAJGhoVWw4L/sSHGtpoEIAJ?= =?us-ascii?Q?TLJ7olW7XpoemItjwnhEeafJDpoMIcVuAI6de7YJYYyFtQF/10z4vvKYE0hc?= =?us-ascii?Q?aGYPIUpODEjE726OYkrYyqq0aI6jPHK7AUjOeehzZH1dDA9xUY/8gG8auqt+?= =?us-ascii?Q?5XE9NYrWGpvqSmTkjMLRjF+bd4y/zBpCHOLNzQ+CiCJGjIno4zWhvwBJ3Zcg?= =?us-ascii?Q?jsS1YWScM6Kn6B68ZUr4aE92J68OgCCnnzZ1d+sdOEOigdGlu2wDUNdl60wa?= =?us-ascii?Q?Cn2H+XQvtnpTS2l8HFfnqXfVqCAKZD1jjRxZUgqSdvmXuapn4ZnYg6Jh86go?= =?us-ascii?Q?jU8N6sZ5F4QcqHvL00hzt29msCKqVdMm94nts4dsdfjKOOTcLMNb3tCOt0FE?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jm22JU/rivMMyBqAihtFNmN34G0M?= =?us-ascii?Q?sB1s8ZKc8H+5jBCfZptzYc98JNiHSRRs6rBs+aJ40rsZteQRnKw99Gy7F8U5?= =?us-ascii?Q?4A=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 4F2t0MdWTQXxQegc083ljCSazqkt+oequpZ92DJQ2LyxjF4iNNc8kLvmVrlHl+x+3x0V1Czd2L3VMel6QPCuHw2TW/gD0m71J7YsEEJjp0KSxzqNCUIxA3Yv9pipjZkT2Ib1p0T3PbuPTdE2eObtrr/HkW2sQQAJeLNtDXyLtBD5LzqYrX2u9B40vhRXbU6cbM/WAoZIyWDgPR3fWzHdOEuvtd4yxK6QV19DHOJuoXaq9479dyjBPOVRvr7JguKZ240C51UUgpXnu2w15pDpk9rlf5L6BCsxe9ZcA4YYtdCJfBKS3BKbBanlipze6RcqkHAJNt3b6k8yMfd4pPZNxcBP6NDGnDm8xMSXHjS59t+2/Ugap1JR+kRGOVqOscms39vZU5omodwB//jwo2rwOR8De9IhFX6Gtrj9osE2pPTChN8gAwigQS/CMG8JPTGSYHoxtL5NY8eb96jZ+X3Uh7Z/OsbahePWBfwPpWUE4uH8wVEUbaoYPtLbsGHg3yAS02xaxBcOEY8UAu9odZ/JEOKLruuRmXlpgaIp8TtBqbtR8asra10xPFzpdVk2AFgCB8yTqc3g83H6gWPF2DipCA20fReDWlpZ/O10Vy8qyuc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c38979e1-eee2-4110-38a8-08dcf765135c X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2024 15:27:46.9838 (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: rc7qxweWkgJnL64I1aP5GVGtlk0buuNMpLobUJppNdOMVc8N9e8aKszfkKfzdAOtjoqFXAOJFru1OAv9W36dJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4170 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-28_04,2024-10-28_02,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410280123 X-Proofpoint-GUID: HehrSHNuv8mG4JQ9gaTY45Ii5e5uJtly X-Proofpoint-ORIG-GUID: HehrSHNuv8mG4JQ9gaTY45Ii5e5uJtly Content-Type: text/plain; charset="utf-8" Instead of returning an inconclusive value of NULL for an error in calling bio_split(), return a ERR_PTR() always. Also remove the BUG_ON() calls, and WARN_ON_ONCE() instead. Indeed, since almost all callers don't check the return code from bio_split(), we'll crash anyway (for those failures). Fix up the only user which checks bio_split() return code today (directly or indirectly), blk_crypto_fallback_split_bio_if_needed(). The md/bcache code does check the return code in cached_dev_cache_miss() -> bio_next_split() -> bio_split(), but only to see if there was a split, so there would be no change in behaviour here (when returning a ERR_PTR()). Signed-off-by: John Garry Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- block/bio.c | 10 ++++++---- block/blk-crypto-fallback.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/block/bio.c b/block/bio.c index 4cc33ee68640..42cac7c46e55 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1740,16 +1740,18 @@ struct bio *bio_split(struct bio *bio, int sectors, { struct bio *split; =20 - BUG_ON(sectors <=3D 0); - BUG_ON(sectors >=3D bio_sectors(bio)); + if (WARN_ON_ONCE(sectors <=3D 0)) + return ERR_PTR(-EINVAL); + if (WARN_ON_ONCE(sectors >=3D bio_sectors(bio))) + return ERR_PTR(-EINVAL); =20 /* Zone append commands cannot be split */ if (WARN_ON_ONCE(bio_op(bio) =3D=3D REQ_OP_ZONE_APPEND)) - return NULL; + return ERR_PTR(-EINVAL); =20 split =3D bio_alloc_clone(bio->bi_bdev, bio, gfp, bs); if (!split) - return NULL; + return ERR_PTR(-ENOMEM); =20 split->bi_iter.bi_size =3D sectors << 9; =20 diff --git a/block/blk-crypto-fallback.c b/block/blk-crypto-fallback.c index b1e7415f8439..29a205482617 100644 --- a/block/blk-crypto-fallback.c +++ b/block/blk-crypto-fallback.c @@ -226,7 +226,7 @@ static bool blk_crypto_fallback_split_bio_if_needed(str= uct bio **bio_ptr) =20 split_bio =3D bio_split(bio, num_sectors, GFP_NOIO, &crypto_bio_split); - if (!split_bio) { + if (IS_ERR(split_bio)) { bio->bi_status =3D BLK_STS_RESOURCE; return false; } --=20 2.31.1 From nobody Mon Nov 25 10:57:32 2024 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 C47C01DE4D1; Mon, 28 Oct 2024 15:28:05 +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=1730129287; cv=fail; b=Wk/bBfBhqPjhNebTXpA68EcV2ylIqbrf/vVi5hQF+w8X6WEyil6+HDYlC0fFtnK8M7N18+JpfQ/BCHGb+gRHdhK8/lGV0HihU4QP/tkTv38BGXA3SN104QFihlpOc0GSCXF9OzsdRLSi8J/dwwkdjTvoOExEY7frbxjZuy9gogk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730129287; c=relaxed/simple; bh=WRHKSnaSgD997yIucatJroHRtR+E0jB6VZEbSMMQmYk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=XXwX8W6MGUe/QYgL/+xfVrlf3ehNagN7tNhOC/RzrI4wy7rILxbNrP0yBKhkUuKTraHZ6iPLlYwZYwvRpLXCBYfFGaGw44BZk7acOPbfAFqIK5XPV7lxJu0Dhd+6N5EcNJjLXKD2w7Zlj6X64z8VdBTasKVtckUkX05bkM150Mw= 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=n4Pi3ZCZ; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=ZFg5FiO7; 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="n4Pi3ZCZ"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="ZFg5FiO7" 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 49SEtcP6029536; Mon, 28 Oct 2024 15:27:51 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=k1mi2FeK4hPZbDgmP/GU+BLYQVVpbgR8Q/UkIZ+SyBc=; b= n4Pi3ZCZiQNXbG0lHW72rA890PoFxd2RCaabdfvkSWNVmLIVPWorhTE0TXqdsQ4f qXaHyJh6X8GH4wsZebUrLXjmuMWRbG6hOGMkuPHg/deghXrdX+TrOepmW/Y/gXHM za9O/2KFODxxFlh4uSUuaxyTyU5gtaC2zPI2hrIT1K+0KlLePO4RovQu34icZMG+ 7KSAQ0Hn+/9TUV/XTAXhH0i83n/9LmUAjn57YiwKZAFN/mbVt7mlBPLwusckfHRj Gvq0X333MqIHwjQqJxmGWRLV1jvYTIHoasAQHIiLhDRFihVdeUvtVjzMWMcA/e+8 nVlbhA0N8l2f2Sl3y+bU8Q== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42grc1u5ae-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Oct 2024 15:27: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 49SF0FsJ040424; Mon, 28 Oct 2024 15:27:50 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42hnamj91q-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Oct 2024 15:27:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NxiErHxmhqA2VQP8t/iUcKgIaE9DQQaONlpgjXIWQU6nxJUq3FBr7kXGMTQRD2E7AUDD0UJg9CXiH31rkue7s3Aj0mcoSXIrXR3mD3uKJpG0IC5okC+bwHuXUD3FtaIa4sKnB0okVsGRzCh+IsJ+VY++0G8gQPKPPGq6t3hl9lHUuM6hcwkRjorVDMUMofmq8jSASjo2fmfvYfrVJn1h1XAJ/ozyCPOdLnWMFRkdRmZFW6ZNTDkfR3rmrqrsYxZGrL0hcPOu/Ofi4mjFY4zLiuq0G4Q9N/r4V9WtwZVhKocBkqrEo1mGfBHyJAwWQPw8WjvzseyX1X10psjQz+AbTQ== 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=k1mi2FeK4hPZbDgmP/GU+BLYQVVpbgR8Q/UkIZ+SyBc=; b=UYyqg0ThQsSAPOk+m4cJK2dWNR2V32gZ0/D6vNZzkIyBtQEfGpZXEld+7igpYXjgEsrHX/EfpPEcsUFTjUujQUqfwxOLaUz3cIw0NPlRq38bq+FDBNa7jvLguw9Mw1eg3FUlvqhpB3tcVGBzyO6Ot1doZXdJdfCyDmZc2A0Eq9NroA1kuDZGAXwRZy3YGP9EYQIDqDRM+tTBfAmWOpAz4R9HqsrXTVSfBkfhvDFIgossrbR+/j8HRSNtaw6hsLI0UWhH6coik51hSbSkebIaAKJ63bRPXckMVtWbum2yy26fXcUvoNafL5TZa819DQYssjTLFp3hP79QCPefcUS4aA== 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=k1mi2FeK4hPZbDgmP/GU+BLYQVVpbgR8Q/UkIZ+SyBc=; b=ZFg5FiO7R9KTUp35eMRvsvDyd2RkL1iPILLRT79ns+n8dNZ79orxO5O7bAxCJR2Xy2pDStGrpW6Uar4JjnfAI5qGKUH5oaDIHHxtKJfMMI2eJBwNezEvpFxm5RXlxYotgBbcXSAbr8PZBk8IEvxyNibJaMafQvj+kYwXF46GIUU= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by DM6PR10MB4170.namprd10.prod.outlook.com (2603:10b6:5:213::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.27; Mon, 28 Oct 2024 15:27:49 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%5]) with mapi id 15.20.8093.024; Mon, 28 Oct 2024 15:27:49 +0000 From: John Garry To: axboe@kernel.dk, song@kernel.org, yukuai3@huawei.com, hch@lst.de Cc: martin.petersen@oracle.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, hare@suse.de, Johannes.Thumshirn@wdc.com, John Garry Subject: [PATCH v2 3/7] block: Error an attempt to split an atomic write in bio_split() Date: Mon, 28 Oct 2024 15:27:26 +0000 Message-Id: <20241028152730.3377030-4-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241028152730.3377030-1-john.g.garry@oracle.com> References: <20241028152730.3377030-1-john.g.garry@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SJ0PR13CA0212.namprd13.prod.outlook.com (2603:10b6:a03:2c1::7) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|DM6PR10MB4170:EE_ X-MS-Office365-Filtering-Correlation-Id: dc1bbcdd-51ce-4eac-8831-08dcf765149e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?j5d7T5hgRetEv7/6nC16kiXbMsBaxVfK2DH2SHjx3fECDFlpiZsH8iexsRCe?= =?us-ascii?Q?yzmewPxvKwWekxRSW3/6KC838rSDMF5BWmqYHy2u5lh8eVU8v52/RHXPQBM5?= =?us-ascii?Q?omD9d0Zf/PzKHGpgmvG+BRIeVJeJcoIKdfsAmsEMjlFJDp0jJSON04wlv0tq?= =?us-ascii?Q?fOZs2OejWr8Q2+Z1Qt8W0Ywmk8F6pHNrjKgHH8jOTGfTqJdM54Av/07PjRqM?= =?us-ascii?Q?4rKMYKURbsXXY4lVIlewFlf42bbCW8j12a8TeJS6dwRMTXsofry6mnzK2tM1?= =?us-ascii?Q?GoRIFELNC7Lj90Th9cAfwbLYgzJPNaRjumI9Tf3TSffaJLlCHx0nOjS7Sr8F?= =?us-ascii?Q?wFIAFt+iNvyQTgp1gd96qLxMdn/VVWwPhCB2XX1VQsAtHH7oocEy32sBu/y3?= =?us-ascii?Q?PfANb0AaSGXWeTMsg7AurxQndV3kO3zIa8zkCenJiavEsUpTEhUDFq6034YF?= =?us-ascii?Q?JZ2hqqMkK8f0knbXDOxGmN4pM5/n+7TYAlfzl+PJvSOPuzHqrn1rem9HDolF?= =?us-ascii?Q?4GiCiVFWnjVAy4vDKgVZueeinz1ItSQpZeYPeYtqNT+pt0dYgplhiuDDSNVL?= =?us-ascii?Q?aqxvt1SoUkow2vRXHVSYMfxZKXq4zbDrco35lPovFQk0kPaP+JL39aS58WXu?= =?us-ascii?Q?/CLPlDtUnxQuIscxj1yYdpQwU3PrCRlvh1VTmtB4tuhWaa6WozMTldix2e/v?= =?us-ascii?Q?XkekdRAQ4DXRxB8IHmLol3Kjmq9G3tHtalg1iAJIDwBmQaKD3bdyRFTkCq5g?= =?us-ascii?Q?OzvvKurCkjed6bau7W9XIe2g+AVZir2QMb8XJ2MsQT6oKwALXgL63irrQdVz?= =?us-ascii?Q?XQyWkiGTbgiIyjzGHDpRFgJnIHTp3f5HXATa6LjLO9yBt7lC116Fpc31VFop?= =?us-ascii?Q?O5jq+WjsndMWkOXmMzUULY4TdQ6nAFcD2kyRMGt8r7b0z9fs6uiQE8BPkFC8?= =?us-ascii?Q?pK/Yu/t7lFiJABMwhFycmJltZmPl+qk+T39MXvAY7gSPb+UegIph873LJ788?= =?us-ascii?Q?f3LdDOeg9QZ0BmgIQAXrfDGagQlBJaiUqf1Ghw7NTDqwvHDJ8vsx0td4Ki2b?= =?us-ascii?Q?qu5b+xbuPAb2qHUefVtbIV6e5AreFIQpa77wty9AxM1yG7/esNJke6S5Ke0B?= =?us-ascii?Q?AwGxhlr3FP36PQ9loVZaFeicKEAHiY8PashHnSIryRn/qvWofDIuYZ+02yyN?= =?us-ascii?Q?9q5HEsJ0eMOc5NAzRa/sJu7BsGWUpmCGEQfXMHCH1seJrQOb+xFvTaI528xX?= =?us-ascii?Q?9aG/SjzCIGPZTjVdJFC5w4Vuc1YRp1201/8ienydf5xyZXAwen87vxCfr4rc?= =?us-ascii?Q?r/tVERpEkwMFbaMO4vjF2YSG?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?FDkA2r4G0eSXRQvnSKzwgg2NR9TAE8fwlOlbLIIQqUQX5n40hBe313AoqcOC?= =?us-ascii?Q?7qZpo/PjOaUfgW+hhNV9J/ylDaSnkCwHCjgcT78FBCbfoA8BBwLYE32l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h8oU9LUyNtebQSeciwhltqiMlo1K3NkhT?= =?us-ascii?Q?d5wfFtJt995szrz1bXUDf0lPX1PAoq5UIJXqd7NysgHwietH0YdcXZJ1mwgB?= =?us-ascii?Q?geRYCPKzMiO7tGW4SAMxMaLqq6U4zVKMWXWGDheY6HIsvgeyFLgmdsHLJZ2a?= =?us-ascii?Q?9e6i59B2tNtXEkjuc76mQkgf6IM2qIAkkDp7lks1LoRH/CDNrQFcSLAgZm0F?= =?us-ascii?Q?7f1Npiqy6vU6K+k/MJMUlSceC1d30mpRBNNkL/ZL/dDFL/nMCnOzU4mkTKyF?= =?us-ascii?Q?sKV0K9RIG/dUpShrOwsRDy2N3wVHe5sUtM1nLg48Sutd3hlUjeGmRlWjVlMg?= =?us-ascii?Q?jf/sgnnlBWQIbzcs2hxoN1xj+yGjZH2hdDTrBu7H03wi6L4HrSScuX4ZNE3j?= =?us-ascii?Q?xApb39D/1TQlASnVMQWqBXAZ0xQdPaJFur2FgeLXyEmy4ZYaxHjWAW7j2mVL?= =?us-ascii?Q?6GqHPZ2QtnLlh27az45V1ERsaYivMP3FkFmB9pNAYY+miguc0Oqaa3OXmq7E?= =?us-ascii?Q?ZBcl+lxGOyPkmGS9toBxpSn+7jI9afveNZLPR1zHK7Mb6I5gsZ67GyQHqLbc?= =?us-ascii?Q?I7OeRSKmlbd7iUboHzWjBEtQBJk4v66OLC42Hfm1V9ttuShCUgNJjDAZ/T8e?= =?us-ascii?Q?Sg=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 9Ih1uP9YRUxknJcduD0dQ6nD2vwloZ6ECUK0F0c/WQ2sm66KwUGPUOYnT0enTUs/CvmsLYqBQWoWgIp4WCL4b3msbrGSpKTHk9v0Q0AUgE/t7IHaEuEg9UcWd1sNcXNOrVv5vCelUX/khR2nQ5MwGVHlr6jUr85IOOmzXvkglNHFs7wusMLHpsH2dWZIztBzGpxfj5ok8jI5yg9/kbeNWXpL5+xRb0heOl5yf7bdMY8BHHmoKnHBTm+thtM1kektlAKL+CffguIqxCdGLzcOfFIKGV8YrQxdjc0trl21+YC0XBY//wRHHlh7kLZHoH9fnNsGFyZ6jeKd3ya+1wKmLUd02qVVpSV69e0+RaSDEtSAM27CDqcqIuBn/H2D87bSE0GuUVAmdfsuhYXW6o4Cs0weLEvtT5plsaQSHN187Wnh+6ntU4WO2a9tWoPfauW1FdRhEqGUDzxrCNh4AN5jpfc6pTQxXEKpD8pLkBptIz6Ru0NXD0Ho1ost3+i0d9VaSpTj+Zrq9IYB4lElvcgHrkYtmQkHUnOnIKPVIaGpUNdZple0LBrjkMlWe6jj7qEQ5ShAIgc4rX0edhjg35UDxEZ8kj/Q8yx9hHIrOekNahU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc1bbcdd-51ce-4eac-8831-08dcf765149e X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2024 15:27:49.0445 (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: kzdBW9QaWVn1z3d18LXyCUxudQQVWGuwZRnBP+TmLPFnTFZR3lIL7a0JshylGrHtK2aJYZlqnlUmGIqD08Q3CA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4170 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-28_04,2024-10-28_02,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410280123 X-Proofpoint-GUID: 74FKbV-mPz-HDyO3drbJM_inbF3qdz6K X-Proofpoint-ORIG-GUID: 74FKbV-mPz-HDyO3drbJM_inbF3qdz6K Content-Type: text/plain; charset="utf-8" This is disallowed. Signed-off-by: John Garry Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- block/bio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/bio.c b/block/bio.c index 42cac7c46e55..ac2b11b164af 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1749,6 +1749,10 @@ struct bio *bio_split(struct bio *bio, int sectors, if (WARN_ON_ONCE(bio_op(bio) =3D=3D REQ_OP_ZONE_APPEND)) return ERR_PTR(-EINVAL); =20 + /* atomic writes cannot be split */ + if (bio->bi_opf & REQ_ATOMIC) + return ERR_PTR(-EINVAL); + split =3D bio_alloc_clone(bio->bi_bdev, bio, gfp, bs); if (!split) return ERR_PTR(-ENOMEM); --=20 2.31.1 From nobody Mon Nov 25 10:57:32 2024 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 AE5651DE4E0; Mon, 28 Oct 2024 15:29:07 +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=1730129349; cv=fail; b=bfomurXDcGwDf+PGw55ae2DJbL0MIVmCIuzfSUbRSdDajFd5Nhz+Y/C2hkYLjqdHnmu+kTLmeHrTJorR2BBZKQPHmWTMsWBvEFK1WmmmiN618qZcfWCsqp1h1QkS3N/3c2CrLl4PNDRwkAMsC7DGVZnb2YmiRvd473EkzQU0jtw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730129349; c=relaxed/simple; bh=wfJxrWHXPA5YhkPSQf1lq2Qa6GVsnrDhw47V3asnLDE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=tDDMYC6Qsh3c34nnESYR1+oG8PPpCED6D6rDd6p7NR5pY5StgzV/gQvy34/LVx5PzsNylOl9vYyeQGxYZ3ygcLQ5iRgJdxEgnSguYDHekp0eKr3tVWv58oa0ICwgCyPPArMJgWq5eVsVXCgkd56T/U7zlpTpjIb2rSAyjw4dxm8= 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=W/3VQg6/; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=e4GK6mNU; 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="W/3VQg6/"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="e4GK6mNU" 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 49SEtbBV022365; Mon, 28 Oct 2024 15:27: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=eI/46pvMtf0+TrOXZu8yO8DexourEwTZqsgrWS+KEKM=; b= W/3VQg6/hlsE03GfVcXYzRLtq0oK+OhGT4AmfK0R2XpFeXmeUKZqUcfk9YcAVVJ/ nysCFg515Bxe4NKEUXHnmPOOtqLXpPJjzgzBJyJtRJSfn1YLVVnFSElZkO7WXATh G95FG+oXMkZ+JicUh2xGz8jR+/5mKW+lyz+6vdywM7bLjMQBN0ThL8S2I2ejNksT 20f3E/l8N1uWCMV4ztHaN97fvfhdd9z3c5yvMvvWnpn69+xStmgzre8RzdL35Uka MWyTgYrGIjMj3b6SXFlEkAIt8kbd2XJXXy3xO4JXQ1i8lwRxTdWFc3bMLdtntIqL RrgKs+Lx7RhieoSuz+67tA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42grdp35wy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Oct 2024 15:27:54 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 49SEoWrb008350; Mon, 28 Oct 2024 15:27:54 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2175.outbound.protection.outlook.com [104.47.55.175]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42hne82epp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Oct 2024 15:27:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SBN6xdZ3S8AzvXBUhAUITrk2cgQWucjeAleTaylGxjmW2y76tr4WhAzdQ/s76A8vFzI3vlf05FcfVehQaduEHAg0oG54cfU1UezfdOH4Qlj/NDNgejXBZP8yvrL0J7JrspXnG/FBCMK0D0gxNEECfMaYzXufib5MZjNUQVa4PTD6YVUTwU0UNC/XeSQE5BJwROSiXulS/pmu1HPVLlx9Ki6xaPDZNOQK5YitBk8kv5mce79BtI2Yakw12soluat9B5VkQARClqGzdPUGF2iW0jnt+88+3OvSxTeKDFGtjJwtlZMqFxmqlfcn8QYSKBAjq99pC90ansXL3LKFoijYuQ== 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=eI/46pvMtf0+TrOXZu8yO8DexourEwTZqsgrWS+KEKM=; b=nrQgSItBZk3RAl6AIf9kVTIsdYqb14DemeF4BGVuBNXw/LCk26il3oegLVTV4w3kNePu6S7wt2CyIF2DMLoj874vR/W5Ec3/noMfMmt4mEwuLcL3S7Q3FQtwNT73yb/U0D132MAt9AGM2x4c0beONmFzf9UYGg57LPLxJRKWZtgtKR3hxheOX5nJs2ECcYVmnl7VxAjsFYr97M+JP9ZsHUj278kpPFuhyfdvYls16cXRldlQPQwAJH1wHhQ3qU8bLdQ9tzZJI1B7HYKSlGGVtqDFBd6b5J2IsZDOBbg9WKgfhI95nIW7VpNOR986Tgyl5QEHhtn4DdQzIpS4JqGQgg== 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=eI/46pvMtf0+TrOXZu8yO8DexourEwTZqsgrWS+KEKM=; b=e4GK6mNUu3MOww3Kf5L2Vw/4rYTVxyW1Z6ANepQxrPKCxpbwnC35AkNTggPWtXswFcFMTM0WLVHN77UhkW1OZlBmEz4mHswZufoWp0GGi0jBl3C7P5AsDc48xAhOaO8ehIo3Hit46vvYnnn1hG4XOMz9g3k5rBAfKaod2VhUcdE= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by DM6PR10MB4170.namprd10.prod.outlook.com (2603:10b6:5:213::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.27; Mon, 28 Oct 2024 15:27:51 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%5]) with mapi id 15.20.8093.024; Mon, 28 Oct 2024 15:27:51 +0000 From: John Garry To: axboe@kernel.dk, song@kernel.org, yukuai3@huawei.com, hch@lst.de Cc: martin.petersen@oracle.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, hare@suse.de, Johannes.Thumshirn@wdc.com, John Garry Subject: [PATCH v2 4/7] block: Handle bio_split() errors in bio_submit_split() Date: Mon, 28 Oct 2024 15:27:27 +0000 Message-Id: <20241028152730.3377030-5-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241028152730.3377030-1-john.g.garry@oracle.com> References: <20241028152730.3377030-1-john.g.garry@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BYAPR03CA0018.namprd03.prod.outlook.com (2603:10b6:a02:a8::31) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|DM6PR10MB4170:EE_ X-MS-Office365-Filtering-Correlation-Id: 9dc59dbd-edc4-4124-042b-08dcf76515d4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?mTvXdpwUOJpr8UEKn+/M7xZfWyIb8PRp0/MKvKmPx7dAz41wh+9R60GLq3w0?= =?us-ascii?Q?KSx4iDmkEj6G7gs4b9UTUXOMZIAK9HexUSytPCmFgKATyPjiH82EXjer7BLC?= =?us-ascii?Q?xKHWNg2I/7NzvlMggcMINdaf9iFbiZxBn7X+8Ne7/6XfIqYyP8RyViaY11bA?= =?us-ascii?Q?DAGyHrJWroprItI+pomf1YL5ihdd7rw8AuuBjOpQSmHJBxhjBh1wzvYphJTQ?= =?us-ascii?Q?Q5QJ/xB4RtuR0eqXvWpgLz1M5qJxqFUkRt+fEnNIjwi3F3JRfX1pf4eTXNjD?= =?us-ascii?Q?PaVUdlWSStyA1WBWKWZeIzIhqtdNeGBPZ/Cr2Zb+gj1sJbfo2RvjQYf7lE0v?= =?us-ascii?Q?4wxfyVcbu8X7RTNdvbU1EkSuFxST4MRXr2MCRzy4hmsm9xEnd0RPJYaXtjJf?= =?us-ascii?Q?zgJzJeO7LMXxeoh5gMpjdzGZTbWBmBROozw+z5nfVWbHh4G7b84gKn+XgVAa?= =?us-ascii?Q?5SZhhEezeJZShD8FIqwtoM09e7W9PFP/+EamkXIDd4bGI3spIFkhinNqG8he?= =?us-ascii?Q?xcbpdpURFEEqPUErVbAHgUZTsEXQWKyDorM13DRvqR8JLf7zmOpXj68DGoB1?= =?us-ascii?Q?aWo75JG0zj4cxJMjYoBffENbsrA8XV3Wc+d0/My6twIgdkUsNuAMlHSWUBRH?= =?us-ascii?Q?6BWSKV4e+XjCHzImXKAuSZcp3/MrCBCld/81Wro0nKUstuw5gBjCIy0VjKmP?= =?us-ascii?Q?jGJR3yUaL4BimxNjpXiAhb2IBTETPGm4NJ087D+DgIjmxKc6sUqyo8KoXz9d?= =?us-ascii?Q?OOIHxAJuM6JRa54SKgDKIymFqKthJy6jzUJKB4lu3EA2ThjtqXVu6hgBFJOz?= =?us-ascii?Q?kRtYwdA8ghERWigroodWph/+jdYYmrgfdMmhmEKU5TVNbWPD7tx6rOP/4C5J?= =?us-ascii?Q?NimtxqB2isko0kPuyCjwOfD8PV7cC27NwUkXKa+H9N6xnW5ekbT2kgjtOuww?= =?us-ascii?Q?OeyuV5HczO+vSRZl8G+r9FKoq3EAJ0gG1ZAMfddcs0avVRZP7BJRK8uGbn7+?= =?us-ascii?Q?uQfN8gkmC1/Oigq5nqh6r76kNxB8gvCe8JmOHvw+o3TBCn/FJtEcplrpi/dS?= =?us-ascii?Q?+BgSePYKChEWN8C0ECDmVc8ilcTxJy1yVfputUGHtMhs0dPSB7RatLKfNcRf?= =?us-ascii?Q?EqrhLySU36uKCLZAErq0xwMgJtriw3iXwd7rX3cqXXXcidtAt6p7PrHq8N2g?= =?us-ascii?Q?kNPkYGQ2GLdHkIpvmikswp13Cmxp9SA9/33M4blaehV4lXfg6lDDYpG/XNvf?= =?us-ascii?Q?MA0Yws/MGWEWhZt0q92I27do16OfgGnmLs87rOs5z7HRAykrdzHOZg5WD5pT?= =?us-ascii?Q?9lq5gA1Wh/iHNLgQFt69JiUZ?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?L4TtEezXJqzwBtch4czUv1j6BRohnGg+9cIoMwQInEtU+RoIl+4ypnQR0oT5?= =?us-ascii?Q?+THSxWL98VCE/Wd6BehrXKWNdIKk1R7IP8WSFC06LvkgN18SjozhIKnMScuO?= =?us-ascii?Q?Sb2TTPc4OtfSjicg3Ydlr4qvA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WCNeQ/AH49U/e9nmxRCcO3v117vd0Kvu+aMvj+nJqiqodttO4+529?= =?us-ascii?Q?FxbYGptPSvgL3eR0x3gvn52xo8EiGFi9j6gael1bcNNfMg2FzY9GXy03oBSW?= =?us-ascii?Q?w1+wRBnP07QQMWkRXBANTjXnQZ/1bBdjY1UAZokpbJkFYStmmjUC0tLErhun?= =?us-ascii?Q?Y39hEJ9PLAxXpAN3UkYjUjXKE1sI+q3q7ksWEemY1WXxDN5jK/jBICWHlLrR?= =?us-ascii?Q?RATXP574PP9A52rQ/5kWvZ5OTDgbMLhgOMybsVwUdELlK0EibsY71jJcghN8?= =?us-ascii?Q?yJYc0qFwEvq5oToYULBQ7WV1Wi5uJqxuL6/DJhzfftkLfNLrLeEeiYXB1QCm?= =?us-ascii?Q?3fHPVpaueyWu2VcXMHNZT+prZEr6rtdrI2mQNSRQ3XSN4yiNsqlf22a0OTe8?= =?us-ascii?Q?sPvz/16RujBULFmDTvpM1gNEqm4XDFx0ZImkF/CodwlrHIg9fSMwt/zdobfd?= =?us-ascii?Q?sCDDgNJ9cUJtrpiglBAiUTQm1Pkn7vB0BlUSFKeXtfnwZjRDO0apAY4EoOfX?= =?us-ascii?Q?w20PuuXBX2MfEYk33c1iGnBeHNcLtsR7sQzX5Crb+8fa1Mmj5BUdzH8Muk0M?= =?us-ascii?Q?5Q=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Wp7tpvaGUe9y6uNhRZEwcl8lJKrv+/3WbGs+Zjh+9Rq6/4QZfMcit4T0j33J7lnZj0Xa+Z7dTxvO9GeX64W+PZ+nx4gqt5ud0Xrd97QCZO14CQrYpN46tZI1JOxLeByxAcZDpYhGksbbdrFS8/iOjRpCyZFpjrUI4X9sIl+w5EkHCVUrpf71PeADBRIT9SoxS5Up0u+nXS/mNo2bPCgTlynwumFvYholQfD+4kK2Xl8BZ+Z0NsuwBNJsquxZZhk4KanyPR+pvtuN8J5qJ4oOPnITwNvv/4qMQT2+SNFu8sCM07ip1K3IXXzP7M1cTeSOKSQqA/dZCDqObm7ursTNzPdXV0h2/SCjoLABiOjb7MAsJrhNffiGyGE7N+eUg+Sg3B5AQEUxp+JyNJcYO8NYfYlQNJwQ6uDwVoYUaCu8rM323n3sfsMb4dKsODB8tZKHFUlk7HQsmEdYj9JARU2VvyQTY8ejCrMNkio8phKIVRPUTjzGxZe/5BXYqGfUPnn4R9aKewa+fwhK+vgwiilxpKGunSTBILA83b1YJsROHWxbTMRVBF9p7F0X8A9ewimA0Bb5qSjCeAZ1STEHEYo5gmZIAx6Z9xltBJ7qSrzXHys= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9dc59dbd-edc4-4124-042b-08dcf76515d4 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2024 15:27:51.1107 (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: ys9UXIIQO4YizarHh4j4Qs8MTAuls3W2mvj/0WtMx5opTys4bexoy0DZKlza6JZW6577DTGbomsBKLTqMTgsyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4170 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-28_04,2024-10-28_02,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410280123 X-Proofpoint-ORIG-GUID: C2keqsBry7I5-SxyD7rpcFm7RyX_AuLp X-Proofpoint-GUID: C2keqsBry7I5-SxyD7rpcFm7RyX_AuLp Content-Type: text/plain; charset="utf-8" bio_split() may error, so check this. Signed-off-by: John Garry Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- block/blk-merge.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index 1c73fd37cbee..b640477c190d 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -107,11 +107,8 @@ static unsigned int bio_allowed_max_sectors(const stru= ct queue_limits *lim) =20 static struct bio *bio_submit_split(struct bio *bio, int split_sectors) { - if (unlikely(split_sectors < 0)) { - bio->bi_status =3D errno_to_blk_status(split_sectors); - bio_endio(bio); - return NULL; - } + if (unlikely(split_sectors < 0)) + goto error; =20 =20 if (unlikely((bio_op(bio) =3D=3D REQ_OP_DISCARD))) @@ -123,6 +120,10 @@ static struct bio *bio_submit_split(struct bio *bio, i= nt split_sectors) =20 split =3D bio_split(bio, split_sectors, GFP_NOIO, &bio->bi_bdev->bd_disk->bio_split); + if (IS_ERR(split)) { + split_sectors =3D PTR_ERR(split); + goto error; + } split->bi_opf |=3D REQ_NOMERGE; blkcg_bio_issue_init(split); bio_chain(split, bio); @@ -133,6 +134,10 @@ static struct bio *bio_submit_split(struct bio *bio, i= nt split_sectors) } =20 return bio; +error: + bio->bi_status =3D errno_to_blk_status(split_sectors); + bio_endio(bio); + return NULL; } =20 struct bio *bio_split_discard(struct bio *bio, const struct queue_limits *= lim, --=20 2.31.1 From nobody Mon Nov 25 10:57:32 2024 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 32E611DCB09; Mon, 28 Oct 2024 15:33:07 +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=1730129590; cv=fail; b=GWIAxx6P/Rj7E9zrmxst1onWXeKjGqMNyEoOQm1SfNmuB9/DfDqq2X0/bQHis9Cws7h3amv57w6o1hi4MTRbAUNNJ8/Y/S/Sg18qE+xgK+XF0gGtk4VOl+lV8qcRlc/PNoqW8+RnDqtnF8qZCzC6Vs5h81EwOxIY4kUwLo2AbMM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730129590; c=relaxed/simple; bh=8WGjZZ2uUdJqXAx8ssuat2BO+LakOC7yercpb8ILtNI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=EiC7VLukD8ZABKmwzy7nvfANn155zrEOUSZjFoiTgyXp4/OTgfPoMW9UoEUVpeyQIz+psh1bgxOtIrq/lfUsPXfPpbOATEZKJqCodwPEHDyBAJKnNBsdU2rxTTRWNIC0y89AagYMrBe7eE0OxzqQgSL6aKkOztEcb9udXEH2RbU= 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=ayfU0pu3; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=uM+KlPAr; 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="ayfU0pu3"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="uM+KlPAr" 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 49SEtdEC029653; Mon, 28 Oct 2024 15:27: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=s677yWTqAq4MHUiT5TjTqne9AHZBYCflsasBGA+1yro=; b= ayfU0pu3R1WB26CY6yLy7C4AphW13EHxYBy4m6qxA1DepjdQFVv40fAPF2v1aPUv S0P0FUTNB0JIrYG3JtqW1hFfFu61lbj+Rv5XTSVErYWvtss+d3wnnPLpWOoUnO2x mB0CX5vgapclh590VwatEQBmYIVk0lYQFF2Sfmqh1rOm58BPP7HXPjL2Q/89VjsG 8gmLB0qavT9URLkBhy8rBL5enRkauhCJUbLPFZReQ6hxF/wrinaoERFwJKBK1TX7 8MPTDA+hUm26UNkCgLArhdoQ+hdcZjP6d4Y4ib3lbMkf0xHhzU8SYIMqM3EgODDV CXp8XKCHUD7J6K/MI8bUCg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42grc1u5aj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Oct 2024 15:27:55 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 49SEoWrc008350; Mon, 28 Oct 2024 15:27:54 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2175.outbound.protection.outlook.com [104.47.55.175]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42hne82epp-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Oct 2024 15:27:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=R7Dvcei+woKHu0/Hk5voMvnWItNOpQDSqwmkx4T56R6v+mLtydVSLKBISp93Hxx79hgXJH97rPbtpCEUcPS/TA708FdXP9vG+VqHGLPN3P5yh18vNb1tvMZrCzMDW66uhS0NTl4Ko9RAjIBGNFQeVaqPjNz2gJ5oyQLQp3zAi2UmyWEjuZ2PubB05yYxa4HgkXHdVo95LEM7g75M5cukim9hvwt7zPHHKKQqwGsCyubDQZrcITaQWxbKSsgek/7r1eAEDmjX1WYmv37ZNyerKkdywMN05oRtLuWfy/2RUvkSQQqaPeVb5/p4+LxLan0+xa06IrVcT69rLiMTzz+Zyg== 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=s677yWTqAq4MHUiT5TjTqne9AHZBYCflsasBGA+1yro=; b=f5CuOk342eBcnmpOvD8ehHYDrojE8T0xmPm2aFsch73n80BKr+5Z/mqX5F9/5qj0Dby6Rh7IajPBo5enoooTpTkQCkvPVS63AeOAco6Gt/FcCXGkLddLjrLXVHW/7Knisk7umcZGJ5C4cI7M4mPCZhanzF4D1PDyuZVQednr+sSJGHNRnyG1MsqydtFg6YF+SxVndOz8/C941wjHHf2G+pT1usWRKQyVJZW81fAm9YwqgWf8Zfoz+wqJvc5RCA8GIXLphv6OkEbrK+nU0CIxBOhYekxwOehXr4Ic4iw6JcxwPfpugWCJlFmx54Wu9Yb4XCqe3LGesZ3RKd74UCrGtA== 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=s677yWTqAq4MHUiT5TjTqne9AHZBYCflsasBGA+1yro=; b=uM+KlPAr/wrm01M1EkFdwsOaGqdMwFa9LJgostCyzzimLkyQZXCuw/rxkpSzHlxwfJF6e1EknETh8k9dduLb3i64NBFgrYxg5D6lLjSwaRfgxulDItWNQQ3sICp+I9f6rlAq2EBAeh0c7lVBUxN+jmuV5eYSF1Xl8NuD/R0QG/A= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by DM6PR10MB4170.namprd10.prod.outlook.com (2603:10b6:5:213::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.27; Mon, 28 Oct 2024 15:27:53 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%5]) with mapi id 15.20.8093.024; Mon, 28 Oct 2024 15:27:53 +0000 From: John Garry To: axboe@kernel.dk, song@kernel.org, yukuai3@huawei.com, hch@lst.de Cc: martin.petersen@oracle.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, hare@suse.de, Johannes.Thumshirn@wdc.com, John Garry Subject: [PATCH v2 5/7] md/raid0: Handle bio_split() errors Date: Mon, 28 Oct 2024 15:27:28 +0000 Message-Id: <20241028152730.3377030-6-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241028152730.3377030-1-john.g.garry@oracle.com> References: <20241028152730.3377030-1-john.g.garry@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SJ0PR13CA0220.namprd13.prod.outlook.com (2603:10b6:a03:2c1::15) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|DM6PR10MB4170:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f3b22c9-62dc-4d14-cd8c-08dcf765170b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?LDnYOzG69RtQuw+Y9A9ji/+t1tdZLgU6xu8Ldp5J0OGtJVl2FFFFuDl63VOq?= =?us-ascii?Q?yc6nLOGMgi0DBUGXQLUlUTD8t+YaFeSSkMP0n2kuOWDEZtBIrQcKx9tFS07X?= =?us-ascii?Q?fDY7UTDAIDJQX7vbHBS0qBdMSzNZnedjBf13qoPlaYR7/dpLQN9yVXFN2F5D?= =?us-ascii?Q?krjdS7qu0ILbboc8Rp+NH/4wXBeTLubvpN5DBACTX2R2Gzt7SSVV+9D9wN+d?= =?us-ascii?Q?hWmGTKgkxkgbX5qawNswFO3tgxsjrvWJ42V1JvxzWFgJopptbUJQzYNTZ93D?= =?us-ascii?Q?LQ8GaGwRIvBsys5O9j4LAiyTGFhNCUJdO3XG9StuH+1ctkrOR/KDO3jvIXzC?= =?us-ascii?Q?N7SechiwRYj3aZkdvnRGDxEwt0wQ7doba1+BmyhusLQSuF0NTLLKrFi7xFvi?= =?us-ascii?Q?Vu4qOCVsSCk6zVMG3IwzwG50HgFx0MGVNs0JxLIoAE5ZLU0oCk9LM9qK0rg7?= =?us-ascii?Q?UipqxsgXEZ30z8xEXvcMFSGNm6WodruvM0Kxd89Y10hou5zQNZqCttPxbEN9?= =?us-ascii?Q?9bGEy4CgM8FvJD/ES9gond7LLEVzxULXga9aKbhVivOaloleYk2aQz7knjvI?= =?us-ascii?Q?ddkQHV5uLV35AdOIk0R4f4I/MYt2SsG4j4Cr1GliIcM6WxU6oF0Eh62wk/Uq?= =?us-ascii?Q?9R6r6qM0Au6Yuc9Yr3uAxVUpwCR33jTAQ5tK+11DTxR2qx85o8AcioyQczHk?= =?us-ascii?Q?0r7xFzzgKx5z4dGQPNYzyZp7K0QESuzO2iFUBMT9l622dki7LtcyPvgio5P/?= =?us-ascii?Q?LJwdWTgT7ol75SHxlOCx/11sTVVn+ufyW7iKw2SHqLihu2xpbVPpIYXZRTfe?= =?us-ascii?Q?RpqWcvNrkm6aMizAnN3WD92iAfKmEtmWTfTvSMXl+v/TSvZYrqFfptnzm4w6?= =?us-ascii?Q?u/gjqALgcOls8ML8zfvpZF/jU5VKDEP5LL2ULCfmG10spsbvKedaeQ2og7JV?= =?us-ascii?Q?dxpBV+/Re0Hs7hxRIrVCK+/TS/A5MygY196JYpWz3EymgnIiHbygQ5GgCeoK?= =?us-ascii?Q?tEANJ2Yy0JDbGQ2rSFTVcJXynNopzz3aWC0tKSD7560MTjfY7TFpwW2wK29r?= =?us-ascii?Q?yTvoQgvPtfGO/eBZaCAuhdKZAClz3+XipouGpXbRAljg/qTqa+T467vSv0hE?= =?us-ascii?Q?mpbwLfVi7Bi+KMRFA0bzmk7xNDZp1rcv3DiUujX9Cfc3ozP7N9xMpNL12N4x?= =?us-ascii?Q?iSVyGUeGumUPQcSydhcl14jDPbF8db39Iz6rboofg48y9M28WCjYq+8t1PAU?= =?us-ascii?Q?lEOMKgfdfLjDTHplg6c/DrBqJ+Whe212ntQyaS9oA/cIBwgC7xFNNQXw5yk8?= =?us-ascii?Q?TKk=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZKPBH+pqVAW6PmyvWSEU7D8oEi2YamqaVosxnl8ifSZFFUtop9RaLn+Cj2wr?= =?us-ascii?Q?UQE8+dqYutbyLkbbPZb30HKgb5LvuigYDqJ3S6w16NeVwWrqpCKkOPdjsO8h?= =?us-ascii?Q?GtzTpTacm0Ai+IO37krTnxwggjLuT3PAwMgWt5tNpHyDwwx6hsxnhWg39RHr?= =?us-ascii?Q?EGegkFR+KCb16qtnZMyYrck6jK9DlUVJgFBDzb6Fj+IaFBNXxcV4r5CDwdZ8?= =?us-ascii?Q?7NrxXjIgjGzRCCxQkmkcdQdrhziVYy//9j7OvzfKcgolnqI0l15oUX8l22t5?= =?us-ascii?Q?9vZtRHN8Jw3n28NR2gc2myxFoufGrUk5Ck0zh3Pp7VlVexKmVB8N4F4ehz/4?= =?us-ascii?Q?Y+2T4DNo6CEAhvYzB5DXTIWXl6oenQHSFE8xxJBtsXVkamkhuHoGkRqHrpHz?= =?us-ascii?Q?pIf5SRv4WmtHF8weGRZO6x8BJXZRR7NFjCl4MdONSDZA7+/Jkxml7uMfMN53?= =?us-ascii?Q?uXMXJjJCTXULzTos7DQtjigo2uCmJhvKMBabH1koe584GCEaJgVx5wwu05Nv?= =?us-ascii?Q?eFopqhI8JdNZ3nQ4BXmLLHCpXBj6dlVO4ljB/vGhNpjfu7zIuApHn4mnrXyI?= =?us-ascii?Q?16Xq2TnsO/ESydte9TVSEWDNqYNrVKunYr/a9vAFUE96BW/zyoEzjFNPrpUp?= =?us-ascii?Q?UCIUnGeml2UI1VivB/S3uVi4d5+XT/r9VI/bYTENr7b3OhWT6uLqgRS2jl4f?= =?us-ascii?Q?jLhBL4L6jpLqRNlPs/zCa2aNmKgA4cjwAb+67pjOJRbl8ZJR/AD0zG1rpYrg?= =?us-ascii?Q?g0NyLp1Dk9Zkes5XMwFmk1ZfhtQtr+8cB16GrOmidgYcJlJtW4lz4obibKMk?= =?us-ascii?Q?6seEVNUhSs3/ARy5pUX5hWm+DC6Wu/Np0+WhX1+zF54xZifj9T0QmH9idEeN?= =?us-ascii?Q?GSoWhB1nZPLbYUjdGiM8aa175Cj1700dcUOHMkxjaQdRQEmEVZn4ivZHyUbn?= =?us-ascii?Q?w4ox0NSKr8pDl5dK+HNfH31QX5I8NvlQ2/pfBEbJu1n1NFJb+uRPQzyBeSn4?= =?us-ascii?Q?EsztJp9r1ztqAMfME5pfdSEuvCZK6HkbaQNSQSunARM1innGPkHDLFp1k4hp?= =?us-ascii?Q?zMOE0Ll21n9hI/jNKtvVU8NWCySTIuhLNGFWyvilplexksxuq+lrhigXD2gT?= =?us-ascii?Q?blUIC9997XR/kqhrRI8vsSc1KlvTkUCBZPLGHEJoJCoz3ZUxWj8EdkQqS+x/?= =?us-ascii?Q?RarPn29n3xzcAmvKKxWXIEoasULv+3TR8t/nbGqdj+jw//p/JRTPmhIRjx7h?= =?us-ascii?Q?d9tFENI3uazDNV4dgPI60lJlE2STLuK28WVX3ZOp7Mx7onBwi6kHP6WyShxe?= =?us-ascii?Q?K15XutnZLu6JtUQ6WZB5S8NBpgjCxTnhzGto4CWaIWslQzs/Uzq9iBa9+n8s?= =?us-ascii?Q?kdg2XSaqzEBkAP9nuJzVl2z1Hoqzae6qxfL3VaevpjaQdZivI7xriqYNAOZr?= =?us-ascii?Q?rvYPJp82/rhZN+PzcMF0nWT41Hfl3f1k5VjlPx5hl8zg4wDCvnx8dLDkv0rX?= =?us-ascii?Q?j+nMBEwuPfMQpeNt7WxTzSV0rqlKHtWuTzYzb2ukiFYk+f2qJ2v54y3QcFwo?= =?us-ascii?Q?diQrTDm7LukaTxcNl/0m90UbNuUFS3z168Wv4C6Cr18ybsqzAE3MwB5WCcwP?= =?us-ascii?Q?Wg=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: PH/4IO+TvrD1UnQbMtBkA80nnQRdP6/GFlpoPQ727Jx8uhWgh2hrVGh6CRINW13kjJ5c4JFxm7vLaGSyinrNlZLiqmzW8f2ZG3uFQcx2jUAeNVw+Oixkb4hGMRMaagxR6eAXxoTWOQ5G3Bc80bfr/J4JUoFYhnAeQRWgq6SroSQlimUgG9hCLXpNGZTnxEMWlS6LASGCE0JYNi711jd5xqHsiWIux5249gcBFE6VTxA7t76F3SU6WiymUC+Xx7axneACFwSmIQMeNGkLBwUbiC3GMHdkmlSkAvslYWftijbbzyXBLqGX+aeWToUVdKFNz2OOiXD0U4JotuU6cUYjblWgseGfD7fJB9qOiDehqtOGIsQZySJ/qZC0LLt85291N5SknjQUsxs6rehN064PQeSmYUAJ7Rd9RWQ/IpgGHWp0iRQ5mwcMcg5MVDB/gp2MD29+jNW3Npk+QK8blalKk+Jd63E+oQ4ZSiYtzvw8/3x2JD1vg1Bbk/e4I5CIq9WchdemtKtldbbjhzS9wIBlVsP7RH1o7bTjcZd3amhUpdfICjMAMvUFH7NLCoVWRndW/h3Fgi052jIfEzfesyeXITlc3avpQY13IwafaP0Ug+M= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f3b22c9-62dc-4d14-cd8c-08dcf765170b X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2024 15:27:53.1698 (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: kKiMwES/+Gf4yCHNo5Fit8HBOncmoR1S+7asj2PqxQ3Eo+ljA1QYEYqGxuOuBi+P2Pcorqz99hSOgxtd7Wp2FA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4170 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-28_04,2024-10-28_02,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410280123 X-Proofpoint-GUID: ib1Gd2WpcbuO_Xj_DI2Mrit6vmwj0ADl X-Proofpoint-ORIG-GUID: ib1Gd2WpcbuO_Xj_DI2Mrit6vmwj0ADl Content-Type: text/plain; charset="utf-8" Add proper bio_split() error handling. For any error, set bi_status, end the bio, and return. Signed-off-by: John Garry Reviewed-by: Yu Kuai --- drivers/md/raid0.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 32d587524778..baaf5f8b80ae 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -466,6 +466,12 @@ static void raid0_handle_discard(struct mddev *mddev, = struct bio *bio) struct bio *split =3D bio_split(bio, zone->zone_end - bio->bi_iter.bi_sector, GFP_NOIO, &mddev->bio_set); + + if (IS_ERR(split)) { + bio->bi_status =3D errno_to_blk_status(PTR_ERR(split)); + bio_endio(bio); + return; + } bio_chain(split, bio); submit_bio_noacct(bio); bio =3D split; @@ -608,6 +614,12 @@ static bool raid0_make_request(struct mddev *mddev, st= ruct bio *bio) if (sectors < bio_sectors(bio)) { struct bio *split =3D bio_split(bio, sectors, GFP_NOIO, &mddev->bio_set); + + if (IS_ERR(split)) { + bio->bi_status =3D errno_to_blk_status(PTR_ERR(split)); + bio_endio(bio); + return true; + } bio_chain(split, bio); raid0_map_submit_bio(mddev, bio); bio =3D split; --=20 2.31.1 From nobody Mon Nov 25 10:57:32 2024 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 C93521DE3D2; Mon, 28 Oct 2024 15:28:13 +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=1730129295; cv=fail; b=dlXCPqun/IjZkSUfZY8L4sf8vTF8qYxoVwf+e9wa8lzQx0EfC0zsUWCUNkXu/gBGPkvGqZLCndfY+ShisFiM9/yVhEGMwGwn13QSNIsmsCkf9JgLghGydiCUsVVMuC/JRCBKejgN0AiaPxiGyKiu7JxCyNdRjxa5Z2Uq+q+rEwE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730129295; c=relaxed/simple; bh=WoI/r1QWjcKziwARogBwfu+3/1dypH6ZqHWD7GAU9AQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Pc5t0Ifq8Hjavxb7f285PJxmsGRt2mC4nHa2lKA9DdjAUgljfO3fVv8UOgzUATgvFWxgrxe0larwkbCS75WyhqARlWP4JTcdzAl5SLzXhqFLONiIUIWunhBm26dV8ctQbxEZCriJVsJ0GrZkRDqORQAI8FNuBEKb5Nqs1CtwhdQ= 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=gGFDrfhv; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=QFmF1zDn; 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="gGFDrfhv"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="QFmF1zDn" 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 49SEtdr2020892; Mon, 28 Oct 2024 15:27:58 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=PSfIh2A/tpTl7ijGOPTvbARB0SZo71fMqtf9XqBRTiQ=; b= gGFDrfhvU3nXZznPw2nrZEYV4BdZ0NDNtMhnEIi7BfArdZN2K4y/JLEK7X2ZHAsl ZBn/WYEzXzI/A2sfJyHIYXq3rf2ZDwjlDtOhC8T/27m2MsYDrEfJGgpOjiYpIkk7 AXKA6PA9d7FIRnlCCs+fv/D5/NHNN8bLXXxI6zA2sucMoBsWpn9etsdPi0dwX7lN 8GZYgnhZ8kdagTvGSB2YOWzIHTDriKzd4vmvyG4Zk9/kdr5ywqoFGgPxI3FIABD/ EtclLCAO+dRW/2DAuM4CgQxV+bTRdlgg/JJeQ+8jPXkksXkAzXILLw1qNabDuaNb DNg4OB/hKwdngP4hbLntmw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42grys35py-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Oct 2024 15:27:58 +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 49SECO09040341; Mon, 28 Oct 2024 15:27:57 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42hnamj935-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Oct 2024 15:27:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nOicKrmdv+FPdaZXAvh2Jc/p8+a3NG89mkvDl4+CbkHgq2SGKPH6CIYscmHRkSemL8N/9fPLPqkcldUG4sOa9YMhnl/x0saKbIVltVA0SIQfRO207DYIzG2N2P3icyKYeU0L98Ll54HGvfQjIUcP96vYfQtM8J5MlJe4k0lK24fUa63Y2okbHJaUiZy8XndFzSRl5qaHE6N4MaiocOtmxpjjOIRdhEwbfb2oKVlUbUoERMOqhYBx1euIKp7hUg3pmarvW3gfa0QMBOc30N3eHal5dFC9TE5vWW0IH8KBXG111DrmPyUAgVqfvJhPgAW1H+4yQy3gBn1F+ly0LJXLug== 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=PSfIh2A/tpTl7ijGOPTvbARB0SZo71fMqtf9XqBRTiQ=; b=rxJwDZnOWKCgVlp2AYKwQViYbv07GFKY/874Alh3yVi+/0myaj8D+KHYNO3ScRBWMIvayINWbMAnpUknD6OuX2v4aakE8KDJ6XC2bEqEJj+QUhgOuPU6FFhW2OnsSb8gEVIzA5hGN13iZGkoN7mWty+X4jBpcqD2u5jMeiAu9HKPFRO10Z3C1EpBJzFGrbHCrJPWZ7xB1vdAjMYjW4Zq4Bx0s13r0LggZqi9Kn9N1okTF3Ngh9Gn26bKKIiKC/7ED+WrPAxZNLNoXnLC6HfBsbZORqg8XZO0hVbBX3G1PmIeFBm9qrFXc1MT/9yUPb065T5o2a+0jHyImqsv5M3Xhg== 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=PSfIh2A/tpTl7ijGOPTvbARB0SZo71fMqtf9XqBRTiQ=; b=QFmF1zDngODP+im4iWkUFRT1ul6unHIKUdwu2koCYwDZM6cKqea6c3sVaQf5iU5jQ4F5fkaeEx098cEsd088fKqH0gS3u2lDjAhb0+kU5ekTwFR6QvOOu1b9Q0QddoFuaZ3dXW+mcXXz466Pd56H/2sLHoIWUjjG0ZwRGbnNvww= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by DM6PR10MB4170.namprd10.prod.outlook.com (2603:10b6:5:213::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.27; Mon, 28 Oct 2024 15:27:55 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%5]) with mapi id 15.20.8093.024; Mon, 28 Oct 2024 15:27:55 +0000 From: John Garry To: axboe@kernel.dk, song@kernel.org, yukuai3@huawei.com, hch@lst.de Cc: martin.petersen@oracle.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, hare@suse.de, Johannes.Thumshirn@wdc.com, John Garry Subject: [PATCH v2 6/7] md/raid1: Handle bio_split() errors Date: Mon, 28 Oct 2024 15:27:29 +0000 Message-Id: <20241028152730.3377030-7-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241028152730.3377030-1-john.g.garry@oracle.com> References: <20241028152730.3377030-1-john.g.garry@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SJ0PR03CA0390.namprd03.prod.outlook.com (2603:10b6:a03:3a1::35) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|DM6PR10MB4170:EE_ X-MS-Office365-Filtering-Correlation-Id: 6655ea1a-6705-4c74-6b17-08dcf765185c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?fMPpf8cGOz6TBd/Kfa8QnRJhIb7ue1Gf4IKCLuSVb2/8du2dqbWfuBEFBVa8?= =?us-ascii?Q?0IWWHHalo/GBDlBqlCwoH2GYs6O6eJQSu5+9XpVEB+9CSVG1ZSvv7ZUZYl41?= =?us-ascii?Q?3UukW9N22Fa1KXkQsP36+Mv/3h92U0pQxKfDvP5kmINzkuEKO/fKPr6OEYf4?= =?us-ascii?Q?u/inzJRA/RPgkodnyJNISVdnbvy4LViuwvmObWFioJqDGmnSABOZBK0F9uUg?= =?us-ascii?Q?1ZlF8QoSHmkaBFZ7AetzUN89MmefsZJlV2B7DJADaHzPMj5bjphlzPO9SveA?= =?us-ascii?Q?PjDEaxBAOwJWdlc24vDAOduy0mKOmHVyYheuEFQ5Rk8EQgUYn/cpSid/jSRB?= =?us-ascii?Q?yTUGKdAf2YgtkCQK1y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?= =?us-ascii?Q?JiOA4aQ6Bvont+6LQeWCQC2NDWdKMgD3I/erjVsMq1MvQOnKzgrovYUvIQu9?= =?us-ascii?Q?F9HY4rpYmVDAhWXmo78gOeaw?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?rwUJhx9zp7JT/lGaQ2j7bzGGtxJDCb8W2LrsI7Evg/hSbXVzpA7yIsqzqGoM?= =?us-ascii?Q?X6RFTuY0Iag8vazR+EK1QnetB3xSNhIxOXrHb45FDkVc7Xncr5ImxKZaNZGB?= =?us-ascii?Q?PI9hQi37HwpcXk9nTLHLLtNp4vslnlZ7nz43eeza0YbLC7FWD5sG9ynUIt5X?= =?us-ascii?Q?2XJAH/eOLwk15TTgagBhLGToNaGbQ5urFxpdLAQY+Z0tH2WA3pngbh5sG/bT?= =?us-ascii?Q?chqk6gqxLRWRMbVspYgeoP75W5+UODJv7dn6zdQNaQI67OTrnQyFstuBC3lQ?= =?us-ascii?Q?xjUE2PUAcsU6qkqixa6ILviAp1EQV3uflud0EvZNCsqUaugbQxRoQ1Q+FB9B?= =?us-ascii?Q?BoXvf0oqz2CaTVoo0KpX2By9Meugt2g1UCDF1uyc7N92/brrh0ELPPXrcDn5?= =?us-ascii?Q?CCkDR1L7xiOteVIidIJeFcWWvYhTgE1yEn0IMnqyFv2WqU03N5arHd4DXhbp?= =?us-ascii?Q?Cwa96N3W42o8cNDbSuLttphB9BaNpQYwbsfduNCpil2FuMLhuC7pqeSWTEQg?= =?us-ascii?Q?AaeKCfA2BjQIhii7lRBuyDJdCVUguitjh8rO9fXK23XaVnAnNAbL3X5Ax5ld?= =?us-ascii?Q?sC+2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n0B0vNxolVX?= =?us-ascii?Q?Xe5dIV8pKRAIJwV9+jAFxymfkB3fcb0HgZK6R/BEAvM2RstcLdOB32Eayk0l?= =?us-ascii?Q?3XlhqFZwHwQhhBaVxY1Z04ln2+iX+Jp8ZnBBjFpwBHEgD0GTCZGfZEY6p8wj?= =?us-ascii?Q?7Q=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 7QR1tIKT6NXK06drnLwpi6Yv/HppaUSTB36DWF2lMUWNdpIBjCNfpm7AKR3v3Mhkp/dAipxN1DoD6g40kNkL6zpxhhHT5hgubzMozOUvaNguHoZ1qqULKFNQTY9jpIgwV006Z/gWMOA+baRCJ8e+zr94kOtKjDg7tKagWyOE6pRHoVjZ7Eso4dQS+XrpJ+U23taWD/mFv0dAzDBgiAXyrc99YqT677TOaXiZt9tVk4lQVoCf3xqYqcoPlvgSQyJL/N4lazX0C+Fuw7eAm/890o4WTHJ+DfjRNIwiLXfF0hIV/k81oj5q7NlHdMVKOVZFeZzdWWtbhOpoiNPWWNRimrT+lXBx1kpKMmxEsms0rBzf5lOxd8xtT9hbBQNZ5B+WDapXksc2+f1TXA3ubIu/yLdDSj6361anMdjmPo9pY79t1Ga7ktoaUQ52qUouEJM5Fut4EWGaTaJZBuiN3IVvQmuAeowYxqwMx0zfE76gcWguMyZFpFsge6CSNgSVegq2vCcahuR5vhFqnhViterNnyjqMF1CrfWXDRQHB4MMyVQcOfSVlfypWw0R9YwAHtbz+0HkGWJG3hZ4g8fP1WVrBJzhBWa9RG9tPShJkCtMXvM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6655ea1a-6705-4c74-6b17-08dcf765185c X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2024 15:27:55.3782 (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: pGuS97pJqEnB5njhAy+yNNJ618wRqs4xK91Y0yTwyqnYWy8EmnbPKxST4SMrG820857jFTHx9KLQrwIIO4XrCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4170 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-28_04,2024-10-28_02,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410280123 X-Proofpoint-ORIG-GUID: fZztBXoHjoptEBLDejg6y-Ar02q20RZz X-Proofpoint-GUID: fZztBXoHjoptEBLDejg6y-Ar02q20RZz Content-Type: text/plain; charset="utf-8" Add proper bio_split() error handling. For any error, call raid_end_bio_io() and return. For the case of an in the write path, we need to undo the increment in the rdev panding count and NULLify the r1_bio->bios[] pointers. Signed-off-by: John Garry Reviewed-by: Yu Kuai --- drivers/md/raid1.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 6c9d24203f39..a10018282629 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1322,7 +1322,7 @@ static void raid1_read_request(struct mddev *mddev, s= truct bio *bio, const enum req_op op =3D bio_op(bio); const blk_opf_t do_sync =3D bio->bi_opf & REQ_SYNC; int max_sectors; - int rdisk; + int rdisk, error; bool r1bio_existed =3D !!r1_bio; =20 /* @@ -1383,6 +1383,11 @@ static void raid1_read_request(struct mddev *mddev, = struct bio *bio, if (max_sectors < bio_sectors(bio)) { struct bio *split =3D bio_split(bio, max_sectors, gfp, &conf->bio_split); + + if (IS_ERR(split)) { + error =3D PTR_ERR(split); + goto err_handle; + } bio_chain(split, bio); submit_bio_noacct(bio); bio =3D split; @@ -1410,6 +1415,12 @@ static void raid1_read_request(struct mddev *mddev, = struct bio *bio, read_bio->bi_private =3D r1_bio; mddev_trace_remap(mddev, read_bio, r1_bio->sector); submit_bio_noacct(read_bio); + return; + +err_handle: + bio->bi_status =3D errno_to_blk_status(error); + set_bit(R1BIO_Uptodate, &r1_bio->state); + raid_end_bio_io(r1_bio); } =20 static void raid1_write_request(struct mddev *mddev, struct bio *bio, @@ -1417,7 +1428,7 @@ static void raid1_write_request(struct mddev *mddev, = struct bio *bio, { struct r1conf *conf =3D mddev->private; struct r1bio *r1_bio; - int i, disks; + int i, disks, k, error; unsigned long flags; struct md_rdev *blocked_rdev; int first_clone; @@ -1576,6 +1587,11 @@ static void raid1_write_request(struct mddev *mddev,= struct bio *bio, if (max_sectors < bio_sectors(bio)) { struct bio *split =3D bio_split(bio, max_sectors, GFP_NOIO, &conf->bio_split); + + if (IS_ERR(split)) { + error =3D PTR_ERR(split); + goto err_handle; + } bio_chain(split, bio); submit_bio_noacct(bio); bio =3D split; @@ -1660,6 +1676,18 @@ static void raid1_write_request(struct mddev *mddev,= struct bio *bio, =20 /* In case raid1d snuck in to freeze_array */ wake_up_barrier(conf); + return; +err_handle: + for (k =3D 0; k < i; k++) { + if (r1_bio->bios[k]) { + rdev_dec_pending(conf->mirrors[k].rdev, mddev); + r1_bio->bios[k] =3D NULL; + } + } + + bio->bi_status =3D errno_to_blk_status(error); + set_bit(R1BIO_Uptodate, &r1_bio->state); + raid_end_bio_io(r1_bio); } =20 static bool raid1_make_request(struct mddev *mddev, struct bio *bio) --=20 2.31.1 From nobody Mon Nov 25 10:57:32 2024 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 723351DE4E0; Mon, 28 Oct 2024 15:29:15 +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=1730129357; cv=fail; b=Lvb5v2REY9ldqUF6bBhJNix9ESQrIsHKuM2x3tBbVRJRtkzmi9lvJ07Wxyxn+GEgQt9T1z8vWxq9sSlex/59emNlYoAl4lTdQZkwlBkwd4HhXESU6DRXcyhRsz8FysBFUKEINR+C0IE+6dgfhQOCrqbjhr5xepgaXFL8LTWF2gk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730129357; c=relaxed/simple; bh=iTpHGOmou9QZgep/pRVn/CxUTYsxJkracQjiLbQ/YLk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=WPWmLLmqIXsKy3skm+/2KjvNfqPOBVMYfHSP/xGadEAaypTjx81V/hFgiNRf1YBEtSbucHKDSqsgXQaCjQvx4lAh9MYZqaBuo8+JzGNRjTAqzLJFdLFOl1BSMKRhmb6M8C7uGLr4e0UhqxETtzJi+fsN0Zz1UruyV6E6YiKepCA= 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=TJECCVZN; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=I2CVBH2U; 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="TJECCVZN"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="I2CVBH2U" 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 49SEtedf020914; Mon, 28 Oct 2024 15:29: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=Q5CXf+PHJ4l2cVACcluwS/nmIExXFJ+hJGBwEkz4JSA=; b= TJECCVZN/54XgYb1sWXw6vHsjbRMyfzrEyM3ZIltrcHl/MsJfd0z9A/s8hGreE6q 0GRsoV+l0RWFk3cCAHUWV+G8I9wzyEG49psoFdmRpKVNHrMSBfJ3y/bFRRsCyfBM 1HpsrqoSiTrRJLnkCxLymg79+eze6m9r234T7Tx4GvFspuxzEphDBmVi5czpKzkP 6QHUmPhbTcpWuv8rLSMkw1FH018OyGMl6v2F9h+EfMtzacdXPrGnNFI8DHJNIl5f Stin3NwO91fiooJEvK2G8HNFD4VHv+Yh6EjoVjgzf+rf92HCS63rZ9Sr+aGaNrtf GYZ6dIB28dDSHNF/f/GqOw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42grys35sm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Oct 2024 15:29:02 +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 49SFFiB6011746; Mon, 28 Oct 2024 15:29:01 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2048.outbound.protection.outlook.com [104.47.70.48]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42hnaavq6u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Oct 2024 15:29:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pWU599GgKHgdW7hXUfyduYzyZ3PhA6IqCIQA5x+ubsY8PNwXY2U+ZUPu8UW4WGbcRHbQgZoSqL0xS3KOid++nuvGCi/RmslZLlT58pSqFHXOm1hmc/GGCCtbfzUqx7Uqq96UlGvLW+lAUWA/C516dwl7ZvHHAi+U+KsP51yTIIiQqN1gRHRpPFIycnvijKzLKD73DWRQXAPnsg/kEvhIWFPYQgoalypo5X1c0Che1dov71mNZ3HgAp72X5kbM1Owuk2nqwOukzVsZwGrljMWB7+THKpshaaZrLVpTbR705cg1FIpGL0EkJZPemSuIFsML1zhDR0mwrOF0JklXBVR3A== 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=Q5CXf+PHJ4l2cVACcluwS/nmIExXFJ+hJGBwEkz4JSA=; b=Du+Maqg1Xwe7/bHkCSvriiBPdvDwKg3Hh3MfyYrAjFJ8blry3ozUyRHRmK6I9ituslz3pgUa00wr9FGwOStY5XbEKusoLdD39RB9DAkNyBQQz0m7VkoPAoiXi1MIZ1udxUZmL7aItA7sXK5lKxTGTXpoghW7gWkJ0KojubgiTc/mnp6bMudSloD5i7CUxX34oU+JDUx7cl8ML3QHtQTng4TNkXL9PcEajS7i2eYEhVgsQdlVhFtARRo7dV5pBPKPkHJjfCr8TE8o10dfQUry5aSubxHWZZdaoe1iuOGt9uYCyI6mJ1TmpyhPkMYPapABA9Vm3wPlybgv2UonZaIxsw== 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=Q5CXf+PHJ4l2cVACcluwS/nmIExXFJ+hJGBwEkz4JSA=; b=I2CVBH2UZxrX9TIiYE02DrA0mkgtUqZPSH1BsJQs4W1Fu0dna3Qx54CB9RcNn0z6u8cgeiYev0+9Uo2pp77BS59rQaAJAuidNGEQzjTPAlUE5pSmVTVzGScvved46+iScmiUXrp1Jp30g2dnqw6dXueEaeKn4wk5olRNEuQa+3M= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by MW4PR10MB6299.namprd10.prod.outlook.com (2603:10b6:303:1e2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Mon, 28 Oct 2024 15:27:57 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%5]) with mapi id 15.20.8093.024; Mon, 28 Oct 2024 15:27:57 +0000 From: John Garry To: axboe@kernel.dk, song@kernel.org, yukuai3@huawei.com, hch@lst.de Cc: martin.petersen@oracle.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, hare@suse.de, Johannes.Thumshirn@wdc.com, John Garry Subject: [PATCH v2 7/7] md/raid10: Handle bio_split() errors Date: Mon, 28 Oct 2024 15:27:30 +0000 Message-Id: <20241028152730.3377030-8-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241028152730.3377030-1-john.g.garry@oracle.com> References: <20241028152730.3377030-1-john.g.garry@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SJ0PR03CA0155.namprd03.prod.outlook.com (2603:10b6:a03:338::10) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|MW4PR10MB6299:EE_ X-MS-Office365-Filtering-Correlation-Id: f73769d8-dfdd-4f66-fdf2-08dcf76519aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?CQ9NXAyzaCe6jkVKgn9S/yjhnbCR7yPbpK6+4LH4tCsq/N0cDzesGdfDGn+D?= =?us-ascii?Q?2OQHch7ZHmKDiKgYCGfOoYC/bkDOF0gJlcVjodTwjKCMD59lOpigMOHP1Tnb?= =?us-ascii?Q?2sq6YwrVRrN2M6wyvSLffnM7CplUH2pP+flKsakWbubiB1JO11GlXrFf0PQC?= =?us-ascii?Q?xK0S6G+vUB4OIGLUKoKXi4Licc/97BBkhvsYJmDLWAYnstTQKZ/PvWvMKIqA?= =?us-ascii?Q?yOpp0OeXIA0h/jhgTFB+bvmQ+7jt7CdbV/FuVCHK6uqP6Y2hDTt6oZ1F9n4O?= =?us-ascii?Q?KI/gaxer/MeNLlwpAxWdQaXF0C+rCyDWQQivacMmSwflg032MWgssAaJiDvq?= =?us-ascii?Q?wq7+5Be1iIvJYp6Bs+9hJ8Pax69ZKXoCsEu1JoFwh2krU0lEDFhjglebyaP5?= =?us-ascii?Q?OHSVyV7Ru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gO0OgzD5vDnJujvUvG?= =?us-ascii?Q?dm4=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?oyBnkbvaU+6DA709ulDNg0hyfHD1vFG9HeKIcXY1pj9vY52cDymfk3e1BJV8?= =?us-ascii?Q?gwEgD+q+ZNfTAl/pF1AXNJ6pjgBtDMSSis2DFW7MyT8WWY/QQrjV5ia3lHi/?= =?us-ascii?Q?VCErMRKQX5+9BCo+j0KnaODf8X8yV159brUz3wPt6kxFzQ4KupKbh3Muhwi9?= =?us-ascii?Q?P5hk1RfYzRo6b9hnmQYWpV0hA6jxIQDgxQXBA1h5PJCggVPiVVHzW5xhzGt7?= =?us-ascii?Q?mD4+pNreg6KMkIhcJD72zEGnAjKej17G/+DMq+eposiGdkuJsecGHROnpamJ?= =?us-ascii?Q?4OzdHbqF4vT6/P+zox6LOT9S1FYfu3/Seeze/YscaHyMAuWitgpRri+VqsRo?= =?us-ascii?Q?WxMqLEQXxS6bMQp1zUbQPCzcEM/9QnJ272o1dfOnJKlDs5YivkC9CcyIGgDJ?= =?us-ascii?Q?2Ba/tP85tF0ITUzd6J+5R9G9sKc6h2Uc/OL5OIiAqzwsyco9j4nOR4bxYE8V?= =?us-ascii?Q?vPHElGoBnXW2Ai3TLWviDRuIm9TFOSyQEbPk2uBCDQINhh+6b6R04o+63xzJ?= =?us-ascii?Q?2rNCnn3OPEbw/i8uyVXwOAy5gJvpJyNeQyfBBvxdRNR1UGzXW6nmtGgwpT1w?= =?us-ascii?Q?+PI5SP6TlOLPH5wvSOio7S0CuKY8i6ul/3a4RrECWPFNHgWyUN9OZ+d944Jt?= =?us-ascii?Q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taBkId01A?= =?us-ascii?Q?M5yHqCDVAIgjAVSf5o4jTtBIyQmdeQMzKgpRiEQD1UJ98gn0W1N0jHlLb4av?= =?us-ascii?Q?lQ=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ApcYgCrxHEY3T3HRIQ11M9OLuKY0AYfHstDRd8IapBXjLA8s+WVlQktouRfT1mcinAp70rwpJmQv46NzQTogrWFkayydeIS7KnlXoOJk8Ki+IQr/hdBeUTLSF6ZbKNk0QI/2DTfDemD/lFv3cwIwYrLXRwDedyvxwBaUhJKoaCIv23H4m/TIBlKXcD62+SHCnMWiRU94ph6OlUoblgce8a2U170cQh1zPohfX++87v3hp9n+SgVg2iZekCk5VFmuDFT6glzUZrAApWrGWZ3p7Dd6K2XShusua3KViLNu0SECQJnW0Og9sT9TWHWNihhj6bNPLCr4em6TcXsQKOkCacIrzY9VM8XdKZRFe4cbU3LUalJG+rfCm5aOc8xmoFebvTXbftbGw+dKOzifLRdMGQG6LHBocYJmuIZ14BxYN2F7+kj0uIYbnl0kkmUfciawP/8UgNnBKQTnbvUJDPxw1uQIa+3PGDRwdU2h2olTrni+08zTdikqnKj5Ux0de9t+uh8h60OnrjTjHaLSAI7LukTp1C/ZhK/QKR2ld2m2H58PDSXT5tQAuTfcRoudHk5Btr8MJInuM9gqth0FTCdsLDukIU/lHPYD/savNVhBn7o= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f73769d8-dfdd-4f66-fdf2-08dcf76519aa X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2024 15:27:57.5726 (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: /sTf9GOY8g6wmzp4G4NfYcHuXrXsMEWDtov9nEwiyiK1Q5ks1NwF/4oYgXWfvtvvQcJtISBSghAmFTW+gowwDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR10MB6299 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-28_04,2024-10-28_02,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410280124 X-Proofpoint-ORIG-GUID: TBTtwxzJwTIe6riRWRu-RpkVbDyxXMYp X-Proofpoint-GUID: TBTtwxzJwTIe6riRWRu-RpkVbDyxXMYp Content-Type: text/plain; charset="utf-8" Add proper bio_split() error handling. For any error, call raid_end_bio_io() and return. Except for discard, where we end the bio directly. Signed-off-by: John Garry --- drivers/md/raid10.c | 47 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index f3bf1116794a..9c56b27b754a 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1159,6 +1159,7 @@ static void raid10_read_request(struct mddev *mddev, = struct bio *bio, int slot =3D r10_bio->read_slot; struct md_rdev *err_rdev =3D NULL; gfp_t gfp =3D GFP_NOIO; + int error; =20 if (slot >=3D 0 && r10_bio->devs[slot].rdev) { /* @@ -1206,6 +1207,10 @@ static void raid10_read_request(struct mddev *mddev,= struct bio *bio, if (max_sectors < bio_sectors(bio)) { struct bio *split =3D bio_split(bio, max_sectors, gfp, &conf->bio_split); + if (IS_ERR(split)) { + error =3D PTR_ERR(split); + goto err_handle; + } bio_chain(split, bio); allow_barrier(conf); submit_bio_noacct(bio); @@ -1236,6 +1241,12 @@ static void raid10_read_request(struct mddev *mddev,= struct bio *bio, mddev_trace_remap(mddev, read_bio, r10_bio->sector); submit_bio_noacct(read_bio); return; +err_handle: + atomic_dec(&rdev->nr_pending); + + bio->bi_status =3D errno_to_blk_status(error); + set_bit(R10BIO_Uptodate, &r10_bio->state); + raid_end_bio_io(r10_bio); } =20 static void raid10_write_one_disk(struct mddev *mddev, struct r10bio *r10_= bio, @@ -1347,9 +1358,10 @@ static void raid10_write_request(struct mddev *mddev= , struct bio *bio, struct r10bio *r10_bio) { struct r10conf *conf =3D mddev->private; - int i; + int i, k; sector_t sectors; int max_sectors; + int error; =20 if ((mddev_is_clustered(mddev) && md_cluster_ops->area_resyncing(mddev, WRITE, @@ -1482,6 +1494,10 @@ static void raid10_write_request(struct mddev *mddev= , struct bio *bio, if (r10_bio->sectors < bio_sectors(bio)) { struct bio *split =3D bio_split(bio, r10_bio->sectors, GFP_NOIO, &conf->bio_split); + if (IS_ERR(split)) { + error =3D PTR_ERR(split); + goto err_handle; + } bio_chain(split, bio); allow_barrier(conf); submit_bio_noacct(bio); @@ -1503,6 +1519,25 @@ static void raid10_write_request(struct mddev *mddev= , struct bio *bio, raid10_write_one_disk(mddev, r10_bio, bio, true, i); } one_write_done(r10_bio); + return; +err_handle: + for (k =3D 0; k < i; k++) { + struct md_rdev *rdev, *rrdev; + + rdev =3D conf->mirrors[k].rdev; + rrdev =3D conf->mirrors[k].replacement; + + if (rdev) + rdev_dec_pending(conf->mirrors[k].rdev, mddev); + if (rrdev) + rdev_dec_pending(conf->mirrors[k].rdev, mddev); + r10_bio->devs[k].bio =3D NULL; + r10_bio->devs[k].repl_bio =3D NULL; + } + + bio->bi_status =3D errno_to_blk_status(error); + set_bit(R10BIO_Uptodate, &r10_bio->state); + raid_end_bio_io(r10_bio); } =20 static void __make_request(struct mddev *mddev, struct bio *bio, int secto= rs) @@ -1644,6 +1679,11 @@ static int raid10_handle_discard(struct mddev *mddev= , struct bio *bio) if (remainder) { split_size =3D stripe_size - remainder; split =3D bio_split(bio, split_size, GFP_NOIO, &conf->bio_split); + if (IS_ERR(split)) { + bio->bi_status =3D errno_to_blk_status(PTR_ERR(split)); + bio_endio(bio); + return 0; + } bio_chain(split, bio); allow_barrier(conf); /* Resend the fist split part */ @@ -1654,6 +1694,11 @@ static int raid10_handle_discard(struct mddev *mddev= , struct bio *bio) if (remainder) { split_size =3D bio_sectors(bio) - remainder; split =3D bio_split(bio, split_size, GFP_NOIO, &conf->bio_split); + if (IS_ERR(split)) { + bio->bi_status =3D errno_to_blk_status(PTR_ERR(split)); + bio_endio(bio); + return 0; + } bio_chain(split, bio); allow_barrier(conf); /* Resend the second split part */ --=20 2.31.1 From nobody Mon Nov 25 10:57:32 2024 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF17D200BBC; Tue, 29 Oct 2024 09:11:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730193104; cv=none; b=Fv+EYXp48FBnnYdYetNl1ttpY+GhLfti6ygCdY3meeQ3TVrGyYNxD8fGu+sMELeeNIQUkPwrwSPxT5xL7lIV1+QBqMrMB8BCfpnjnjM82qSBdN227hs0aoA5F4rbp2WvojBJj1BvxAOwojI+QIu0u6b54JJ1XqE5MnjrugQ7Aek= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730193104; c=relaxed/simple; bh=SvUjc0ShhUJ8PhVnVn5bxNftQP0fRbqFlsWFRRWwIMc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rUrUvGPaCkAZSaq1y6IX7rgNeNf2JhtdaWUiNBt6We3DvDD0oPhYwqpRWWTkNLWFG7Oc37B1GXNQBsrdt/+mLNNsa24Ys7CPlAhLeWZMeDSY0oUT2kHilbQmeGp7vGW94JMFXr8QjYfVZ+Ch44STZKrt9GTk5RllvMBhOSzN3DI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-539eb97f26aso5319918e87.2; Tue, 29 Oct 2024 02:11:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730193101; x=1730797901; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SHFBQa6cjEimlbCXbA9xxyetkthyL4ca8SFHWzeSkLA=; b=P7T9iXh55ZBwpEyZeqwmPcIpj2xA5ABILTnrfWK+52AGWNPfIXiDByblLVsVhL1twX G+1hv/EztDs7Pknnn3o2qmZeQj3Cch4c4Gnbni9L9eUf/YGIVScn3x4+dVrt0DGGOCrx XjnAWQC05byhsM5g9crgK0BJGowNVfFEL94zVDpwUK0flf6TFhHnzUqPskBzOPpPWMDw EElzV4VmDCv4WXuAuLGPqy1Xp+uo3lcjazJ37indzAXyygVdeXIYiKy4AKiIcJITyHaC i8ITkX9uP2dnDRnzS3RqThS/i5Mn3HSONwD5sa+ucnmLATuPBrmA8NlXsAoU2mUnHVw5 7TYw== X-Forwarded-Encrypted: i=1; AJvYcCVCOqlFwvo+94cWiQr6pn3f6EHAzFhEWFn7wN+NlKqj4yuIHnn+mx/1EzX3qY7raWcTP14V2uVf2DIUtA==@vger.kernel.org, AJvYcCXTCMluGaBRvwnhscXxeYAQGmfQVOnFA4PJs/OGJGp+mmu67pragERiYeqSssq8jorsO6gkAiKrTd2TWg==@vger.kernel.org, AJvYcCXeRGvTK9dtNd7/WO2SZq9yLuNPK1MhVkF7zDquNtgP9cewXHlwcXjnVXtlwViH+bPG+lBKc0olt6Djw8RI@vger.kernel.org X-Gm-Message-State: AOJu0YxK0WdsmW83HaT0dP2W5EA0BgH0AtqvDiMCG9pZ6rqh5p0CYYph hgs74ApkkOtO+K4MznQnMQ8TKEsk6a7eByRp1HaWwQGIOb+4rfwZ X-Google-Smtp-Source: AGHT+IFJTESo4oJeQB4cKVRo8UjWHZscVtmUPs2gtEXYHYwUup2fKpV699zrxFmWr9bDUda49tBLDQ== X-Received: by 2002:a05:6512:3404:b0:53b:27ba:2d11 with SMTP id 2adb3069b0e04-53b348cb2cbmr6032968e87.16.1730193100751; Tue, 29 Oct 2024 02:11:40 -0700 (PDT) Received: from nuc.fritz.box (p200300f6f71fdb00fa633ffffe02074c.dip0.t-ipconnect.de. [2003:f6:f71f:db00:fa63:3fff:fe02:74c]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38058b929a8sm12000095f8f.103.2024.10.29.02.11.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2024 02:11:40 -0700 (PDT) From: Johannes Thumshirn To: John Garry Cc: linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, axboe@kernel.dk, song@kernel.org, yukuai3@huawei.com, hch@lst.de, martin.petersen@oracle.com, hare@suse.de, Johannes Thumshirn Subject: [PATCH] btrfs: handle bio_split() error Date: Tue, 29 Oct 2024 10:11:21 +0100 Message-ID: <20241029091121.16281-1-jth@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241028152730.3377030-1-john.g.garry@oracle.com> References: <20241028152730.3377030-1-john.g.garry@oracle.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Johannes Thumshirn Now that bio_split() can return errors, add error handling for it in btrfs_split_bio() and ultimately btrfs_submit_chunk(). Signed-off-by: Johannes Thumshirn --- John, in case you have to send a v3, can you please include this one in your seri= es? fs/btrfs/bio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index 1f216d07eff6..96cacd5c03a5 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -81,6 +81,9 @@ static struct btrfs_bio *btrfs_split_bio(struct btrfs_fs_= info *fs_info, =20 bio =3D bio_split(&orig_bbio->bio, map_length >> SECTOR_SHIFT, GFP_NOFS, &btrfs_clone_bioset); + if (IS_ERR(bio)) + return ERR_CAST(bio); + bbio =3D btrfs_bio(bio); btrfs_bio_init(bbio, fs_info, NULL, orig_bbio); bbio->inode =3D orig_bbio->inode; @@ -687,6 +690,10 @@ static bool btrfs_submit_chunk(struct btrfs_bio *bbio,= int mirror_num) =20 if (map_length < length) { bbio =3D btrfs_split_bio(fs_info, bbio, map_length); + if (IS_ERR(bbio)) { + ret =3D PTR_ERR(bbio); + goto fail; + } bio =3D &bbio->bio; } =20 --=20 2.43.0