From patchwork Thu Jan 16 17:02:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 858079 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 35D36236EC6; Thu, 16 Jan 2025 17:06:34 +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=1737047196; cv=fail; b=gsLd93ou8/E38g900v0eeOSj6+gYQuEEIKW8D1NwhzHFgbhi1Ah6NBmazm/wjxn+XcwJR3P/QPNqYEo4JvXT9KWN1apGDsmkNgRvde8IhuGvsAkwPuU8XpaX5RbKhMecfhZhcrkAi0ta/zuVh/Zx47IljuZ2dnWE0EEdG/SDg9Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737047196; c=relaxed/simple; bh=Ko68i8boginCWVDWUqGkwr4emKFIyhkPMDh+z7EzAB8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=QYBJEmqPePIbxT5CiRyksXTcR1NkyCeZQ+S1Ck5xk2UPRrfNmhvei3PrdLE/DAN+46UZa91VUsNpwmQBktP0Pe0ccU2p/hchtXEeC3o5mkBs4RaldcJWPxvlS2iqDrwqGMod23JTC4Ix9CPBe9AGPMJkZwJx5ySIO7tXWasXXwQ= 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=iA5SBYHn; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=pMAgtqVI; 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="iA5SBYHn"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="pMAgtqVI" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50GH0j6t012919; Thu, 16 Jan 2025 17:03:40 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=2KwqKYkfrS0/ORpRT2wJhvLt+SQcJditF7aA6k0Mk4U=; b= iA5SBYHnHwc4Ot/PcdkgaVnKIwc6MNOMx1JAUHwQ67MPScm1R4SZWM1+Shf+Vgy2 NiijkSHPU646ZYbSeHENbx/4KkRMlTOHZlHXzpcnvYxVkLtx+uZxyY7Q+iBwuhFJ KNC/hd2NU5Cq7lvH+jMDqDf36jGpdp8Mp5xwy0r9g/c3J9GZn+hTqXzgcCUFTvTV N46gPiGOBUfzRTqheukCXqdE8jJbhXGr+TfnNlPPKdUiL8M3FVhNrQ7Cre08Pfo0 XjSni0Eonoux5sH+zDDSFVxv3SfWl3r1uMw7jzpH80jJV9oHuJVgD3y2ctSQ/nIA bdjRlacPt7f3ul8cBkVOJw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 446912ucqy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 17:03:40 +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 50GH2Opj005236; Thu, 16 Jan 2025 17:03:38 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2043.outbound.protection.outlook.com [104.47.70.43]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4473e57p15-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 17:03:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=J7fOt2c/HBzm8srDydz3vmXkiFmwnr/btp1SQYh9szm+oB6PdFD9IjSOliNCSHCuSQwi/wF5+7Ut5bIX7zdxQwpygD28rLiI8Xrhp9eobW23Dq7zMIML/gU7AfGQyQvPw9xETfW53+kKNPMYY5Y2AUwiiqCs5J4VPay10n633VVhUX2Q6Dl/0+1COeA32KuocCliggH9SF5EPm2vX6c0u1ds/bfMQNn8CWoP2UTpSiBKUS0xW6CPmFxxAO48US5WBdPTNr5TqbpkUGfoY/YCNtANv7+CxphOSk5ZfU4/ha7yDM2TUKwCoHRXR38SWvvrm0HHMic1bgkmwVodWQzAfA== 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=2KwqKYkfrS0/ORpRT2wJhvLt+SQcJditF7aA6k0Mk4U=; b=mz4ULqO8cdWf/TKUswnPBIWFfJbrUYYcG/JQ3IJzcqJRcB3E89FPIPoBu/yDFb1iHmqQwRLRXNTe3fDaaEY2ZFGo5QXFB0RXIFat3OBaCub01wGG1dILjEFIIdXyQVdI8kHK5Jn/SB4y9JNwIACUcu2TcHlkPH4GSx7Ce2LLrpBngitLgGsCHSl0o1IQzIWHpK9xXy0rtaYy7u/M+pRg4Yz4xT+hZsfM3FCQujLrQjAjApFtx4T4rm5t2yt/LTslHU/LQREdoT76whsnsl3Mr+JSs1TKkaP4DQwxLIw1lzylHTiMK/vUhWlN2WqyjHccDorFTyW+9nSlyNxWWgGR2g== 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=2KwqKYkfrS0/ORpRT2wJhvLt+SQcJditF7aA6k0Mk4U=; b=pMAgtqVIRQ8nfGuCo7s8tzG8VEr98GeO02A5bkpgae3oJ2uo2N6fL8tSNvtdx2WivrVAvhNX7pM2Eqq6To9ikioucS+RcCMurQXervWWxVZrz6iI8GgPmO3K5CNVLcvVo8EjqZ7jCbIVlwgb0l5ykSCHRnREUWvZTW6rNC8YT0A= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by PH7PR10MB5829.namprd10.prod.outlook.com (2603:10b6:510:126::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.13; Thu, 16 Jan 2025 17:03:30 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%4]) with mapi id 15.20.8356.010; Thu, 16 Jan 2025 17:03:30 +0000 From: John Garry To: axboe@kernel.dk, agk@redhat.com, mpatocka@redhat.com, hch@lst.de Cc: song@kernel.org, yukuai3@huawei.com, kbusch@kernel.org, sagi@grimberg.me, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, linux-block@vger.kernel.org, dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, John Garry Subject: [PATCH RFC v2 1/8] block: Add common atomic writes enable flag Date: Thu, 16 Jan 2025 17:02:54 +0000 Message-Id: <20250116170301.474130-2-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20250116170301.474130-1-john.g.garry@oracle.com> References: <20250116170301.474130-1-john.g.garry@oracle.com> X-ClientProxiedBy: SJ0PR03CA0283.namprd03.prod.outlook.com (2603:10b6:a03:39e::18) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|PH7PR10MB5829:EE_ X-MS-Office365-Filtering-Correlation-Id: ab96874f-3d65-4fba-0db3-08dd364fb3bb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: Btxe39+OA8EfJp8/LxbamsfK7wLrW24bVmbqoFYt9tNnxaiy3Tz9Q6TqnZv3o1zyO9nxtnopsJPKWnwTzAdlZ656OGbp4SyzGrMt7e5Ipk4+QZFlZPZ8vF3KvnehkZSJtAEMfzKFNkIfntTikO3X3bTEgYS+QYoTJhspLgWGW5wBovwBfYb/UPQ75u6KdDSpYM01Z0n7RwMZq61BUXYUG4E3CZJXnJF9UiOnPjjit2PhzVYqeBVbo2r1Q0bj+JQGwkW6HMyInCwJ/61cs36ezTJWY8jnTSNNKCp8HAWvAQ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8h7r0qAD3h09zzH8aRwfint2xBvveNF 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)(366016)(1800799024)(376014)(7416014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: C3Vu7J/Z4mSF19/G7O/3CS4II5gdKS8teLtBiagoS71f4+8BtP44Ihchs7f5Mb5BLuPzJ9Qtk67wK/ey3iyOPOTFbU5o/mi8+mkGWRQlhp/RrQRZET7fG9br9GGm8JzrOZvBxqOTo4ki3FOEhuHxCuAcCGj6TKJXg4EkMg3sY2zmWUc6oohq9c8elaP5pWOa+R54iUd1obIaye3L4RfkckZy3dH+y2203VBs2If5yL5tB7ofkKOQwnWhk99+UWeUsgPbrW211rZ5ZIqbu6c9ss2PJNbRjjE3yEY1mkdPqnnFHZDB7UCv32Tg+ufzGiuiZ7nTg2Gt/ceF7vnUP0NKDs4PhDx6Q1VPAEMI5qLndIcCdhQROtztT3B7JddoJWS4l/OfZmpPaWmKjww7eAcZghjvvVBVlK8dwMLXfkVJcTG8HbH+PQCP6SqWzO+pm4X+ErbbGz7Im99UT57zy1Wxo3n2D8xwpZGV34mpEGYf9GiP/7IHNE4iJ0IwLabGs6AB75HLyKJnWOjoEGFWQacxNaN08sG0dtBUvWE728vZv6Cz8R80XKJs3rAHN1F9uE8n/RFQO2zag5F8/h60PMVn25oMM9UYrJcRcE8Mz5ki25kJ2AAE7oULa6fRys2PYocbaDBQTu1QIRHrC8tlPX1HEZufF9ryLfAp7apciIsxGDUaClDiJFRj0EbsPLCvNKYV5Y0B1oql3fFJnnqlZ463Oqqwgiim7Gb9jCOcVsqN4oCcsWsOOA2ocVLsTJYiLEBr+fdpx7iYPZGTe9lWy2Ltr/hdJSZGdYsKNV6EKFk1Vr5Lyr6mBp4tH0C0fmcgivAzw3/JvCdwP3f9+f19AAbgVu5snLiP5kp/hEuq9eUBnBa4bcFunVfnUPAflgrWKhQDOKRt/1CTA/QrFDcCFAZriisavf5+hHxpmSuL+LOBitUdwHAqSD1mdFB1TrHxHJxJ0NVyIy99lg5YvsTpjovEmHuBkDZR3WOqf+UdIX5nIVsH437moUpp8XA4CNI/v0NGZHL3VHXsHXBeetT8LfJe02T83XuK56OFgMdyyooCCK2LqvADkVNPtsYIHpGvVtLjopTumgLVVER7FudaZAsHUexhdL7Ql1XGlRfbGDIE2KxpIY221odMNDg0CSYgs+aYqypOAi58cwRpADnH8tNz8GrRvMTyj/6y/2dwoIjIDvR3ag2titYmaAWlSngOe+BgstLPn/dFKtwdFmvTHkfZTJHoLzTctziz64OZSzPKo1k0GSVm1ESn1Ar7tMNonyoOS7UmjUdnARfPOqKfphOSUTLtNiNhcqZL+2jcuuwAy08VMgSB8cqjMfxhaTidhp42Sq+mrOHlkuAYZ7P0y3GFzMqW6/Z7op+JOqBr1h++V3DNYAmODF6SRZjkO4BGnl3xgygiG17xzcy9PdURPbcQuZblER7qnEb+WLXgPi/jFzBqDdJV9irA5sTOf0P5v6B+iRbli2Q0Q7t4QQAglu7QfZLMmYRKweH+b2GPNIM069TX3i4AdMx5kFU8kwO86PpvzlDmMdcEzLwKILiIyUwFrYTpqdKSN3Xx7R5NOZ+pg49o+bFP3DxXffPs2LLJYj6vXDLFo6TCK93fi/BWZRmbPQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 8hNCL9JYo3OXDm35wEk1QGKFYmlDHeTf+V9GKIrR1fDtwphjdIwHsmImCHlfm6zN4jIDxFzzHbiG/oDiZwE1o+mJoGKzRN8R8I+WFJsd4vswOwAzLeTsbHaD74uy4oCTSDmIb72nAIWn56wQoKPxCTy4HfS/esvC8KBbh7ALSjuFMsQ5SzIbcdFygiApChX3fnR1TTNwSUYtQ+3bg1qDB4gxwIdSAC8zAHZBpiwd4bEuiW7ZWX5RzjiHuVn8FmZ/rPdGnOBfC9X2sgyIrE5IsU1dEfTWACXMtkKnqZpxfuYmnF8tgODJXjnf8pz1V45i/kos7tuXokAXvdkVw4Ixnd24whMTDuQVMh+6VLrE4KymSF6CPqtYuW/fvFX+krewS7MrWI0k/NlA3X7qs+/nEpBpDzudpyq2PoX9Am8Yhw6S6jmiBvGRcTB3JrepPTsfhUUb+fqdREZx8SZFX3PufL380d+UmGmjEIVXfIr+joTcYEzzy/42fyxypyV7bztyyHNfgS4FnB5rQQ5OC9EI1d1beInBDsn41SHF8C6VigHx+2VHDSR4oEqMj1lqjLf9QnmW+EnE4DWzoTrFpnIuJFWKwCafIYICyxcJUerzbX8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab96874f-3d65-4fba-0db3-08dd364fb3bb X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2025 17:03:30.4034 (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: XYxyNHzs4ECICRSKEESeyiSDX+KW5T6a2DaJ7YjFkjwA1m73KY/cd2JtLGxC22wO0Q78znTu9MA04O//2iwaNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB5829 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-16_07,2025-01-16_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501160128 X-Proofpoint-ORIG-GUID: -PqexSUVRgudlNviQOJl-476WpvZTubi X-Proofpoint-GUID: -PqexSUVRgudlNviQOJl-476WpvZTubi Currently only stacked devices need to explicitly enable atomic writes by setting BLK_FEAT_ATOMIC_WRITES_STACKED flag. This does not work well for device mapper stacking devices, as there many sets of limits are stacked and what is the 'bottom' and 'top' device can swapped. This means that BLK_FEAT_ATOMIC_WRITES_STACKED needs to be set for many queue limits, which is messy. Generalize enabling atomic writes enabling by ensuring that all devices must explicitly set a flag - that includes NVMe, SCSI sd, and md raid. Signed-off-by: John Garry --- block/blk-settings.c | 6 ++++-- drivers/md/raid0.c | 2 +- drivers/md/raid1.c | 2 +- drivers/md/raid10.c | 2 +- drivers/nvme/host/core.c | 1 + drivers/scsi/sd.c | 1 + include/linux/blkdev.h | 4 ++-- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/block/blk-settings.c b/block/blk-settings.c index c8368ee8de2e..db12396ff5c7 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -175,6 +175,9 @@ static void blk_validate_atomic_write_limits(struct queue_limits *lim) { unsigned int boundary_sectors; + if (!(lim->features & BLK_FEAT_ATOMIC_WRITES)) + goto unsupported; + if (!lim->atomic_write_hw_max) goto unsupported; @@ -611,7 +614,7 @@ static bool blk_stack_atomic_writes_head(struct queue_limits *t, static void blk_stack_atomic_writes_limits(struct queue_limits *t, struct queue_limits *b, sector_t start) { - if (!(t->features & BLK_FEAT_ATOMIC_WRITES_STACKED)) + if (!(b->features & BLK_FEAT_ATOMIC_WRITES)) goto unsupported; if (!b->atomic_write_hw_unit_min) @@ -639,7 +642,6 @@ static void blk_stack_atomic_writes_limits(struct queue_limits *t, t->atomic_write_hw_unit_max = 0; t->atomic_write_hw_unit_min = 0; t->atomic_write_hw_boundary = 0; - t->features &= ~BLK_FEAT_ATOMIC_WRITES_STACKED; } /** diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 7049ec7fb8eb..8fc9339b00c7 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -384,7 +384,7 @@ static int raid0_set_limits(struct mddev *mddev) lim.max_write_zeroes_sectors = mddev->chunk_sectors; lim.io_min = mddev->chunk_sectors << 9; lim.io_opt = lim.io_min * mddev->raid_disks; - lim.features |= BLK_FEAT_ATOMIC_WRITES_STACKED; + lim.features |= BLK_FEAT_ATOMIC_WRITES; err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY); if (err) { queue_limits_cancel_update(mddev->gendisk->queue); diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index a5cd6522fc2d..9d57a88dbd26 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -3217,7 +3217,7 @@ static int raid1_set_limits(struct mddev *mddev) md_init_stacking_limits(&lim); lim.max_write_zeroes_sectors = 0; - lim.features |= BLK_FEAT_ATOMIC_WRITES_STACKED; + lim.features |= BLK_FEAT_ATOMIC_WRITES; err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY); if (err) { queue_limits_cancel_update(mddev->gendisk->queue); diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index e1e6cd7fb125..efe93b979167 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -4018,7 +4018,7 @@ static int raid10_set_queue_limits(struct mddev *mddev) lim.max_write_zeroes_sectors = 0; lim.io_min = mddev->chunk_sectors << 9; lim.io_opt = lim.io_min * raid10_nr_stripes(conf); - lim.features |= BLK_FEAT_ATOMIC_WRITES_STACKED; + lim.features |= BLK_FEAT_ATOMIC_WRITES; err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY); if (err) { queue_limits_cancel_update(mddev->gendisk->queue); diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 9e7f1bb81973..cebaacead727 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2002,6 +2002,7 @@ static void nvme_update_atomic_write_disk_info(struct nvme_ns *ns, lim->atomic_write_hw_boundary = boundary; lim->atomic_write_hw_unit_min = bs; lim->atomic_write_hw_unit_max = rounddown_pow_of_two(atomic_bs); + lim->features |= BLK_FEAT_ATOMIC_WRITES; } static u32 nvme_max_drv_segments(struct nvme_ctrl *ctrl) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 3d42480deb3f..7900817db8cc 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -992,6 +992,7 @@ static void sd_config_atomic(struct scsi_disk *sdkp, struct queue_limits *lim) lim->atomic_write_hw_boundary = lim->atomic_write_hw_max * 4; lim->atomic_write_hw_unit_min = unit_min * logical_block_size; lim->atomic_write_hw_unit_max = unit_max * logical_block_size; + lim->features |= BLK_FEAT_ATOMIC_WRITES; } static blk_status_t sd_setup_write_same16_cmnd(struct scsi_cmnd *cmd, diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 7ac153e4423a..76f0a4e7c2e5 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -331,8 +331,8 @@ typedef unsigned int __bitwise blk_features_t; #define BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE \ ((__force blk_features_t)(1u << 15)) -/* stacked device can/does support atomic writes */ -#define BLK_FEAT_ATOMIC_WRITES_STACKED \ +/* atomic writes enabled */ +#define BLK_FEAT_ATOMIC_WRITES \ ((__force blk_features_t)(1u << 16)) /* From patchwork Thu Jan 16 17:02:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 858080 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 80020154BE5; Thu, 16 Jan 2025 17:06:14 +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=1737047175; cv=fail; b=DVQPqfuW8y4fu9+CcVdfICK2C0vB9QiWdFZIz8phi2/oRnShXKaMy3+xkWNc7MId7vxMEzOrPreIo2tVTPaNpHXZNWCF5rCW/KGCUosloQ6Joj2I6Zf7lLN2C3lX7rfAWRlrJI8wqDUF7yLXo0CgSs4rAfxvgnSUFc1mXlogd1A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737047175; c=relaxed/simple; bh=6Z3AxKRbAfACFFh2rOxyTgKgRtH8a4uMMYeVpLWit28=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=oBdOF3pp25FGl/19EKOsIwIhJzHs/HTlq/kZuwhYOSmoqofQ7y8anx24Ht17XNG2oIHIpZSPY+AFHJCkVQQjShu2QzaNGUGCyr5gCQN03Iz0SH3v8KZkt8jCh3Hex7+GDbBLn6vZWgTpZVPBPmNLU+wJa+4EWW747UUtT+DZufY= 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=Whe1NlCP; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=KCnu4VsI; 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="Whe1NlCP"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="KCnu4VsI" 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 50GH0mpU020191; Thu, 16 Jan 2025 17:03:38 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=/234QoQX+0h8OacLimOhvyViffW99Y5FKI8yj0DyY/s=; b= Whe1NlCP8Z6ZU/KMEmT+iZzpN3bXLnxHaphL12XXrqeVhFFKvADjSVIMk9uqmdk/ +sG2eFN3JTqX905DVGxlOT83ZClfkJ9GpylAzMIyd7oU8JQqGMePYuvaGwHsi2h/ TQ3IpBfq1m72DCI+kJYC+r72LFxu51obQNBlqWphNJyMExOdG+BNb872CKPhnfKf wAsyURjp/Wf3nJxfxefg5KwkJmQ3VlreECU0zqqeYCijrVKUgy9+IDVHHMobRisM 5lrc4Q+9SGZSBfsm2/YIIB3ocoa7rZ5EG/FS/EzgxKbEVhohIi04hOrIRUAGIHBA IfONxzV2QlxT0gem6DBY9w== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 446wtp919x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 17:03:38 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 50GFVoM7020422; Thu, 16 Jan 2025 17:03:36 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2172.outbound.protection.outlook.com [104.47.58.172]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 443f3hdeux-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 17:03:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bhN6/v+lcqb4GLVejA+WMHQgWsRKauYTlw+GSqnsgVyS5/jEtusMf6lQza9kxVlPQlKn6Hc65oYFqRtZoY2JmXEon7XD597LdUaTTq5xd1ageWk2r8PdtjCCr8SzCpaSaQIKpInARdvu030s4NXLFFgqoWHALb9f8qs0MFGQfWb8LXXcPQjdlWLTT8Ujv07pLE3C5PA4kStN7RFVaWnGMAnYCYSdaNgr3vVewix93z5ZvvNiU1VDDEoLp7F6tCCAF44QtMCwcQXaz4l9rPHOyEy/xxxkE6G8EXnklbl0eK1sQ1TWvWUcMIUVBG9rA9+60XDUz3gffIfTWcT1wpo3sw== 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=/234QoQX+0h8OacLimOhvyViffW99Y5FKI8yj0DyY/s=; b=lVYRS1nW5AmLsvyMTI95Su+ScZhMDP2ts/wW6AKBHV4q1Be8wJcV5diSa8617M0LIWWR3M5F7EIGSZphHqNCXJFkj6E7w/InTHt9GZmUzSXH+rZydm+tGQHG77tO24qacQcIToB1JqoCiA/X9/UOyLkaqd5uDG3dPWHqa053hjYltBlCCuNOR2RfZaGwzxtoKlfHTlOdV5PosbQttxeQm5QVP9gkS36w8Oe0nLX15awTqCCc/Uqbrnl+D/seI5PG/mfMlTJQAp9t7DKIlC/T2e2pEfZ4JBcrPern7H4ZjlloR1iqgVcPdpIE1TtpJtw8XA5AtJqAc6aZOXnmvA1+Ng== 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=/234QoQX+0h8OacLimOhvyViffW99Y5FKI8yj0DyY/s=; b=KCnu4VsIYLlpg5a/tYlO5o/0keD7tJD/UVFQ7DJ/rtHRuF427JEkYVZgn81jLHRRhZRw9S9BdnWlBtL641kB1y/EX1OaZxrJj+4u8iHdrXsxqwzTF7TiRO7CEU03ceMoLW753a9OdkeSNjjQAuQ4uM/DyeR72mq1Haz5S8xznuY= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by BL3PR10MB6235.namprd10.prod.outlook.com (2603:10b6:208:38e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.13; Thu, 16 Jan 2025 17:03:32 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%4]) with mapi id 15.20.8356.010; Thu, 16 Jan 2025 17:03:32 +0000 From: John Garry To: axboe@kernel.dk, agk@redhat.com, mpatocka@redhat.com, hch@lst.de Cc: song@kernel.org, yukuai3@huawei.com, kbusch@kernel.org, sagi@grimberg.me, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, linux-block@vger.kernel.org, dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, John Garry Subject: [PATCH RFC v2 2/8] block: Don't trim an atomic write Date: Thu, 16 Jan 2025 17:02:55 +0000 Message-Id: <20250116170301.474130-3-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20250116170301.474130-1-john.g.garry@oracle.com> References: <20250116170301.474130-1-john.g.garry@oracle.com> X-ClientProxiedBy: BY3PR03CA0001.namprd03.prod.outlook.com (2603:10b6:a03:39a::6) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|BL3PR10MB6235:EE_ X-MS-Office365-Filtering-Correlation-Id: 3055ccd5-0061-4d67-d8ca-08dd364fb4fe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|376014; X-Microsoft-Antispam-Message-Info: MkL57MpQxDHt2lgycTBr5bYZgeokMmpsZIJKvrNjXLhpnUr4LVD4+vhf5gLsg7eYdkSFTBqCEPWDiuYjm+WyViGA/PmNJq3FvK0T4i6CKoXz4IDba6gnonNaiZr4Z+r9hBZ50XNo9ocA2jtGCLzkNmrddy6IcaYj0S3+LgPOnAGznBIs90auPOZ0LXt3RujQH9cvByHJIoP3R/uHZlByMpsMIylOLwikgRcwIiQd0yucmSCeQYsd0uZ6arNETpJFDG7wdYseOBoVbaC9PN+KOQetNnt7s7QE+Sxt/YJAy4WakygU4vhBSxC1nc1p9i+cueNIsqIe/CJaEfrAFQLBwQQujsM1lnWcWTviPIluAcDTGEu9xC8tGUTPf1RH+FRxeudWYRv5mE90ml1QcDMir5OAAek5nujq7WetGFrwdxo/XWTSY6EzF1skN8hxP7+IYfbkTKfWSnd1GS4A2OLs2F9oXsJQTnepbt1+3AbPHYgV3lbV922eUylBKdvtgA8bK+erGnTdHeu1mBF50FCXU+923rn3ZDJ3N1CCMFUWotk8FFH7OWZ8d7BCn2arNlv0d4TNGitsRHlcywiJHp/MdV8NKq/p3gK7qCOAhm7fbto3mWKoxw8mNniyS/+yRj3ygRnlbUHs1S8RMpSCeF7KkM3Y/T0Kwylbu+nrhScBm5Y5SLOzkGtSIqYZw1UmhJwhzQ6vLeJIVoPg+MfGLfjV5SaRNLjjeW/FYEHKp5h8gL4QvfWVBmf9fsrYGH+zSzQO3tkJRJXV26NRP33PMEsxq8PpZJKj0K0XEDr4CQo+PtB94Apy7nmKJ+S0Ukog7mG/pEe07ow79aAozndUJ8kH7VaAmSGS25nCDrKCUGgm3UgrbUKEHSRFvvHHntGEDaqMvzSgRy7fKTF0PNIW5TexmjCl6PxeroOVSu7Uj09RIESATgDNZ2rJTZ0yU29s0OZwVlBqj5G3OVKp7UoB94KdWQ5JfFslHPxaMw+xmjHcI+x5J6Y+uWoeGuop5k7C26Gsygbyat+3RIOX4lyWTLLzmCaoxwJjeR7D81UGqhBkmmsumYXwMRO0beiGjI6XB2GoKjJcIxgISuTUC5iYlBE2/uG+r/h2w+weEAhVC4UesslAYwqOaJ5CNWn6IYqKTPF9/D63KVgc1vR8FFmdzkUzB4BFOOhdTI/KdxixVVTuWQi/ETnSoQSd5Gh4JUVoGuJVIr7/zz1+I5ICku81pgDKQAvwZBmttjI6dM26NqwSUVqjC62afiANzPVwDZtYc01UVZTj+mFK5Sai7OiV2dbVcpPOZg2bcEVATGiWLv4pFjvrQUyZG9ZiV0VkSsGIEWH69/1epk72VLwGXOAdTxEY1EpJJeK2VwOv/npWlSnkK5Q0GTWnqGqqCWmWmQlloe5N 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)(7416014)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mlRhrhWcwbD7FIIoey/9G0uHeJ7h8CzpccsHrNY/JjVGx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jCj7baNDBpHKaD+7di1o9yaGW2YG4OEXkxr67nnaNK4JMhcXfxWNgvJMjwkTGYcqIZMGM8qTsjsL53IruqTMbgow2g3rQeAWdBfkSdCjT978ylVQ8UMAGLkgzEU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3055ccd5-0061-4d67-d8ca-08dd364fb4fe X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2025 17:03:32.5033 (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: Xng2tnPhQ/Mps4K0/9vRAgovjejDhArsxwcCeam0jo5qTc3Ehxdn/iZytcFJTD8Dvg9pmBPRpATioz8hDRjEow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR10MB6235 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-16_07,2025-01-16_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 adultscore=0 spamscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501160128 X-Proofpoint-ORIG-GUID: gxOHmD8XYKtsIGloMyPj7tyfvK4N2vx3 X-Proofpoint-GUID: gxOHmD8XYKtsIGloMyPj7tyfvK4N2vx3 This is disallowed. This check will now be relevant since the device mapper personalities will start to support atomic writes, and they use this function. Signed-off-by: John Garry --- block/bio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/bio.c b/block/bio.c index 4e1a27d312c9..f0c416e5931d 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1610,6 +1610,10 @@ EXPORT_SYMBOL(bio_split); */ void bio_trim(struct bio *bio, sector_t offset, sector_t size) { + /* We should never trim an atomic write */ + if (WARN_ON_ONCE(bio->bi_opf & REQ_ATOMIC && size)) + return; + if (WARN_ON_ONCE(offset > BIO_MAX_SECTORS || size > BIO_MAX_SECTORS || offset + size > bio_sectors(bio))) return; From patchwork Thu Jan 16 17:02:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 858081 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 376C015442C; Thu, 16 Jan 2025 17:04:11 +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=1737047052; cv=fail; b=nyoqMmoNA0scERa1a1J1E72/JKhkASdyWOrxElJg5ajoRG9y/8USdHaT8+lAMVBmsWnieyt3VeHGq9lK6qZK99eh7f3V5II+7qXfDMSmVrdjPe22R28yU2hz1jFRgJBvJ0WQQrLWvrWAnZpY71jNOLEIoj8iJvPbi88UMimNkKg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737047052; c=relaxed/simple; bh=1FgAzCEP0XrxY6Tny9ZeneF6mhrOIy1vc+XQ0Ol3+as=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=VBMkCKIChHQPJNIDB8cc/U/cf3QjVYhnMe3TVvigufk7mDbdiu4Y0C41CKN0XhUf8TLHgydwDXldQE+b6J0B8cove+v6GNmg5i9VTi5ssY7Dpd+aVRDJhL+WZPxtTgxrznTjY2MgR5Eob4WroZrQglWRkGXr2zMdplhk/BuDSIw= 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=Dwx4emOy; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=piL6J2qn; 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="Dwx4emOy"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="piL6J2qn" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50GH0j6s012919; Thu, 16 Jan 2025 17:03:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=DxjzV7fvvvrL/a7Lig5VeXZqa/WSR4USHvAx04Sf68w=; b= Dwx4emOy34mKRcxtPZYJeVKBaAMzIBserCzvwCE9Nj5Z6KrCUA3bEyGi89cfFojW nIcyVhPU947QPIGRY8g5NES/RgYKCIUKSK8FkTrdFK6einFv9lvqcz3wmkdqD3VW VwZPyNUnXAGg77lr7771tJw5H2GcUak0vsCRb69TcpMMR7pLDVfKr9SvOzyvg/h7 EhSTmtCpJnZxSyimhr7gRGtVUNdpAywGHmbV+zRcMthM32AnPe5ZGzP3KSYvpazr b6Qd0p/RKi0QtSXn7aYlxerrcLRPV+3Nn8Lz+y4QHZlxJqONV1wiFxSYqonkUKfA EqbCz5LeWoswHpWnYV52qw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 446912ucqv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 17:03:39 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 50GFVoM9020422; Thu, 16 Jan 2025 17:03:37 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2172.outbound.protection.outlook.com [104.47.58.172]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 443f3hdeux-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 17:03:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qJH+VGBk1+PzXr+K/lFaO+aknFWhRVNxepMc/bB9nHWOW9kI5T4w9lJwRT3EOX0FZiE+BEAT3Na2sG0cv0Uq5KlwaTLrbd7GDrlNB8hNENeCTFbBHk986kCMutgGco6Htn7k50je4Jzhd2xij/PqDNaW/al/zbH/FMq7/HYgrQAOTTl9kkOU6kwqsIqtbpCr1DeKkHoWz+WHhozyxtqCzmsJfoWcBZZfjfZxGnTh1/cvSvVHQAolx2RAhZ3V3A5VerB57x2gOthPn+GBn5VSvzNe9zCq3u4x8bVRCXRF3K4o1l9cIOLEiJquLvFaZo2cKGGk43DZrmLmuOmD7hS+gQ== 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=DxjzV7fvvvrL/a7Lig5VeXZqa/WSR4USHvAx04Sf68w=; b=R3N0ArirB/HTT92QUq/CfsL2qgcQIla4A3tT8FO7nfdKKJaA7717a1q3BZuUoNqNSY5b0Pc3RdsS9CN+Toxk6JVtxpi6PT7LN2XaH0vP5unrQF1JBbG8cFR63Y6NCgmaKoCmRe0o0xFT2lJvKtnZ9YXhfEwpMxciJd52ggqcvaIYB1c3sxMKQ1OEG0v2LQzeILhkUOQr7eYLHfKC1odnfy51OyOTrch5SNuE35AtDBeiok3gTFHypiU8L5HU2Nz5hDWAZPXHNZ1quzwnsQZtK3VvGwQKgEq2qslmVvlwdZNocrhZQFRFf5R5GPeXyt5mVtLluJ4r/AL+5+8So/iq4A== 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=DxjzV7fvvvrL/a7Lig5VeXZqa/WSR4USHvAx04Sf68w=; b=piL6J2qn72ACXhhZC6DYoIQAFp166Mzweza47VJNdndrQPRYFmUOUMaPOvjk0v7Q9iThw4pyKSOhNY3BCm0vs8DIzijgutWu76NAeRwF80VUA4CBWtfy4jIzQ0E0g7z0KbjcMB3jdHMDcvO/zg1comCTMDUsY1bEmm+NajeFQDw= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by BL3PR10MB6235.namprd10.prod.outlook.com (2603:10b6:208:38e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.13; Thu, 16 Jan 2025 17:03:36 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%4]) with mapi id 15.20.8356.010; Thu, 16 Jan 2025 17:03:36 +0000 From: John Garry To: axboe@kernel.dk, agk@redhat.com, mpatocka@redhat.com, hch@lst.de Cc: song@kernel.org, yukuai3@huawei.com, kbusch@kernel.org, sagi@grimberg.me, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, linux-block@vger.kernel.org, dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, John Garry Subject: [PATCH RFC v2 4/8] dm: Ensure cloned bio is same length for atomic write Date: Thu, 16 Jan 2025 17:02:57 +0000 Message-Id: <20250116170301.474130-5-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20250116170301.474130-1-john.g.garry@oracle.com> References: <20250116170301.474130-1-john.g.garry@oracle.com> X-ClientProxiedBy: SJ0PR05CA0119.namprd05.prod.outlook.com (2603:10b6:a03:334::34) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|BL3PR10MB6235:EE_ X-MS-Office365-Filtering-Correlation-Id: 7135d3fe-e637-4975-41b7-08dd364fb740 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|376014; X-Microsoft-Antispam-Message-Info: E8XgZ6eaDuEtTYXbXBwRdkLDSHXVe9aFjPoGt1ZBywW5BF+WK97KLaE/b19Kdwc7lcUL3h/seyS3TxkGQOzozd4T3IN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rnEo7/ymzfDREltXmziW4hhELLErRW8pRnRQv5dM1Lukak3xrojS+hEq+o5hmeoBnxdNg4V/LCLAPk3/K8KmJYIBcKZFddNrn4KWNLEytfZGjN9s2m6bNT7sRmnu2iObR9KafXitQwY7VjzH/2EXnHGISKNXBz2ZQgovgPamU/ehjRW5a0BfejyvCBTDMXsQCsGr+Nc6J92KwRtDfP7b4weudUybL1oYTSvyxfAWZWd/UsVuAGY 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)(7416014)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E/8GxGvuKGcNf1ncbvtjCv1J7zrRqnVmyIfyQQ7v6gbo2OxjpVO87iK5JYeKmUE/6ALGBgfUG2dVBYkf4y5/sRKhglwPBV0cnRABV3xe+FJ335iCj6/lpFzLySXSwzqeWgWwbmEsXTGOZwF7WkeFaXZybhd5LJwqjBsyTWbSoCgh7DwHTg72HY9YdTf4VUBK6rrrHScuuVWeqDsdzIgf1wC/uh+FghJrNtvWvFDz3bEudbjyq7ICUddyLuu1E57ctR8Tv2pyqzxd2dlSeuz4UNZetRSZtIfDQcMIpukAAABaLwQdY9MlvbHA6RYvv4VXeC06zPA1lhBxXch6VmInGK7eLZFMhhPV3xq4UojvRuL9QAp1HNiADipGBZHnf276w9JLWPKbsH9prlRP2V6ROXUDvBmHyB3FTBphaLKXEuj7dN9iz6LfGqSi6MOXr3i+ZLZ7LL4jppQ/UUxG8pl8R81lrM8cedGwTcOvs2VkmtYXJ7r7W19ixW9eh79FJJanLQXCLVBj2xI2O1bhRwpKIhP2J50fU67RHwjp8K+XCNrI6GWScYbgohm7eNwu6HVn+z9adFJd4NgLM+BQDgVn452xJAq0I6Q8NRfywV3q+YpnYogVQc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op-MessageData-0: DNCtwcblGkkROJ9g5kIFL0j7+aMDS6jalGFxrckdjU762ARUGXfSfAN3lJekcVb9r47nc0eYaiivtdJuAYrJoL4qPg3RTli0NVnWjIWLJT9lhfbUVvxn6xp/21quJIag05+/q6aBcPczGH+Y07sSK8FIPcha6ylORDZkQF7PVslWa6ohPYjeeMSIiuwHg1HgFsMHxMnd3fZ75rhnmujerf9lRNHKFPHAeYKT1ImjtENA1EBG1kwol+AA7EDATYedIHSXTWI4Oyg0dQJKxJI75CawBRwFdMvZtsE96T/Q3H4apVar1UJFL/EmeNC2zrFBIOnY083M2LrsWsnjJbGbLTkc8SgiFmBp8G6BMREVv6l8Dp1132nIPQ86tcyCN0KI4Jy6GM4Ydec4XVnEWmeN1RpVcCFSMi4kbOpQLnzSjmK5eyHquyR7tsaVzdjdfld/BTdywDNwRVQktrfUiKOXK6QcFMTJUB0FSZrogyFlKHFLPLn95HmRtZYK+svXIqITxZDB0qJ7qGGQzXfppJKkqqJA3reUMRNF5eACZ53x3ioa5vc14y0mhd9/5pObM7WlvInrftpYRCNxpzHvWzmjSoV2rxLpEbN6/Jc05ZqlZao= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7135d3fe-e637-4975-41b7-08dd364fb740 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2025 17:03:36.2485 (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: HxboHjyanZigbwoeAEc+eIN8RaMFA6yfkMyZ8ME5k9ZudAsUaCnwJHV10JD/vPz4LyN2zejXhkcobpcv9t3C0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR10MB6235 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-16_07,2025-01-16_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 adultscore=0 spamscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501160128 X-Proofpoint-ORIG-GUID: l6okdEzKriNxqvURF1F-2vP1ZEGv3GoM X-Proofpoint-GUID: l6okdEzKriNxqvURF1F-2vP1ZEGv3GoM For an atomic write, a cloned bio must be same length as the original bio, i.e. no splitting. Error in case it is not. Per-dm device queue limits should be setup to ensure that this does not happen, but error this case as an insurance policy. Signed-off-by: John Garry --- drivers/md/dm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 12ecf07a3841..e26c73fb365a 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1746,6 +1746,9 @@ static blk_status_t __split_and_process_bio(struct clone_info *ci) ci->submit_as_polled = !!(ci->bio->bi_opf & REQ_POLLED); len = min_t(sector_t, max_io_len(ti, ci->sector), ci->sector_count); + if (ci->bio->bi_opf & REQ_ATOMIC && len != ci->sector_count) + return BLK_STS_IOERR; + setup_split_accounting(ci, len); if (unlikely(ci->bio->bi_opf & REQ_NOWAIT)) { From patchwork Thu Jan 16 17:02:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 858083 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 C3511154BE5; Thu, 16 Jan 2025 17:04:09 +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=1737047051; cv=fail; b=mNT7Bg23xVOy27bsp21NlaSFV63VZsPfamJ1P3Jg6kke0e21TU1aK5kN5sMk6PApK+67+YYHKZvQDlqrAnlXrRkN1leZstf3fi+eCPfr9ujk2k00e25tM3y2sYQQJitgO8AJ4xT/g3clTpytomTt/lC+KgTZZQqSVl6XwSSeAzA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737047051; c=relaxed/simple; bh=F+RP7B5Bw991OHHY+NwYg1gQU/8Z6WhhMC/WV0c1dmw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=r/BOS17m0RsnYW9BahTyZTII3hheZ3FHNruI2kr7qYgbw/nmfMMBncuZIlBqNqkSkOru/v9hEqSp9rWbPR8WUzBPz0QtJIB7pDEOCtkV+3YDHBg8tijwpRPktb2eShuRC1pMG6NdzmLVLsbh4wb7mfYP+5ZfJxQ+UY5eq5mNd40= 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=SW9fa21I; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=XuuuUisR; 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="SW9fa21I"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="XuuuUisR" Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50GH0isp019982; Thu, 16 Jan 2025 17:03:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=9RvRaCj1qXoc71O+4ar8RblUY1mnlIDr1xYBjAFSGms=; b= SW9fa21IGZP5m57CVNzei3ZrXzoYomIvj7zgDpXqHToD/0hm1FKdfGpaXEc15+d4 4yaXux+acwIE5/gd/4RgEDenRX7Nnl98fSsYtwU0dcqQ3i/JSyDcFsz+FL0bfNqH s4812m9aXsoT/1J7txUt4bDziNJma7YkDcCLzGKLx3lPMQhlCg8B0evb4Uf3JkEn 4AVe4gW7woVS4ocumhXP8TCdDazSvM2H1HP8pZZ/b+VdvKP+4kucVPWFqNv8Ddr6 QNVwryTWYvtgzVy/p2jtrrl+ZGtmO+PTPSA4b+FwQGN0sDZRtgXx/TKsyf0uKyhh vy3XsXLt+anSVXOL7i1+XQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 443fjatpr5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 17:03:41 +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 50GFUNMp005208; Thu, 16 Jan 2025 17:03:40 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2044.outbound.protection.outlook.com [104.47.70.44]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4473e57p44-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 17:03:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LjmVdmqyC0FLVOeXp94R9vF80T/TtECw5Mv3P/DQO8rqUxBmj6dWZOOyxPhapeN+4lLNrQZqIbOuW5pinD3zr9uizKtekfl4skgHFZf+l+YlyA2/hXFDqnH+0wENHDYbrbrsAys1RokXIwzETEbjkXu0oY3sceWVCjP35SrBoiw6jCNlnmq1PZq0/CMT2ps1Xp+dImEPHOiS4qwTgT9eGfroHxB8dQBBP9vFPuH3lDyQsVJZosUNFKv0IT4680PI+QGbVMBmvRae+eU1ko+5bKsCSsiQU1BVxhooLH4q1ys2Bt97fYURtI0MV6+apYzaNcIz9qzl3Wk8+qRYxDE96w== 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=9RvRaCj1qXoc71O+4ar8RblUY1mnlIDr1xYBjAFSGms=; b=IoeZxRjg823sAu42rSqnsMY8jdSS93jJKdukG67jyCp7ouEZ7jtQLd1mN/FfODSS6EVEzt+uZlXqiKK/JSnf567uyiThVpAkR7YBwujQ/M/Oqrgf2NsyBLAV67Znu5XkCz5ahTQkv4mwHuao4duuakkKc/ggWg062oSE09GiSMS8r5GZcRrz2ENRhA70VWyuanUN9v5Aaaili/8UTIMoRw5CqVQuyn0McbUURA6d/vgaHQ/iNQ3/+UBgs40F+ekoz9RH8KphxBF+G1TXPFhyOV3NRU65a8WtXJFbanTPqT6IGSS29ujoiiX3I0XvHf8vczMW9i1b55mmXDxcGCK3ag== 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=9RvRaCj1qXoc71O+4ar8RblUY1mnlIDr1xYBjAFSGms=; b=XuuuUisRTFzEuHn+KZ5OHa9Cucb4L1lGGtk5dPJgzR3LgN7DSYPv4TVdLVTkfiiMaz72T4O3hRfUuRmErum+e5YjNuVFDOUj/Jfzf0rPybQTd3DxL2SpuEOSNeTkSZ/67vY3SjK5ZhC+ZjECSeDhuAEMXWz0Vo+vzFcMdnhPAIY= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by PH7PR10MB5829.namprd10.prod.outlook.com (2603:10b6:510:126::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.13; Thu, 16 Jan 2025 17:03:38 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%4]) with mapi id 15.20.8356.010; Thu, 16 Jan 2025 17:03:38 +0000 From: John Garry To: axboe@kernel.dk, agk@redhat.com, mpatocka@redhat.com, hch@lst.de Cc: song@kernel.org, yukuai3@huawei.com, kbusch@kernel.org, sagi@grimberg.me, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, linux-block@vger.kernel.org, dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, John Garry Subject: [PATCH RFC v2 5/8] dm-linear: Enable atomic writes Date: Thu, 16 Jan 2025 17:02:58 +0000 Message-Id: <20250116170301.474130-6-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20250116170301.474130-1-john.g.garry@oracle.com> References: <20250116170301.474130-1-john.g.garry@oracle.com> X-ClientProxiedBy: SJ0PR03CA0140.namprd03.prod.outlook.com (2603:10b6:a03:33c::25) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|PH7PR10MB5829:EE_ X-MS-Office365-Filtering-Correlation-Id: a51d56bc-07c2-4a8a-cc47-08dd364fb87b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: SqT7LJO7WY4ynliFEkmjUreO74dI8PimXBRAGFMFqsT+w+HtuInCyKInnApDlzSQzsKF7TPywcxjkqn9JBBFOVcfBW7JPoU75HgIwvjcEBUKPhE1IpoIq9dXTFf/NiKWhHRDfkGR3VnjBjgHdZHdtG7A8+EbLa4m7LuHjuXgI8LuwRNW7nYtwqFHO/bvBVmPi0YangDcMQ5/05Rr8MSGLqUMhb3AdYnKtlocEfSbcgGqIrXy7IsCwNfkXftGiIR3EVeWu+vuX2zeMelC4+XxONLpQ82iDoPa7VfWRAaQfDZdeDBvG9r9zfBKJNf/YrrSPOEmElGC9ZouJqS+t4b4uXCAkoyPQdyRHnpg0FYRd5159I7Dl0+37HKdJvdJ6od3445xySGKRzRvVNQ7U6Gsg62m6SnjQYwjkRFM1ewe4ECs7uvisP3R6+NWfAM+trfm87cDLkTi1ZiIbU2+trN1PZzOPKSrV2U9NhP52XBn7mr5LnjqRTQu2DFziLHl/Qqmi4rHlFBWDg1MD1j9sb0TyrNDjsUPBsAGYJT9Vv6SJQWOrztCOfCk+nITkUKWaAwKCVZzp2gPzCEzocd8yeQF75RDl23LgxxqMbACL3eW7BsdbVnkLdAu1Wtj6B/9GLpp4NGmM4UDgM++mo1tpbf7iWIr6d0pT3g8X/YC2rV0tAy8bd8aRC9sPqzXfVbgP4MJ7N6/q38kgGSsFEzsSl1k+jxirEn5dG49yfkWpeo6a49mlD/QbD0CWcKJchdkkMn1YS+S3rgoE+UDutoWYUfs2G+0p86Mn2FkT4SRfBZIXaXi4Wtzc34xiRDk60d3Bu/MZWYBHMqaVMVsGnp7LEh7lOLyY5+daxRdOfF3xI+ofs7wZplRu6aHJ+iuGrdhMbSSzLd16vghwLdwMGYeHSdThFXt4cZZg4eADPnzK+w8lXup8wHQjUn6NiJIFht3wstnos4P9WyRDpKAqUVk8S9aQw4EpiO0MeImhNjwDnEHkS52CkE1hIA89wyWh5CJ5e6d0OsSoECXW1pz9mX6zuL99luAbw7zBr5Z8b7d5awDxJKCz0mUbQcip8a3HPK8065ZyPQCdeiGVQreSLcRrPqCiJL9p+BcgqFv6raHviKq67GvAQoFfFmfy5vO/KcOz0+3xto1SK/k6w/b9EVdTnu+o6OGJSuWmL/aV8RDXwskROQBKoWLMTPL4Ac+d9l2ffaBX3HkuDf7Mx/bqEiZgSBfo1GIeJfuFDtMPEb/Yb7t8mVmamYwUyMivrW22ccLbu6nEaLES2VBhH219ZQ2HjIFCr5sEpGk8Q5jB65fBVgcOJW9qs5tg2aUjJBgBOTwpzCG5BNOkPHUgv7PCCGCPdLwCZFRgITH2MwHPq0bxMRknIhjrQrEQo2R3ds7XHbEpsAx 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)(366016)(1800799024)(376014)(7416014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vQfqmn0PbN4pB3pnVrLb5xvojpSJUg1CNQ3fK5RTCDyYAP7Tz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q7JXIh4DBrsaf+30/RsFLZGO9rLjH3Wd/V9gKjmpF6pmyZvmLLpMD7IB/vrkr+A6qR1oe4IqK7hDq9IYhK+/muLCB+peMJ+V7ViZ7mX6NRDMq/saMgNp8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a51d56bc-07c2-4a8a-cc47-08dd364fb87b X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2025 17:03:38.3183 (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: t6jN0Z1y0PFCQ19iwgYyO3u750oRxsHTbk4/XL7RTrQZMHZCRCJ8QnyPbe9nXN/gAi30oX6rLjE4w5+zhdyM5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB5829 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-16_07,2025-01-16_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501160128 X-Proofpoint-GUID: 9OvAaC7cNKHaCmOKuDtW6F5hLKE6Cb8t X-Proofpoint-ORIG-GUID: 9OvAaC7cNKHaCmOKuDtW6F5hLKE6Cb8t Set feature flag DM_TARGET_ATOMIC_WRITES. Signed-off-by: John Garry --- drivers/md/dm-linear.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c index 49fb0f684193..351f4ee83997 100644 --- a/drivers/md/dm-linear.c +++ b/drivers/md/dm-linear.c @@ -201,7 +201,8 @@ static struct target_type linear_target = { .name = "linear", .version = {1, 4, 0}, .features = DM_TARGET_PASSES_INTEGRITY | DM_TARGET_NOWAIT | - DM_TARGET_ZONED_HM | DM_TARGET_PASSES_CRYPTO, + DM_TARGET_ZONED_HM | DM_TARGET_PASSES_CRYPTO | + DM_TARGET_ATOMIC_WRITES, .report_zones = linear_report_zones, .module = THIS_MODULE, .ctr = linear_ctr,