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: 13942020 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-block@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/61cs36ezTJWY8jnTSNNKCp8HAWvAQz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h7r0qAD3h09zzH8aRwfint2xBvveNF 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: 13942018 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-block@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/JjVGxr8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j7baNDBpHKaD+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:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 13942017 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 E4F3B22DFB8; 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=1737047053; cv=fail; b=S0JPe7ZHop2vbZuW14U+xcPrdDJMiAiaWofrMlbeHAGDM6o9DhdIXK6cWT3FCKl9k2zKPl0vywSqg4mzoiRUf8mgGG1WzlaHESQrnLoDTSLhlpQwthHxa5jwHmcqhOLfswdDMSICQgEF1bVYQw8l5Gfkrht7iNItNERjxllREbw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737047053; c=relaxed/simple; bh=n+dh/Q84K+PMgvDPF1vr2eJRhtCsmkCl3JkSktYsOq0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=FpElyCQA9n4RJiWsrC/ZTumbTxHrU7WVy2e5A8EqSlpS6L1UB/XUQVKh2bVpWHmoiA/iHzfRu0ac4JvltIAOth/xhDktTk8IrOCZWvovdP81EE8ef60kh7wldoRIU9nWXX8WoFoQ3sMl9DFj5QEEQDfQWYSxaTVBx6szAZmxIrg= 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=mW6sCPOG; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=tg3VxGYO; 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="mW6sCPOG"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="tg3VxGYO" 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 50GH0ihO019990; 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=fqnnbtaZha2DSj4oZSZm500VijTLCk5Q1rzdcZUpUto=; b= mW6sCPOGfIzJY5Tz3tRjuWE9R00CJimkxQhMnR5ZHuMa5SUpZmt1MAeydvgNDUK4 4Yk4HZuujPapSOr/OKhFJ4NbZ2ytY5Gtq5kEg4y84gQ5WyENqT38FZV/aNdFi1vB jbP9KK5+oJTa4wyaER2GOvhNn34I4T2RJ48BOeWaPHDn6AsoWFuAlnt1Jc+PPao/ zC/lnJysuyV7nGuywhBRjiz+ByUYuQvVekiWaeLZGtwgv9qupWUe6bDwHWG5mKqX 6nVYOmbO9I5Rg7+QlXW/dCUDMcDoEApDqvOiVTb4u4zEDhKr/TFSfdE4NWjtMU7O ufetgQ/gEyZr8YRDBCIzuQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 443fjatpqy-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 50GFVoM8020422; 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-2 (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=YWN912SFRKSxCk/XWWXxXZvOaSK0j3MBOUsMY/WM55oQu2pwO0IlhlzYyF8roOnpd/gJ9INuk6Yei3iOgWrtoBnSUtC1cXCBpjxf5FyPRhgSVfFRThFNowFjfQY6ftXUpc07VK35YsQ9Lpg/4IuDmOMDjI+txf8YxXZo5WcIcx9mUqWriyvjy8TZiLun9InZ/NPCjuYTPocd6TJ3ZNszWAQYGBccK+aLZ5H/H/keckHmcidZ9jgqyeCooAlfsKTXSDTNw6cICX0CD28ltQUSTyBxnWS4gLVWOqqbezqp+ZiCnG3N6klKGuba6SAnTYvovRGthOopZCDi6nd4JI3Wig== 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=fqnnbtaZha2DSj4oZSZm500VijTLCk5Q1rzdcZUpUto=; b=co8JU0br5wHCPgSE6Bt4+lx8s/SFbd0sHGA+mQc6Ah630nAwWUjQD4MmYT5s7bxAl38iuuiRn4Whxu7ACgsXDbtWBl7MbcRE4MO3O69mDSRAwulfkFnoCX4U5frfZM4iPgnAnVJPq7UfoA3EH292K1RT6xfRRhrMtgDdZjMVHhiBr5p3mSC0E0Q+T+LttJ45+VI5/fi95f548xlTKv53OsUsGEqSeXEQsw4krz9BwQA2p45W6BYajETDzAxRZRDSjMJB9V6SuwNiSaYPQJ5VKnvBRR+wwsoTbWZ++LXNVb6lHh7MMRU397STmDfvUFnCczXQ0lQpTxLQ3uv39oebTg== 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=fqnnbtaZha2DSj4oZSZm500VijTLCk5Q1rzdcZUpUto=; b=tg3VxGYOE0AdsxX/hMhlL44pNz0HWDiK2s1ij1jOjQmf3Zm4/fnQU2i9aHDi3Cs9Fu8x9hMRuMw5xQVrj/osKAP+eU+5nE3qTzm/ZmBfp68kAd9Rw2x08AiZWtdH2QT9oS6/EtLsXu9HXCOlTZtJuEgNzLl9hRPb5drWhaFG+U0= 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:34 +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:34 +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 3/8] dm-table: atomic writes support Date: Thu, 16 Jan 2025 17:02:56 +0000 Message-Id: <20250116170301.474130-4-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: BY3PR03CA0014.namprd03.prod.outlook.com (2603:10b6:a03:39a::19) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-block@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: d5a391ca-bff6-49c7-eeef-08dd364fb620 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: O1AjOWqUKREgA1VmTyATZFHKFlvFGfMphhHznemNlzU41wsjiNCXB6TDKyAdiJzunUTGp8IY86xyjJC2avTpJndrD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Rr25vmQKGOqbh2VCXLqKghqgVxKwk4qkswqbjksgzIADece2oQO5x2yCpsF6gduXS6bsjtbVILOkKGY13c9tMfAdz3sp8T03m1uYhC4A2hSvMASfhgRXIUl5o+NyhePNiLb/oxweY/d+VCWTyUPHNUtl6X/hNM3vbpPkSdp2meI7oFAMx6sN2JjR+LJQZp8JpSjUJNcbsaxzLzNV2o89YHbqcbQbVPbBWzoIaIX8Jsrcc8kL0wT208ck 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: zq5rlrlmVDw9S6dI6K546vDPJqjH3tYomGjA9MD4Nfqhg4zQhzx3JLB62lbh6Abbe6F664runWzeUomPzYdTV+cjNV7LlZfnAtISfsoG+2D26Sr6sxKDohA0bFns+BGcC++aVL9lpyIeBuxSubZ0Ytqf7lzDLhPBbgfaGDi/cH4KohbdLrJ1kiKNiHRuTn/YWP+9IMatHQpuHr5voOnLHlG4wLbEYgR2wbob9TUHIEABhuWEebcHItDcDNZAHuC4+sWVJyLGRVEE1Vjl8NdyhN6+h97E+ocnsoMj/1uNnvghBqvJt598At4ChsTO7TCl6ZXD5Dz9My2Sq/z0R2BoIPcg8QV3poW9hWkBMdLhXhclGA9l18FZkuyiqPprLV5MOJVkv8rGNZD/mfzmxUko+G1dpXCNCDrB9dHCD03iQQZaFIxMayge+8AgUnKn1a7+Vtsd3QofAVs2kCiGrm5IVJwA2S1tuuXSkg8yRa7gMB6kTI+zFVwB4Q6Afez8Box2QIriRA7Q8Y1i9WquMDPAHp3I2pYbmVxr0l8Nsk8sIfXx4gnUv/G0/Z8whzxJPjzxoQDfjD0ZmFAyeE4KNm2+OHonIK+wbVit6hBPY81+590MjfUZdKUOMsb1WZ8KlWgFAjxDwqWKo16hiYZlw4PQddj61kaDde3Cdmw74ik88MsbJfLaf9+9vfKe5yltBsB/7Q69hgeNLcbKHdnazfzKa/0L6An3UtFB6NeP9nszfmvdIk0mNgwiXCdcJN1MdV93HGIg7UHk7GWDNhWpSScScdrs050ML763kBl0QMIy3nAUicgMKhQuCr2QNxvuA4h1dzs5jJ57s+nuJwHPJpDdvcui4//SFLOLviXNwZ6GTCjOZM4erjMwZs7j/78KKDMPVrprCoZkyXM+SAVlnyaj8J08gAQydJaLqdQmlpd45ExsjUoAxazh5tIK9QftspQpO3ehw9HKro3SjBnwFmytrt4hW9g9e3MsHQsfP3CyH6ra293qTltqskjcQ0nDm0CjFPEQaHga7a4fBKEOT4nK8jE2q0tNL8oTGmoLIvcDuuBp5gcLU8iUq8pYOw4pvxO8n8zLj/udGV+nX69y7meuA8LIgGx4hiM2siXVA3XQJw7qOJB2OtAsBdUG8SduIKdXBrercEC8saDCWnZnNeZPEkY1CHhiehjAQ9XahOOf6E0YdvVbqN9HhS1onCP7aL1YPug/KBxgq7d5gDkQ0h7KA5CSawhuR9W65VM4ffBDnTyxIz67gXvKwKZwH9QI/32jhsS69OpPN/+j6ohybbxoIQuAIIBXwMd/6AJZ3FrAeJekzl0v/ReO2KykCx4bXwp3eXzMQUDzgnJZHksUHZE9EnXko9v84uFQknNBf3BOFL3XZ1UG3P29UEzyXCJAij1v4Hb20sGALqjYwg03gN34sVOazSc59WG/AxQaUJeAkTv3txZT31gEbFWQ/GSu758pVYoQLe4yh7R674l55bBFztr7FUzPPLOgY5B1zpWxkOlD+VSeYT/ckCC4i8uaZ6Att0+3sl/aykAraBND5XzM2AfqNo8Ar9YW8Y7V6vJERR4W9i+/u9iKSoK2fwvW+hjJ96PVerlDW6hGylntZ3Uy8w== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: GE5BIUzoym2K6Lxcnq7t3P/ydOfR4l7phXasen5zcZUXXmaE+km7pGMC06Qw7ioJ8OO5jVXnwTP05uLq0qRSZSl62+V2zY5URYtBumdVFIoR/ROHthEy7mHedsFIX3WJUt6rHPKNnPzxcYqPXF2+oaY/bp7cNv+LfPgNj/+XaPhTOokRg30uaJbu51cXNKAsLI00ZVYeR1wJnwpn02+r86Q65oTE8Dj227e3p/P1brEupBmCriicnbFAD7vrVSc4EBV7gzhT6piUEspVeov0MlEZfmPA+K+vkOwsGFKQFbnad2y6OuCG8IV6XQQNt9tpp/c9At1L6hzhUhsnZ3m5/m1TtdF6Cduj2iZXxpZoBXzqdbg7a1VnS7ItNVC7LTY/By92PY3UI/fUfjwtEjpTxz5QLkToApdslZyRyBmx229b2Lwx1o7H95mXH7dISdbcopNpTdleLQVHaBCGK++HK94iyCm5DYmWcbv6pd13Mhg8sJbTWa6PviWMotLdfor+p5kMG2TIeRdZL7UyEG6yixOZ5za6ue6XuSzjFqvJip9Z/bo32ctqc80JSYc8jIS7hu7kEjSac4VE0JaxK2FoojqciPeO/t1FCXVdeJSRi5g= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5a391ca-bff6-49c7-eeef-08dd364fb620 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:34.3806 (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: 3TwrysPZJEaJp0KvWT7xlVslnnJtrSybk5UiElube1fA/N7BCqI9lHH6ydr9ABbEEAeNIv+iwCWtuojk5Kq1MA== 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-GUID: msoOeMtvneKKQ3kPPijRrTawD7bPJ66B X-Proofpoint-ORIG-GUID: msoOeMtvneKKQ3kPPijRrTawD7bPJ66B Support stacking atomic write limits for DM devices. All the pre-existing code in blk_stack_atomic_writes_limits() already takes care of finding the aggregrate limits from the bottom devices. Feature flag DM_TARGET_ATOMIC_WRITES is introduced so that atomic writes can be enabled on personalities selectively. This is to ensure that atomic writes are only enabled when verified to be working properly (for a specific personality). In addition, it just may not make sense to enable atomic writes on some personalities (so this flag also helps there). Signed-off-by: John Garry --- drivers/md/dm-table.c | 29 +++++++++++++++++++++++++++++ include/linux/device-mapper.h | 3 +++ 2 files changed, 32 insertions(+) diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index bd8b796ae683..0ef5203387b2 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -1806,6 +1806,32 @@ static bool dm_table_supports_secure_erase(struct dm_table *t) return true; } +static int device_not_atomic_write_capable(struct dm_target *ti, + struct dm_dev *dev, sector_t start, + sector_t len, void *data) +{ + return !bdev_can_atomic_write(dev->bdev); +} + +static bool dm_table_supports_atomic_writes(struct dm_table *t) +{ + for (unsigned int i = 0; i < t->num_targets; i++) { + struct dm_target *ti = dm_table_get_target(t, i); + + if (!dm_target_supports_atomic_writes(ti->type)) + return false; + + if (!ti->type->iterate_devices) + return false; + + if (ti->type->iterate_devices(ti, + device_not_atomic_write_capable, NULL)) { + return false; + } + } + return true; +} + int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, struct queue_limits *limits) { @@ -1854,6 +1880,9 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, return r; } + if (dm_table_supports_atomic_writes(t)) + limits->features |= BLK_FEAT_ATOMIC_WRITES; + r = queue_limits_set(q, limits); if (r) return r; diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 8321f65897f3..bcc6d7b69470 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -299,6 +299,9 @@ struct target_type { #define dm_target_supports_mixed_zoned_model(type) (false) #endif +#define DM_TARGET_ATOMIC_WRITES 0x00000400 +#define dm_target_supports_atomic_writes(type) ((type)->features & DM_TARGET_ATOMIC_WRITES) + struct dm_target { struct dm_table *table; struct target_type *type; 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: 13942016 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-block@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-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lgA2GHZi7uUd2bSbIIfUb+2IEKMZad2unbsGun1f78gJljpo5GsI3dZo6AusGWK+p7eutTupx+0nSiCDn2pmQ7RX8/fd2nos0PWOXrx3z4d/+r/xlWInLHljfosbSLYvL3cLP2v8TLTt2kZ5J1fhMysDrnEo7/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/UUxG8pl8R81lrM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RDBz/PQsXzNjKGtYW0BTTOoQpJNr9YYMii1PCAD2ZqpK+V+vKfKdiCLt4yt7PlCNUm1mecFus9nD31qidPw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-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: 13942012 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-block@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+trfm87cDLkTi1ZiIbU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Eni00wnX36GTw8xVM0gOylfnkjApOoHU/g6uvpHpgJY893xmqLH9nNkk/keuFw5dZbSCnxk7WfDdHuC+44rT2dy2+oC5HDaZosAwgVJUD2ogwJjWq/8NlPtpxMlbtXQ8U/9wO1iJu3uG2pEr3evvoq7JXIh4DBrsaf+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, From patchwork Thu Jan 16 17:02:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 13942015 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 9681322D4D7; Thu, 16 Jan 2025 17:04:10 +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=1737047052; cv=fail; b=Z7DEY4IdbbhhFlBr9q7TgsXaR7fhRh6SgJpAP0/7uvei4FBbf5i0eFuren4mnEN0mQbIrF/VdVrwf4gWlRprFJv1ICehyCQLkIH3tNYmAbAp64EdbIqLltv33WeyvmwLSjRITQDAU9TfgSYgpo2RmQSIjjeg56BUy9XBiw755QY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737047052; c=relaxed/simple; bh=mDn4pqVEikh4rL1ZnxkGh5Qc/oUSaNO0YZ+Wt+UdW6U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ZZIcWsut1V26jruMLqw3LZyzNaw7JyBZfbeD5ngP0Uff4LSuMbhV250V6gLs/SLWy9afN4K315qkLC65Vj7qDUTGJWepssl1ZdP0yq9EoeHE9oqV6SKZeQ2MKQm5s/BjXAT7B1MnhsNx6AYqvFN0R+GVAXoON2C6tK5abzq0cbw= 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=LPDnABcN; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=RwEuww/N; 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="LPDnABcN"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="RwEuww/N" 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 50GH0fZ8024138; Thu, 16 Jan 2025 17:03:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=FoSeH0frUcXmcx9Xw0pGpi5yyKqvyumzt4V1k9tpX3U=; b= LPDnABcN6Hc1j+5ilJ2+gWqUovpgAAg5UnFt1I9oa4Hj4WUJozeZBlaAMa+0CaCQ eMuE7GLFZtvF0iPdazs5CCqDkCUlk6i1rnXuIBCeARov0dbafLH/2Lij0pfNjKcN 9we1dyuwg6ljZXAv+DJ6neKtzbitBv+9rMUwfn/u7InoqLIPtTBH8DULsdQMLdaE BKyoDl+zDYc2u4ksm41Ei/FNqrNlK+8Un1b4g4jhfW6mEQ3tc/2mnRfkcz+X75B8 9r2f8Uzrqndqo4wEvkVE4njh7u9C3e4hRr8c/oVarOCIgAvPgjwxDj8nKpTssELJ +NK/Pqj2wqxNRF8Ej8/SHg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4475mfg2vw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 17:03:44 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 50GGKEfM034967; Thu, 16 Jan 2025 17:03:43 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2049.outbound.protection.outlook.com [104.47.70.49]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 443f3b24qw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 17:03:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FMTcSkMleX56m2ueKMQ/Q/VGYYIB5GO9CAoZ0rJWBydzD6aJ/lseMBjGsXg2L6UpdMMsaMRB9cgmtteYaK8287+gB484wUDt3DcRkPRehFQHzLNpx1MhdMkvN0PVXOhIFFaIEYOBCP6j+WINXifc7kwfwEkn0gPP99DQqF/KImvhHQ/km+/NFMzvbwgwH0IuKBMtLu10bCusZk6yPgY8XCW9iSrjZWmo6LYCaN7NwU8+8qzg+b2V9nsuCTxUWKXdQklilse3in0YYi3U98GE/Mz0KzqftlmWmlXfGzc7AGr3uoV2YI5xABZ+faPn3WK0t5I1juOazEf6v2qMLUsDzw== 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=FoSeH0frUcXmcx9Xw0pGpi5yyKqvyumzt4V1k9tpX3U=; b=pWev+OdQOPgul6ongfIiQmceeYl+50AphO+CVD85rVYgG+KczSym5xo7askjD27gOQHPv+vbfKmulCB+EePpH21PKbjWywt4VSiGhwTWljfuMPfEi2J1tHWia8F4XsWFOB0cHMrqaUGjdRnKGVdatK6Xu5iTSyNbfFJW5Fuy8Hz8io36fsJ8tJEcvQh+HYE6i+GM8E5swiwI8SIliCLbVA8vBiGkH5dck0KHur6RZxoyHGN40wwTURRV/BrpRl3GLjjriUdMM9ECTYRGTp7YWBAzzI+gXpXixhftYj6AeIV0iIWQDvsjLObgVgcpHwGKqfLp6Qpr+y0EJ8T8R/GKVg== 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=FoSeH0frUcXmcx9Xw0pGpi5yyKqvyumzt4V1k9tpX3U=; b=RwEuww/NbKGkfEvtq4ZO8eyc3529dMkKff7CgOuXU+ecX6AYakOStftMkb/rzx0Tx9uoIw3G4fumY2bmdok2w5mQ9+ea6HFzYYR/o1hITElAP/YuEu6eH2j8kuxLcpAiF/6SKxMO/jGLEC0Af+BVbsalnkbzUDBlEOaNL6KZr3M= 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:40 +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:40 +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 6/8] dm-stripe: Enable atomic writes Date: Thu, 16 Jan 2025 17:02:59 +0000 Message-Id: <20250116170301.474130-7-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: SJ0PR03CA0132.namprd03.prod.outlook.com (2603:10b6:a03:33c::17) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-block@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: f15d31b9-440c-4fc6-317f-08dd364fb9b8 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: XKFKcqObJPfKSORuXs2l5/tMkrxYTXz/+yhKu0Q61/KMaZr3/OKG3M3XjkBo1bohfz3naHxWqCbZOG5JOekDusnukVZKgDUWmmTdVbVq/yec2Vxe6eoF9LVk8+hzMjOud5BELrlyLMX+EOxsvCbx++Iietx4ygz8LoL4lJvPBqukWvTEaMdvCfXm34jbCIRtl1yDzARMv+2Nt5O3ODmxjHFjSfrShRPZ+dL8+QBekjQ65X/efOs+j/3AUxeq/f9/LciIhIpqV25BekS2a41xgAnzEZdZ3iy9cd2fdypcGjg0Ese4z66fgOqv+Onw/M+rfmXF4ZpjVD4gE/sGwpd4H52cyFtXvSJ5kCDmzCE5H0fwhbH41r4wNuSJYd8tVwt2txR2Px642o4zKd5ol/NB0sDVl7hJJlBaVo/iKuoeN8E1Xk4X+KKiuu0OkbYBLgwZiQaCBdyWbvBlPVpNWn+aetyS8WOumL952e3ASQ9X4bZrUA9HX6ZOSj8fq9wuBz5L+1ar5Ih+fPmZutbFY2qffg2f0GnpyUe9epZFaYdTqQHiBmTpuxElWbep1LFuwtQ4r1uyiEKzkEQvWTr7LPrnJUey2QbdUajwCt0K4X4btTmhmv2MbdKxXaqS70pc55tm0P2Eh3Gk3N0Ccuor2GgIR62dwoCQbO09RZmLRFqcnUYiVa5nNFOnquUaZxBehEyzPtLV2b7VIAvHfAlbOBleXM5PWCcTH+QfoXmL0rfqyzsTnC1YpnE3OpKXlAHcWNzMd/kxLhG0PdLv9BMeWnq4TJjJwcPsQTwwH4elL9XF2DEaqLmrNWZifFJWNrQsItYFDGTzJpTeI/FCesmhEARQyRC7Wzei6sZeGt8Y+kNW9cEIb59rrlmN+n7Iy2EpcVwrORLzcPAekWOhXH1RCH7F7sDkTvi8+cGm+GCUYV5qF+ExjpM4ui6/lWvIjNulb7brYU4ipSRKi6XRm/oeykMFNA+7RyEhjPtPj40a/iGD8y4k5kg9HuhU2GUnUnQevs75sxz7Rc3yx8zo2fogKIcHG/KkhWyQtqU85hseHNqDmhCTbaHQ9pZDbrB02YcDuncmRrstZZ22Q9BLt1qs0jup1JXCgPLeHohWnVJeakpRZ/wwluiRNV6H5tQVAmp+QFFX2YO7cO9aKa3G2nbsMVs/CkFXHuhqGqckfH+S8aIJPHMiqBClnNP7hY2tu8Ish9voR8thOosPACPPaZfcWWZrDnpcoFCLBPGp8inQ+sSantie99ud72727SwOA5Ty2gw84gycqZtSb6Fi4q6FeQ7JdQe/AZ6HXVShLwM9rUkXW1nOuzlo7kQR2a+3/ZJBUqJ2ZnZkIN2YIhd1uOeb0s/oo6b+9FhVmL85fJzuorIVUb8sBy7KKudAytsLQnHjdavh 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: UOoDDLydfuhoE5n867hJj4FPspvV/M/wDhc4dV0IQ7NH+CIAX7U79bcAl5OFnl9/fpNM3q7JsWi5ZZvBPpWPSisJKpCi+cjwi6O8pKaDnlJ7U5Ref2TVb6r3u3addWX/5wg3ecFkoOp1/CAIAZpJA6CLFm1HVXLXLRzWTwQRmr5VxptSwYLsqIb18R9lgH7Z8FVTWsyqz34g8lqalaTBWs19uT2NTZ4mYOyLxLwfSub1ca8WIxi8i1OjF2f5D/Y5LhY26Wft6qJd2jQok6yW9q9+34o5AdMQpUaLXXUI0wvQgq7tmeEheU40xU9CxvPW127deO5CJmUsekLdTRNBaRKM2QEKiEIoA4PVLVxlA+Uh+p/r3RbVFLl0tIUm6db4/7K6+Iuw2EydV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+/9DW2+YXYG956m8ZMJYidbPol7n0QQErFWU4j/ZouADsjx4uMGMR136V3oaoexl3NRKZeHwDMBpDa7bnLJhY5MOrvPKFHymWaWV++TSUidmPFW+Vd7jdX+0fW/IHPMdjsL/hA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 3CdGVTmwdwOKWjCU4U2MD04hRP2d2An1YiRBrJ5fYwLQb/fGNGrmLI8JTP/5CXZSBh2x90Q7TSQAFYtarZRivFINZHKe4D5gzHzmYYHND2SJtwTNU1InOwvhFpHjotbO/fSYWRlWcXweXLqxFSOpWaTQYnQY4pF36rhm1NXfkMs2Mxj/uhAVDTWQysLUd5IDZRBc9DxFIF1HT35f0+MxllPIgVFFO+zXUT/vYq43Ax7Ok8rZ13AU3MrkHzpNPIWvGlJu7FFvaloaqSe7kLck+SCUHM0anfJuyjG41gsywkpHeuCoWZ3hE2UbN9qGdY6UWoAVgGzQrsxEJJg/vkvvoqoUXg0ZsEsfojwSS+/C4humHZVLU+vuilg4Vvz2lqA9O5sG+BskPUEa76qpkU3Y/neUfNEK+HgJQRZvss7AIiYUMLiLMx91/gaTJtNkKnvbPoYGEBkzpvLKkXn9aVrWUWqvkz3cKkbPWA21uBMJrZpJ9X+q9bEnMrlkWE40JJELj6376VZnSusW+OP269bMJLWUWSIwP++Ts12j3e9p1zHlVam24gcxksF7xOC7em/N1UdBZuR36aL6hJSVp81D3c2eSZzUryavr7Dyax6CzKQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f15d31b9-440c-4fc6-317f-08dd364fb9b8 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:40.3882 (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: +so+Oyxad7rnGEsNjYJyU1Sw9KVe2srdOvJjMHMLbb3ZojpqCi9Ke5/QXyA6uSpT9pjQIZ4C/CWMwCBfG1xwtA== 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 spamscore=0 bulkscore=0 adultscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501160128 X-Proofpoint-GUID: wswMmsCugZ8C07Ka-WQNjUyd8qP6Kdhy X-Proofpoint-ORIG-GUID: wswMmsCugZ8C07Ka-WQNjUyd8qP6Kdhy Set feature flag DM_TARGET_ATOMIC_WRITES. Similar to md raid0, the chunk size set in stripe_io_hints() limits the atomic write unit max. Signed-off-by: John Garry --- drivers/md/dm-stripe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c index 4112071de0be..9add79c234ae 100644 --- a/drivers/md/dm-stripe.c +++ b/drivers/md/dm-stripe.c @@ -466,7 +466,8 @@ static void stripe_io_hints(struct dm_target *ti, static struct target_type stripe_target = { .name = "striped", .version = {1, 6, 0}, - .features = DM_TARGET_PASSES_INTEGRITY | DM_TARGET_NOWAIT, + .features = DM_TARGET_PASSES_INTEGRITY | DM_TARGET_NOWAIT | + DM_TARGET_ATOMIC_WRITES, .module = THIS_MODULE, .ctr = stripe_ctr, .dtr = stripe_dtr, From patchwork Thu Jan 16 17:03:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 13942019 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 C51592361D2; Thu, 16 Jan 2025 17:06:32 +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=1737047194; cv=fail; b=mSMmPCe24Uh2735TiO1Gw8KsGJO+MC3FLIGy05hX+0GSmSP7cLicOoAVZZZ7rf0sRc+QrarZTt8ZdqsalAur2c0RdS7FqdbpsyLO1AW2EuhTEx7BMHzEKqoeebXreWFX9fdxN07/VsNbn/o00tmRhgDqDErj0P/PqbZAllbPT1Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737047194; c=relaxed/simple; bh=WVK7kX8E1NpBqJ91SvGnTE9DNZLJXPr1+93G7tZ2AAU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=D+9BV+bzkrxOItIqn/m2RIoV1cVpc7Krljk+cZAvmD0tlNVSoUsa1Sg9iDxVx03XyDHapDQd/1cVxZL4sA2HwReeEANMgn7H0zlu2GhRV9umOrAOEG6gRsVFxuIcs4WOQPAvQfXU2lnVqbPv71DVlKP4E6n8H2jGbmUYyFa2wD4= 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=ATPlvr85; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=EO87jqFP; 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="ATPlvr85"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="EO87jqFP" 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 50GH0gdj031094; Thu, 16 Jan 2025 17:03:45 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=TCTJVN532bVZAncgKvzDqXBSoXjd/ZmsO8Ixp48uo/g=; b= ATPlvr85Xrv5wOlTl9dPSOjfG62134WNqKcXl7WUhxHxVo0YBbLeYFPQpsMiQ6k2 +gjqa9gzeh9kZjRkm/VhZ6j9Qk1FAW/vetN+g6PnxuNkLrq3BwwT0tgmNuOSD4cL N/lKtzNEfWdjnN6xC9dYxuwQHmUUFs2hWVDZZEoOgYgaPidsTahWYxp2XquDL1bZ APSQHk8nAVD3rzW8R5/IzAvEuivI3DjKgjuCSZAuXARw4y9fAP6lVH/n+Bo07Y7n BKN+VR+Vz8ibCRINAQQxudgd5k+/4+A8P/ivIHJ2jv25Yw9Doeu0IrZpNmN27ZsC Kf1sR8vvBCB3YdipsHtnyA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 443g8sjr64-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 17:03:44 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 50GGKEfN034967; Thu, 16 Jan 2025 17:03:43 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2049.outbound.protection.outlook.com [104.47.70.49]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 443f3b24qw-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 17:03:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cnZ8pObg2WoiT3uRcJoZ+pKMHvOaehbSswJjYJI9FOtGCmqYk4eLvc6/ICWdRR3rT9jN3PzqyM5aYS9NVVPBXLTj3xviQtN4TiIVhjbWJWFixQ4+BNMpvQ3l5A1glfiTcXfQG+5f8VFuHBUiGleUiKNJbui3dWSV6bRRcZh5qNfWGWFxjVbNue+ULvqof7ZsF0jUI7C3SoSBT5lmiBFRWd0/Q1gNkN0sKul2d44PPpBxN4DDC5lk2GJ5GTwRm6VbevWA1/jKhuypr2JDWhEmWdaNdyrXvUe68pz9Iq3rgrSvSlSmxcJUIDHWAf3+x0MPB0sMeO9j9IJAKfsNQG/VrA== 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=TCTJVN532bVZAncgKvzDqXBSoXjd/ZmsO8Ixp48uo/g=; b=mP+fuvMUy6XVBCr+wrjA421Kmyur++qvkBfNXMYjekXSoRX2fkicNnLfjCaVOQ7restiiuPhhQXsEIgDcDB6mCijLHgPIOIDQwz+Rue2ttgD73zBco9pYSiXRJ0FtTfEYr+nxE6HjBRNznZ0oKLm1esSxwKnY3to1wI9O7qFz1MEQ+8CYnklnUo7D5qnAS54jLIYpac/d0zVROdCubEAXkFn9Kl5xa7g5WpNJPZHSXBkSyKwkcshguGg5dYZTSeWUSB10OnhzTl3kwt17WHaD84wYSNCrUj6uO2wy9qPdtPi6Fnj5HW83VopOaYOEzxttn6SRSfbCn3XqmrEvQcCNg== 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=TCTJVN532bVZAncgKvzDqXBSoXjd/ZmsO8Ixp48uo/g=; b=EO87jqFPtco82J5yLo8NikPFo+KyrUyBHgd1foats09TEdxF7p0wLcAbp7kB4rJM1N41wuvBPn4020eks08CDfqZRTrERWCnPHPwUG1lgFjUQ4oVvAC/1bYgrP7VT4MrPMlNAKNFt9xS8YqHg5nEkcGLTjcSmtMX9wti3tf5JZo= 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:41 +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:41 +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 7/8] dm-io: Warn on creating multiple atomic write bios for a region Date: Thu, 16 Jan 2025 17:03:00 +0000 Message-Id: <20250116170301.474130-8-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: MN2PR15CA0050.namprd15.prod.outlook.com (2603:10b6:208:237::19) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-block@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: d0ad238a-da47-42f3-05bf-08dd364fba86 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: FbogFAk0xC8Ao5Nf6wMKjEbhAVImU+QMGJ5ntNcfeXtDFOlSC6YGpGs0LugBe5KLr7Md3A6AsFqrwYywsXAWhj1M1K284/YZxriUBPOY69cZ1wZxw6Xkm43ffPU04YU2qAcvrqpw0zWpkp+9tWTT+paTPWEwr8TJJIVf1i9q5TW01e7xo6n+BUNC1nYqy5bArclzT95kdq20GhoP4o3oL309Zw022IW9QaQO4xVH5kkkdQTiL37uwXWmKYkmPVX9kO65lPk4qpj3tSXRsbUSjNLMx2rKxHm7QO8hRBvhdzoAp/sfAF3QUxJUYxyCb8FJbaN4l+l8mm7/2oAbYsy32eYGRfwCR9LJDPlfuF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-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: UriOZ9nvUW62NTPwUFNz1LX3FdcxheBMFn4z6M+6gJGwWo5oRNrPV255fk8VOZnp739ai0umOc9LRY4Pcfmx0HnGMakRO1/t9PzWY/ZO+jiJ0df6ZcRgpMG9BU3m1xO34OiL45CMvZgte8bWL/p0iUdffZoJXREyJEw1LD5YbgTvZ/mQCrToZsEHhHVIjBB90IYeA0rCCHIhIY4s1xhA2EHXH4mjrVt3WjsJcm1iuwPoVUr1TNPacBTXVYJNeZJB9BtZupB7bY/3zxJmmBmDicbzofGnk/BqAsE9dG1GJT0xO0/ckw/hxO2LTjK5aRZuLtUYML/R0I0mxwkM9tuugvlxc9u/oA1YQgbUaaDzvyp2NNmBXMpBQmOBz+EETcOT8lRozPYe0Tv/y9fMazGlqo56qehlULJuvcSXgUmM4HYnfVrBUKIGWxC+LbBwzMyLgKA0lIBUYCOzeZdfiZ1D41ysIkOFc49qYqN8Lq3FJx2pmtpezAq1KKbCpyDk+e9SotVM5ljrVfm883h8UGskiPvV1f67Y3tM+YZ+8zeB5ekh0kawRzwFJ58l9j/OJT/v2mc++UkaljoUXd2A1Jzb1x/URnVE/U6bDf9Zb8iJrlPKDS1ZS1WEkxujAraJtLZ2Q9lcPpUfwSEkRgT5MbAZAIWMzOeAd2m4zdBR9NhpuxByr9ohJH/ISBpz1QJT6I/XwqR+XoCkwoOCv/r99xX8FLmNjQC6d/hvmVccv80fXC2q1WFSAjmhSym7Snu06zGL0uLkRYXrGLJ0RzVS0bDuSH/yyTn92nSZqumcS2gZNjRy/xx5kxTdSLJRoR6jlSlZrT6X5OxNxGFrY/Qti6eif+pc3mc41cw3C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/5huQljs110bQ7wqEBhIPKkv7Hw/aH039PvzM8G4B7AYiyyooZhmVDJ0gYDvF53SDmkB61/h3V58sNcoBzCoJ6obAyEBElk76511EwNd0vEWcIGPw8a159cX4dwtXV/yoamfVKkx6a3YfTxfQe4NihEgxNWG1IXrEYeRdKxCpzyzdYm/GbmeYKworbUDChZ6eKB6FuVvLZoTzmpghxvM/WwmgSLjMu1DZc329lL5t4E5VKEOQg67fydB+N7XWh94+OQYLxTq4Ktn/zmxVjJqzzm9dDECGbW7ShhYqn87Evdx+xqPnY9uNNuTZ7AVikZRMs9/d1UNWRHZAha4JnOvgjiEpk32PeI6ILiQKCy5LvKPeodNE8KEIPalQCwoY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0ad238a-da47-42f3-05bf-08dd364fba86 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:41.7207 (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: 2tqP2OBZ826d9/R0ekg/M+yNMZA2T20lVkSNEtgd8Ccx4cIiOZBLrRjdomNNSnB9cMPXZItfZKxD2+OCA6L1qQ== 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 spamscore=0 bulkscore=0 adultscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501160128 X-Proofpoint-GUID: pS9oUmxsKtto7_zKcUfvbXYF7L2sASmk X-Proofpoint-ORIG-GUID: pS9oUmxsKtto7_zKcUfvbXYF7L2sASmk A region should just be for a single atomic write, so warn when we are creating many. This should not occur if request queue limits are properly configured. Signed-off-by: John Garry --- drivers/md/dm-io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index d7a8e2f40db3..c37668790577 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c @@ -379,6 +379,7 @@ static void do_region(const blk_opf_t opf, unsigned int region, atomic_inc(&io->count); submit_bio(bio); + WARN_ON_ONCE(opf & REQ_ATOMIC && remaining); } while (remaining); } From patchwork Thu Jan 16 17:03:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 13942013 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 0DE781DE890; Thu, 16 Jan 2025 17:04:09 +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=1737047051; cv=fail; b=XvZ78BYsyQ+wqG/i93t8J7tsNKEdvz1z7qDlXXOeYDNEhUGcj7KgdJzWxvkeftSLyz5Qtt0xlCPgXOTi+EHVFXfkCUzSVwvIV77mygP3Xtocxzy9plt+kZjH6wsVEWZo5KfisvTZyln9LTYiSKQAKOfNXmyDBfrNu9sCtBPSHA4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737047051; c=relaxed/simple; bh=p6q6F+lV4MQfwt7LZ980TvG90UUwHs2H90IZr9JuQUs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Ai+pXTYsoHffx7CtExH2yo9XDn5E4ppvGwiaWQyZxYos1ZCIjQJH/9M2I3bxlcqZwzGc55V6RY0rX7qBtNuIpiM094umaoGGSVn2pX6uCrPJWeBc7EOol7i9p2Bt34DUEF/K31mpugl6qfKKCjv2RJ7oNyTYNDclfpPNsgmARKk= 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=YGTndVRm; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Q0S3543O; 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="YGTndVRm"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Q0S3543O" 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 50GH0gox024167; Thu, 16 Jan 2025 17:03: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=ebWUp9yE0MpNy6PVjgfNu559dHhK5qyyHea/CjurGiA=; b= YGTndVRmDtjuiDUGUgnCtHxGUaHUTcvOYvO5eVy6kh0xXgjf5TaQuger3qMTlhh8 /zMY0suUF1WAYh67WzfLaVLJY1AdKAKEip+gsyewAqw8PTt5eaxQtHaEiDs6zVd2 RXB3PHFTqfHDwIUwg1O+HL230iIN6UnwR4k1ywPUYJmkNUsw0VQkQjactKXTJzgv OoB98Os3ONWMv+Zm8H/5uXST9oSkpKaGmu60isdPhl9z2GZxMeBZV4ePt2SdtHhW 9rscuUHYRZrNwqRY0gS2yWjb6Bvulx/U00ASkV2lJuzTlZv4O6DgxppvbVBZgZoW dm3qzwLrOBPuYFmfD+eT1Q== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4475mfg2vy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 17:03:46 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 50GH25IA034806; Thu, 16 Jan 2025 17:03:45 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2042.outbound.protection.outlook.com [104.47.70.42]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 443f3b24sc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 17:03:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eDuDejZ+SZiPRgD7TWU0a1CRXpkOjHANxPfz5XA/XVA4u+LBTWmTuNJ96NxH2brbB5p+rgebPdXeU24IF77suTWubQZ3fR4tTVelc4Y5OpgcQBCT3v/vGHprAnnq++atlbMsWb+26n7E4sE8OWHwk9QHW8S1+8ndnIFobdqGxIiH2p6CE0VUo06x1YDlBz5NyG/7z3MJtD6BZLYoBsTNjq2NCM+HoMX76s6aNZ7L8mXlRxoTn1cRg4KIAHeBIkq0k8EU+F0iRB2Y1iwCtY0uec4s0jOAp1M6Ml1n/g9RWZnlI2W9NNCOHd0OL6HRo7BGaYnL5VbPP5cl75S3W0NGmA== 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=ebWUp9yE0MpNy6PVjgfNu559dHhK5qyyHea/CjurGiA=; b=fBnbeqF6iDN8l1McbGHCdcISENHaFe366T4oqF0IHuiB5kh/l1vbOmaV1o78KTSESwrxvKJhY6w/UE17LjOJp5zTivpgSf2+iUdgMC+RALSx5oMlHS6yCBGC9mKv2hHONbGCoAUsYyg2dpe7xG+OVGMD7nvqW+ikPqQx6I+tInAGn4ErOiYsXcLmw/mNLL8rp0yVZdKGyCuSEdUMMYrQq6o0lJd5INAyG8Qx03cMWIRf9IladXfZvPyxrrLgQB4LaCUEdJGX/6c5AFF/0ozTJhnkr6sccLKkORDupmugO8bF5DjQHwm5K/GhCgSr5K0hneSWWMHAZDLBrAe95eI8uw== 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=ebWUp9yE0MpNy6PVjgfNu559dHhK5qyyHea/CjurGiA=; b=Q0S3543O6r1lsYKUAF7CHoOdNqvMroTZiu6YNnfS0YYA0Wcajp8M8aw1lf8EuxDPgQcDDncZnExCD52itC7hdgytVpDGUvIOpOpCByseJ/dydt/of1BISdLQTpmnf2dmdQQ3E3XhBsD6jzGZ8ASSiEppeEDBZE9Gq+2s1wVVSRs= 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:43 +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:43 +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 8/8] dm-mirror: Support atomic writes Date: Thu, 16 Jan 2025 17:03:01 +0000 Message-Id: <20250116170301.474130-9-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: BN8PR04CA0060.namprd04.prod.outlook.com (2603:10b6:408:d4::34) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-block@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: a88f71ff-4fb2-4648-8ea0-08dd364fbb57 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: 2vhPz14QN3JM0NpgoTSzx4W/YmbdVu/CLWizsXhLVFysnQv3L1fd23jRTpIy+HzUbFicgYzJmblMsdz0CgzdHgu56umD+e2G3BekU3ogHfhcuQdpmbLEOEtyKuMLgwsw2SN1HcFDG+TmdwwPPEJfVYpqTmUN/RxyEAQJIYpReoOAzMfqEf6tqEz89G6lywtcHc2hoWWddafUghQfux6Me06gnfEWU1SiXT39mQ4qndkpctOF/JKDYj2Kgz27ibP+en74EepfRgoXvbNow3sYTHpZHSwHe4HXg1lRhH5pFCZnFt8fre688rV72XZzIMf29sQH3O3pCU39VAg+/jdW1beE0EB63Ph52wFsjJT9jbbaA3HwGMDstYU9o8k2Jc8Yu2NEpGeIQ2JEI+x1HNbvgPGoMH+4rdwEMCz31i7x1h6EQ7iCkQ54FCOPSbKw8dU7jkyYYqGSxTwvoVs5iwK4U+4qFd9BfSR3/UBvoaI2DNby1FSKQ+QIAvwR4plJA0b560PLaAX+eh+I0u5HzXbw36hguyNwwrVnkvTUnfLYt2MTc14duBRNQSmiNT3zfTkJahBG6RN4lPtFxgr3y9CCrpaL1iorJHU1dWwbN4VFcPQP08YBF64jyKfZ+xQN+O09HwaVUodXR2vCIfFI1efgQMaL1KMdgVdpIl5h+S5bCHysX4k2WPc0UT8izF6nkQPEP3GVRaHVJknax+S1XHoRAkNdyCXRs68UGpgNjRwfEaa8subSDHazYCb8PDe/0v03x6gwV292LwxyN2NRwDUlkPenxvlEo0ibm5MWtx7mnU2tBvqwXK+ZHPhUZcUbaS2Rfot1cG53crT60yzo/Yii6vDyCR/VfQ06r4Uk64MklHA1xYoIuYGwvxTycdzGBXD0awkr5tlQJIgQPaVM2MbbdFbERJdBj3+egTzB9fO7cyEcK859L1XRSQZm3TLqsnmxI6j76V+IZ7ov5hRI0F43IC7taUKTjauLyKYGMwPc7+bBiaZb74Bb6TCaH/0yrPiof0U8T2Z/S0IVYvKn+2g/eoxvjL4UVcEsPNhEeyOGTwYBrFz25wq69phbzn8rEQ19O4tYq1UJTbAsig4kvkhSx7zOvn5SKHnjVDT4LaFOiVfPloKea7ZyirHwu44W6J4ap8DHtvgYznfYMPjxIBVxuQApC2g2Tp56rSbEoHyvirigf6S1n/1Sz58EB/FDjtlJZnXYgHJLWVP22kCuEZs9rSZHQ7ScDoxHQkKkdoKqkYTGFnQ5O+qPeoHGS8YHHsslH70co8qT/VDsA+RgC3lMpe4WvKp4Aj91oWzcNL4YqwPHCGds0vqtkPM5W4lQDcrvFqQxcLzR5Vp/4RzJX1ddkUIR30GuB5dZN0n/axtw2fxIF1Ul+peS7ZT9EIaTOjm1 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: wyvM58vEIVA8AP0ppxVAXEw9f/oiNgWiDlT3PxcUQP64Ay+HtKJVUtnVHvrTpoV+pvaEyYmFQgVNqj8IiqoZDQnopPHlbDsF3AgqcPHhWY/c3Dhir7nfU42ra/jpPxT9BqomdztHwvGqmBjZ2hcM+gI3I9mr3/hUC9Y6sTT0q2BQoxgavv43xVDRHA05ADOufROFB5xg/hvr3VFkeW0hOamDz7vN4EYDNb7FLE9+wPQVsBzEd/bMc52QM704vzyqGZFUoL5pD8SUBv7+jZfif1YgdrQAPktBiuDvnPwz3iF7BBaaFdRHTiBSnLDNPeoBxSfZ8gNrPmQYYgFqnAqFD9eZbM+xmmaO41g+NqKqyqPP+l9hvSRBGhtdY4MbTrImcTOihBLVAX2ygAt63tOOenkTxYMELwYv5MZr8V4hdkjDspUuxoMOzX3qqvv/CVz3CPuDeeL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zoQhCtM/3lttBhWtRER9KjUZY4OxEB8V+6AOPsU5paWnVCmdvxNGr7/00M80B0g== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 6fYHhDENmAnU8FouBGJuKHEdiEYRaIKlPkpIhPuFDGSxlM93rqybq0Nrny9b4stqNWBPWYffWziZo+BQCNGn01bmYePT7NT/iGYh72my4x3gdosx7D3PRUbFC4dZKjwrJkdcbXOUzA966pvoO6BfHFXxPOAXQHHYqlPKGxmWNvZm1ol9IqwHJFH9VUZyB6zYumt4HXWBnVUF8gflWn6/8qfu4CA5K2d4x94WuuXgTOtfyxiVvbi8I8XgHCSbzcszKa6oyKaJtOh1dDsQdChuqmFLE0QIgu7pnybgSHGztgEF4w9XhZohvmwxipMa5nt/mndr61baYqumLT9TVd4aK+amPvNDpmyMkc9Jl4H5PpIeOgAWJOuT/Pogz0PyyhjNO1yr+dTYS0u/1+isERVPJWlg36Fy1qptWxvfoXgdSaGxthXOPjwA9SDiutJwCchAiNA7t7kUmnCwOFYnrf0ykjSIiZwOMT3P8O+9Tgx8/EhNlw9KaF+urxtyCAn4CCo58VubBDSm74emzRR7Diq2BLLQLpjibKo93CVfHa3PmmAH0QFrtld1K6RcbpaYkLP9wMXFY6nm4+X7b+YIBjJPjUgduHq02ww2kA9u3BGni6o= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a88f71ff-4fb2-4648-8ea0-08dd364fbb57 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:43.1734 (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: /GFWGTwl7xiZuwpuuKtno1YHYiqajwUU3GEGrth7NoyQhZmcsBwJrMXtpgoWT8G6g+JGMleoGpumonSJySUFww== 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 spamscore=0 bulkscore=0 adultscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501160128 X-Proofpoint-GUID: sWdNZkKlewaFEnGS2NgUgrKm9lciTJ3k X-Proofpoint-ORIG-GUID: sWdNZkKlewaFEnGS2NgUgrKm9lciTJ3k Support atomic writes by setting DM_TARGET_ATOMIC_WRITES for the target type, and also unmasking REQ_ATOMIC from the submitted bio op flags. Signed-off-by: John Garry --- drivers/md/dm-raid1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 9511dae5b556..7a42bf648c52 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c @@ -656,7 +656,7 @@ static void do_write(struct mirror_set *ms, struct bio *bio) unsigned int i; struct dm_io_region io[MAX_NR_MIRRORS], *dest = io; struct mirror *m; - blk_opf_t op_flags = bio->bi_opf & (REQ_FUA | REQ_PREFLUSH); + blk_opf_t op_flags = bio->bi_opf & (REQ_FUA | REQ_PREFLUSH | REQ_ATOMIC); struct dm_io_request io_req = { .bi_opf = REQ_OP_WRITE | op_flags, .mem.type = DM_IO_BIO, @@ -1485,6 +1485,7 @@ static struct target_type mirror_target = { .name = "mirror", .version = {1, 14, 0}, .module = THIS_MODULE, + .features = DM_TARGET_ATOMIC_WRITES, .ctr = mirror_ctr, .dtr = mirror_dtr, .map = mirror_map,