From patchwork Thu Jun 20 12:53:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 13705424 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 0B9331AD9EC; Thu, 20 Jun 2024 12:55:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718888107; cv=fail; b=ZaAkDPUFr66VUaRyxxe9VSpnRlCZGNHTLx1Pkr0gPNjIqBZ8FPOmia1VG9XV7F2m0jz3XiD8lMohP4Em7FlPVXhXcWf+OQSAzOKDJmvrUkgy19zzgk7wT86czhUS+Xw3WqKL09zKdZvwwge31e/3Pe9OckVZwcSP+XKNhIDwVcQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718888107; c=relaxed/simple; bh=zo1VPvvNMgXffWxDXx04IopaqeZsCW8bBIoNJev3Kg8=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=XR15954KyuvrTCWHa8iTB+JIxsDD2XFcvchXjVHT5x7dhPprTkBoc/ZYfeYqWV2XImb36ucslu+BO2HwyLj3htXF66Q+NpiZwHtdGdE/XA1YGQwsDUrm4NUIzZctbwWvlQ1bWwbLHwWqPD5inTYdgM/sIwXdSPth9HZr3swjJ5g= 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=LKLijo/E; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=JTj+qG+h; 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="LKLijo/E"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="JTj+qG+h" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45K5FZf4005063; Thu, 20 Jun 2024 12:54:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:content-type :content-transfer-encoding:mime-version; s=corp-2023-11-20; bh=A zgUYOkgZ+rfcONPzMauL3woRe2UU3yUOfpvrHo3/zw=; b=LKLijo/EnO6LtNFvg Lds08avBVQ+UDWkBXtCa8dYLvAB6HWh9dcBUjm9OBHmXnQrsfI/FmNBQZjA7xVET znY/dEL3od6qUEPeZWNbMOtiNArUO2mFnaCGN0MdL/bNeOcRGfBzrrjSnyVqXcla bpNFQ3Ri9VwA8y8yo5lUzvCrzo+j4nMewN2uuN31exBIGGwkVQD2NZuhl8n+2bZR a97tnK4NABiOEt25D+UTXl7f+WFoj0ed735jpMZ48sCR/Xb3UXBPuvwXU5zcF/p2 XpYDNkNzZjOoVFNmifdaVCs/fs1S2+4sgNrhYvdyEY/jZD/ef/bl3eWDq92n1i9y kYjwg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yuj9ju2u9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 20 Jun 2024 12:54:27 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 45KC7utX032824; Thu, 20 Jun 2024 12:54:26 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2041.outbound.protection.outlook.com [104.47.56.41]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1dae6dx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 20 Jun 2024 12:54:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SnjnG+K7cTml3vUECNdfmDMyrNdKGV2I4y9pMaD357zjFq7Iobw7xZg1EJnH7ENKP2khaYSckDiyH/i43wLBhQZMl50KRrUSPoVzDtSImoWBqmLhFnS9EgQCWfcbztWN3c+4zTFDB6R3i91+/CrRv/u3Fet4cXE9glTtFB0WuDfv4KMBxEKlW3leudaCce2ID7Ld5KATGbbY+LALc+V7U/xD5kgCFzW/x+YbQ2+GCojQZyKcOp40eyIo3zNjmcsSSLydYtPZ+rrRlRm+JysCosW81HQcXdyozJE10h+ewnxqostYPaDsZVT31cswTjU5bDFzUIrGIKpzQvks0ynKIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=AzgUYOkgZ+rfcONPzMauL3woRe2UU3yUOfpvrHo3/zw=; b=iJVtCcYyAlHF0E+0sFI2iMt7vmCjmrF4JlN5ZP4PPPfKlChWtTlyIDPkoUedD9VaIjm9ocfywxUi6wRsJb+RqKk5+++JqQLoNVsv691I4HphQ097Q7IVvDwl6iXAxVqj2pFcuprAQdsE/5UV5IvruRRU7g9MJdyKnIbyuFtf1obZ4OeEaEzNPOV1ZiBCs6ur8aniNREluOzhxTjFoxy8WER+jv4LYDVOSMeH1npjN9MHoNZEHLAlMOtLsXbjm0HIpgX3+bNANqqsELYLD+aZ+ASdOS6JKwPyibz4CBTmGho4gV+CHxQtbovrjVer6uM/sFV8t1T2EBM8BBDpO2rB8w== 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=AzgUYOkgZ+rfcONPzMauL3woRe2UU3yUOfpvrHo3/zw=; b=JTj+qG+hyGWrZfBunKHvyEQKdpitpZwIczF84lcg2NYK1BIFgIduM2/L/q+WMdxKLx8+qMZyMOfnn50ubbYwjIAJfzIdx6ASTruNSjeeQv1WCSgas0JJp+6M84IyEb/Nc7GnYzEFXVjOZu9a/TuqcPzOuCZviVM/XsM0RVh0f4c= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by PH7PR10MB7695.namprd10.prod.outlook.com (2603:10b6:510:2e5::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31; Thu, 20 Jun 2024 12:54:23 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::4f45:f4ab:121:e088%6]) with mapi id 15.20.7698.020; Thu, 20 Jun 2024 12:54:23 +0000 From: John Garry To: axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, jejb@linux.ibm.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, brauner@kernel.org, dchinner@redhat.com, jack@suse.cz Cc: djwong@kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jbongio@google.com, linux-scsi@vger.kernel.org, ojaswin@linux.ibm.com, linux-aio@kvack.org, linux-btrfs@vger.kernel.org, io-uring@vger.kernel.org, nilay@linux.ibm.com, ritesh.list@gmail.com, willy@infradead.org, agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com, dm-devel@lists.linux.dev, hare@suse.de, John Garry Subject: [Patch v9 00/10] block atomic writes Date: Thu, 20 Jun 2024 12:53:49 +0000 Message-Id: <20240620125359.2684798-1-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 X-ClientProxiedBy: BL0PR02CA0005.namprd02.prod.outlook.com (2603:10b6:207:3c::18) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|PH7PR10MB7695:EE_ X-MS-Office365-Filtering-Correlation-Id: ed406428-5f39-4a13-a135-08dc91281c2e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|376011|7416011|1800799021|366013|921017; X-Microsoft-Antispam-Message-Info: =?utf-8?q?3TszHgcu1ka8FhOlQdABNGTZxG3lnfy?= =?utf-8?q?bVA6GWtNK6E9b2/plnDqL86rql4tDNJvtk0kKg+OS+N3ASdm+ZcqPCPtYzzWHXUEN?= =?utf-8?q?i6PScoJJC3tsn5QmB7nXNfblD0R+P36VWzYkNAI2YJebTZUTcjOeWOHgdPtVC9m+Z?= =?utf-8?q?8kXdN52+N+Sm5JwcI74UTvFCcuF7mfheFES2WpHirf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p8P?= =?utf-8?q?y2d0UeODsUbRmGDg6h5XLdabcbShKLIIzwGIGiUusypGG3scg+KWFHjzxssBMymQn?= =?utf-8?q?aVY5RrZRlvJqGYFVKrp0quNE4/GneqK/Gvxp3iUee6agLU/dOmMCIBQGqOpZmdep4?= =?utf-8?q?89wNXHk6uEErb/bxu0nCzabE0RjoaQrxm8C/eGKT75r4bhI2nh+zguTUfGZYrM9j0?= =?utf-8?q?3GrCHyTxP+Ql3?= 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:(13230037)(376011)(7416011)(1800799021)(366013)(921017);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Fy+hekt4ZCJKaIQmZq2APsuYVb4T?= =?utf-8?q?w76ZdLD10s2l7mqlGNtM+IZ1zCX9qmdphZTJ6xhAw5+oZBCOQWvYidsx8DSSBX0Tw?= =?utf-8?q?80viwkUv27jVzapNj4iJr5Hag3GPJlAMr8bwsXa825WLKwp1NHH89r38nhg8mxen/?= =?utf-8?q?lwsTNEJkwy9caDDx0AIndb95Tw31/cmOmzT9SpGbr2LdHepoafW5JCFD1+0mshUaP?= =?utf-8?q?CEoXD9SwcL5bWye8QLjfxvN8Uo4x0nvWdpN5wMaJ7u3aZzftV+SaWwAEc5n3KS5Tj?= =?utf-8?q?ogw0YLFE0XAQiwn7tYNWnHuuslU9eUv7xTiCOtay0jvmncIutyKZz0UjZjbrOtqVH?= =?utf-8?q?gEZO0gOtqnLtP1aLzJilAtSwwZL2rhj5InpLai1mXq+0MzpmhPH6zsq4yFjgGe9R0?= =?utf-8?q?+rn5GUD2yUR75IdNzJhOblkMyH97oKx62HDmProE9Gesb8WbbM8XMwcSVmdbVbMO1?= =?utf-8?q?f6Hxc325KWmLNy9tEeSOZ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etX1Yw0GKpSYgNdWUxuZw0dDJJuXDu3mg3kc1KpYExXt8?= =?utf-8?q?YpFgC5ngsKovRF5gcCfzHCXi/gPJE9LCFeI/2tDEyLKhLpOcT5yVVcDbwHvpXMwDf?= =?utf-8?q?bevq5h3wQIKA6Bl5v9HQ7jYaoNFPVxdHhdlBxzGxyGrl7bcGbo1D2Cv9ki6MsWwJH?= =?utf-8?q?H5fCkBDVWuEN7ZfoTVGYS3lIQ12Lrh9uIA=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: MQ96v4ROxGOAYkdQRaIS431EZ0blQlO413kqwYo+zFSVHsmg0B8NeM2sOZZ5FQA/MjPU70TtriUjwvSVHYjsdLCDRAkP3hCWi+EpWOjcLqVhSaQbNPn9ExxEz96Tnpi8fIF2fQSFJA8zNTVm3JNFOCNSDO8KwP7ZCGyKWo2oicXwgC1PAbc5KltOHi+c8XdMCBKiIphC50VZWVloigtsn6a2q01NNhqUZQcEXlrySEIi6riVMb1cZCt2+555gPVSCoV7JDzSmQe4dRz8wPEEgq3cKodMdV2gjFx5zjIf87+hn1LMWArJKXCoFbCAoaP5KGkohhRs1ocRWDZb7iEHuyJN5Kgi68ZQcaJEUcgKFt+k31XU2F9G2R4y6fGQ7ed8K7VSnacJITWwOi2e0UBZ0zw7VwFMgioFe88ozF6WpHB7Ae8BOhcTBAipBjjOOEzXiEblWDWT/jSGRpfczVGOVM2Ji8AHAkbTNgePxQoMko4fNrZ4Lh2SjihfnTvu4x3MUnIxbZbugtUSVb/WhytPpLQMEWEvUHEor4Gv8qWKbFudLBLlGIhuCHF2TcxN56+t5Whz8p8WLMrQNet5dHbLJP5/dJzAoDD3WsFWATsn47U= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed406428-5f39-4a13-a135-08dc91281c2e X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2024 12:54:23.8404 (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: gysIAwzLlRj1Z+b8mdSRW/MhWILPte6flMSsGe70fMzCLXjLqY5P5uk3sHYwZk0ifqmuXnRPvIVrZWCKv1856Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB7695 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-20_07,2024-06-20_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406200092 X-Proofpoint-ORIG-GUID: hrm27mvGUQFHCLeRO1eykvOdgNR6WCNi X-Proofpoint-GUID: hrm27mvGUQFHCLeRO1eykvOdgNR6WCNi This series introduces a proposal to implementing atomic writes in the kernel for torn-write protection. This series takes the approach of adding a new "atomic" flag to each of pwritev2() and iocb->ki_flags - RWF_ATOMIC and IOCB_ATOMIC, respectively. When set, these indicate that we want the write issued "atomically". Only direct IO is supported and for block devices here. For this, atomic write HW is required, like SCSI ATOMIC WRITE (16). XFS FS support has previously been posted at: https://lore.kernel.org/linux-xfs/20240607143919.2622319-1-john.g.garry@oracle.com/T/#t Updated man pages have been posted at: https://lore.kernel.org/lkml/20240124112731.28579-1-john.g.garry@oracle.com/T/#m520dca97a9748de352b5a723d3155a4bb1e46456 The goal here is to provide an interface that allows applications use application-specific block sizes larger than logical block size reported by the storage device or larger than filesystem block size as reported by stat(). With this new interface, application blocks will never be torn or fractured when written. For a power fail, for each individual application block, all or none of the data to be written. A racing atomic write and read will mean that the read sees all the old data or all the new data, but never a mix of old and new. Three new fields are added to struct statx - atomic_write_unit_min, atomic_write_unit_max, and atomic_write_segments_max. For each atomic individual write, the total length of a write must be a between atomic_write_unit_min and atomic_write_unit_max, inclusive, and a power-of-2. The write must also be at a natural offset in the file wrt the write length. For pwritev2, iovcnt is limited by atomic_write_segments_max. There has been some discussion on untorn buffered writes support at: https://lore.kernel.org/linux-fsdevel/20240601093325.GC247052@mit.edu/T/#t That conversation continues. SCSI sd.c and scsi_debug and NVMe kernel support is added. This series is based on Jens' for-6.11/block-limits branch at commit 339d3948c07b ("block: move the bounce flag into the features field"). Patches can be found at: https://github.com/johnpgarry/linux/commits/atomic-writes-v6.10-v9 Changes since v8: - Rebase - Update comment on nvme_valid_atomic_write() - Update chunk sectors vs atomic boundary support - Add Martin and Darrick's review tags (thanks!) Changes since v7: - Generalize block chunk_sectors support (Hannes) - Relocate and reorder args for generic_atomic_write_valid (Christoph) - Drop rq_straddles_atomic_write_boundary() Alan Adamson (1): nvme: Atomic write support John Garry (6): block: Pass blk_queue_get_max_sectors() a request pointer block: Generalize chunk_sectors support as boundary support block: Add core atomic write support block: Add fops atomic write support scsi: sd: Atomic write support scsi: scsi_debug: Atomic write support Prasad Singamsetty (3): fs: Initial atomic write support fs: Add initial atomic write support info to statx block: Add atomic write support for statx Documentation/ABI/stable/sysfs-block | 53 +++ block/bdev.c | 36 +- block/blk-core.c | 19 + block/blk-merge.c | 67 ++- block/blk-mq.c | 2 +- block/blk-settings.c | 88 ++++ block/blk-sysfs.c | 33 ++ block/blk.h | 9 +- block/fops.c | 20 +- drivers/md/dm.c | 2 +- drivers/nvme/host/core.c | 52 +++ drivers/scsi/scsi_debug.c | 588 +++++++++++++++++++++------ drivers/scsi/scsi_trace.c | 22 + drivers/scsi/sd.c | 93 ++++- drivers/scsi/sd.h | 8 + fs/aio.c | 8 +- fs/btrfs/ioctl.c | 2 +- fs/read_write.c | 18 +- fs/stat.c | 50 ++- include/linux/blk_types.h | 8 +- include/linux/blkdev.h | 74 +++- include/linux/fs.h | 20 +- include/linux/stat.h | 3 + include/scsi/scsi_proto.h | 1 + include/trace/events/scsi.h | 1 + include/uapi/linux/fs.h | 5 +- include/uapi/linux/stat.h | 12 +- io_uring/rw.c | 9 +- 28 files changed, 1111 insertions(+), 192 deletions(-)