Message ID | 20230929102726.2985188-5-john.g.garry@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp4041358vqu; Fri, 29 Sep 2023 06:47:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFInDdnS75j2vV92R74MbasPCKomu2cHZ64bOt5IJalwdzeDSlbvsYZIN3QipZuZxJttkiW X-Received: by 2002:a05:6a21:3282:b0:161:4459:c62c with SMTP id yt2-20020a056a21328200b001614459c62cmr6755782pzb.18.1695995232882; Fri, 29 Sep 2023 06:47:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695995232; cv=pass; d=google.com; s=arc-20160816; b=REUMdkX3HsAXJlzqANeiWkqvTr7QLAewi1UZXtLKtdF/5q4dOL4DSKhiA9hx90uJRa OffVqwMdUc/i4sBSiB7IXE6ZpK5NRh0vX24NuszcQ3yFzwB5jz4Q7ezuZ+9vOj2m4Mln HZkYz+pEUQJiFpIcpIaMlxzMJ2g15CsgYw4JyHFxruwWM0JVj+byrcN77mUZkp3fXFTj 9g4TQOWzHzRXsB2BYv73W+Rtc+GM5acbh59P/ggrst0/wMz58tK+zNw+rUfQyxEtPYWJ M3mwL+ak+Mi/dVX5cEaJZJsySiMyAjoMkHVgZHRMIWfztDOjJTaxENzaqVqES+ohSzft S7Aw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=KtPTSzdcV8V8QQwAZsysfSVzMBIG6Bu0nf5IFfytxI8=; fh=9G5Rk7kYUUbC45w/ckn1HonTVf1z24D2/EBItJKwYlU=; b=gV0+BzY47a3sQm+CMTcFsGe5STh0JIHieH/nxPUnoxDyJmWYckikKHlt49ul4A8nhk H+mPOVIne6WH1aC3ntmIBKnJWyAGZkbqOzRhicFFC1a2Wu+CXA3orcrE0tqUDaL7ddPi n9xHv7qQdDj1HHCxHBZUGMWKPECQTymmbenjK1nSPJ3m85PJZq3v5S95HvjCqskT5qCM 7vcmswxqpVTbl+IJ0/xV3dDCIlSa0Ia0k7axvbsUNaGGKvUN8/s8Q25Fkj4hVodNU47Y 0jiqukvCgZalx4xM1vgTeYTY05Pbwrk0g4FDPoTat/ioQQkn8l4RCg3pp5rQ2/vdwqBF Mlaw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=fbAcyR22; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=seTKJA7i; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id z3-20020a633303000000b00584d16c6439si10019853pgz.622.2023.09.29.06.47.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 06:47:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=fbAcyR22; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=seTKJA7i; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id E1A1081A7D03; Fri, 29 Sep 2023 03:30:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232977AbjI2K3M (ORCPT <rfc822;pwkd43@gmail.com> + 20 others); Fri, 29 Sep 2023 06:29:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233094AbjI2K2t (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 29 Sep 2023 06:28:49 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DA46CCC; Fri, 29 Sep 2023 03:28:33 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38SK9Tna022482; Fri, 29 Sep 2023 10:28:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=KtPTSzdcV8V8QQwAZsysfSVzMBIG6Bu0nf5IFfytxI8=; b=fbAcyR22Gc1LEJvKVpaHJe3Q6/hoqm/NKgqPAJ3VFwxbJBIB59xVdwgcDDi1EIb0crK0 6j9u1L1oAo8Mx4E2k0yPeFiFvSVU3HR+ybXL6KHV0t2agnJriPaFry5lhLiyec6EjJ0I 3MscpDiFFU33v+B6zCiUWEtj5Y6+EPRdDxfM/U5+1wYL0t+6eo6Dsy2Bg+HnvOIO8BQm 4B5dtKbL0h0rJ6j7u6xkUwnzSVWDfKTJTyiffLaxm5/3m+BCvTU1rT565m5Jl/flPJpq KiJscQQ3PidyT9p/ddnrrIxaw+mU9Op7I7OfBLKd7sW1lfQwnBXFpy1akJ0+LpkPf9iP Fg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9qwbpbqe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Sep 2023 10:28:08 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38TAGM2H015792; Fri, 29 Sep 2023 10:28:06 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2173.outbound.protection.outlook.com [104.47.57.173]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pfh4vku-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Sep 2023 10:28:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kYQT0UCer5IyodTj3Rer5D3z9gJ+fvYvnAXgV1t9tu8BP7XbQtf2En5rr1dGAc1DOYPHfs/dL2wTuJ/f4PS6BSdMKQgDvuEvPuG04FboMz1ePWbtswvz1f25nEHq7pclz9LPiAeEvM/1YNDU8jgVSX7ayPv9/dktezprQc/LoxFHQYY9M7GBBZ33IUmxQ4TnH5D/EdprQBUyrIf3B/xkg997u/2wVcu64be66OyEWrF6o2wbK+Wr13vb8GGwuLq6V7BgmTPnqp3YEKtzWea4ExvU+MayT3QhdFRTGf/owM86mv5aHvA2tEJounlD7tDPGtlBLBYuT158MWE1Y95Jvw== 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=KtPTSzdcV8V8QQwAZsysfSVzMBIG6Bu0nf5IFfytxI8=; b=IISIWmrpMBGdYk6kcfik9ScQUebdswEZxAH2u4o1To0wR2z9WOFqHGz03eFkx+kkxscmQTyZVZs45d6No9mYE5PDKVt1hz4p13qVTomG7/Yc3SsDFW7zk/SiIFHZY6dpSPSdOJ+Is4Vm34LFNWIUZWD0JRBnQFhZs2sfQL2+DLVSu/EDa9OrzoRmyetC13NK+8aIWCw2Vsw1t5Qxc87QNdiHV7oOQm0V2I6adlKc3oWV0cgKVSQMQgvrBuxDQtPDVH0cku9kddnNbALpCFLc/Jjif/fgbO+pNz97zrow8bh00SNB/kQAPgB73lYMwaRYM8Q7/PPTZu3vacMF1X6t/Q== 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=KtPTSzdcV8V8QQwAZsysfSVzMBIG6Bu0nf5IFfytxI8=; b=seTKJA7iNTc9HVamUYyHNfw7HLcZhQPxRSJYz2bhFM77d+tNF40PhK1gmS8vP5u2WLDghSRFURDdxn5ZeLsiw5plki9ewWEsMlSxapOCxsvIy8kmcEvf2gV085iz6N6URNRtg29Iz6f/Bne/q5hF+gJDA6Adc3S1tyw77u5Y9n8= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by PH7PR10MB6153.namprd10.prod.outlook.com (2603:10b6:510:1f7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Fri, 29 Sep 2023 10:28:04 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::ebfd:c49c:6b8:6fce]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::ebfd:c49c:6b8:6fce%7]) with mapi id 15.20.6813.027; Fri, 29 Sep 2023 10:28:04 +0000 From: John Garry <john.g.garry@oracle.com> To: axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, jejb@linux.ibm.com, martin.petersen@oracle.com, djwong@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, chandan.babu@oracle.com, dchinner@redhat.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jbongio@google.com, linux-api@vger.kernel.org, Prasad Singamsetty <prasad.singamsetty@oracle.com>, John Garry <john.g.garry@oracle.com> Subject: [PATCH 04/21] fs: Add RWF_ATOMIC and IOCB_ATOMIC flags for atomic write support Date: Fri, 29 Sep 2023 10:27:09 +0000 Message-Id: <20230929102726.2985188-5-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230929102726.2985188-1-john.g.garry@oracle.com> References: <20230929102726.2985188-1-john.g.garry@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH7PR10CA0001.namprd10.prod.outlook.com (2603:10b6:510:23d::23) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|PH7PR10MB6153:EE_ X-MS-Office365-Filtering-Correlation-Id: 2caefeab-1db7-4013-d4b5-08dbc0d6c3e5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9XojNLjQp2KOQcAocMMe8sZveVdkIUVfR7l1kS0pLwLGm0sj9TNH7IgItiEfzsbW0hwBPda6pEZs3JD3rRWwGlfzuv5FMZwWmOR6M/RJcrqI6g1bUOsLLH0z7DqoIlBexi1ZwTCMEytsqZ1WL3OPcZQeHbv15tBmr21xliorQEpZl0tO1b1v74QOa3xT0Q1eNVsLTt58Iy3l53HnERdXBL9jrZ8ireZpWp6vJd5c1WBwcrbNSQtKlWr/eid7buzWfGHUV5M8yxxhIJjSDRQzbSo6omvoOavA287w28p6rOBRg/oWtMq2cywHfNnjBZrOgMFu3P4uSD3x/U3hUpvjUmmyqFRNIIaEcYnaVJ//GVY3VjLvy0cFfg6NFc4zjVOJ4qoRFltO5iHIG12R3c+G3gAYQX1w4xoKm40zNTfGaebWKcL4Zs3va0uHDjKzoj+RQfnvEUZHMEneTq3bU4Arlqnd+OXmHQHxKe6OeZdFuhw4Yp8r+xS2i/1QXn8TB1l5zKDwP+bm/MwBFbIK0j4nkvw8BgFhfKu05zQco5wIeE3U9TH+rvhoTM6Ob2yERVKINhuYDIpv2vNh7SQ1h27OOO4CNh/iZrNS3b1iYEv5Sx4= 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:(13230031)(136003)(39860400002)(366004)(346002)(376002)(396003)(230922051799003)(186009)(64100799003)(1800799009)(451199024)(6506007)(6512007)(921005)(107886003)(1076003)(26005)(2616005)(8936002)(54906003)(4326008)(36756003)(103116003)(66556008)(7416002)(2906002)(5660300002)(41300700001)(66946007)(86362001)(316002)(8676002)(66476007)(478600001)(38100700002)(6486002)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WIdeYez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nUrWvlNzYduVB68yKaSnIRxkHmmTZpU1YEKGuvilp3aDen7awt+4h8Z9n5lQYTdVSzlndY58OwY/Z5MXSzaceOrPZaK2agq4se/NT6feAO2JH9gw5ARVTZ5fEtVKJUm63/JO1h7Yzx4jwN5rXagzZ5cM4ZVjUYc0FMU/XwiWOUZ+BfdZ6a34UJOZWq3g9R3Be3evdR2CKE+Aa+p3T7rdycmlU8e3eRu41QvgcN+JzYBQO9BG/TBq/TqQ/gZRiVWzIjEYKzjGu/4VhYLnaEzHNZ8qnK8vhUoH43rkghir8nhzr7l5SR/qynbZUuxVG5qUXFPo+2N9vBJwRzKXBuf4BLyWkcVPoOszLEmrsRpbEAE/5eFbnCyUaqZ99GAdXayCclEXh7Ky5A/EouSYncRKGV+se3dDxN5DoWLICxfM/qTsB/Cb+CutyvdrT82TletU6p5i/5Rlh4l9LOsl0KnN1U6M2LTKoR8en3fcQ0Sy7c8EhltxswRhrbeO0jAto5H21DLyQhcNxmbhqJfWXxSu/n74OjQt2mSVFF/BO/dINIMjmXe7phaI6+BLhrEVVY6ntQZPOYb9zb0b6Mbc9VS3SK2pV6/RThz55fvF/E+iXj+zAxOejIhNgf7r0zvhDGg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2caefeab-1db7-4013-d4b5-08dbc0d6c3e5 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2023 10:28:04.6919 (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: /H1OEu1u3OWtgisvEf3u6ziR8hG9z5qbkMp/okR00K3I5OmkiUUj7sGKwscMqqVA387xDwN+kRcFVDckANa4oA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6153 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-29_08,2023-09-28_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309290089 X-Proofpoint-GUID: q17oT2fE9g3F2plciu8-Fk2NJ9yyT5FA X-Proofpoint-ORIG-GUID: q17oT2fE9g3F2plciu8-Fk2NJ9yyT5FA X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 29 Sep 2023 03:30:04 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778379897463732392 X-GMAIL-MSGID: 1778379897463732392 |
Series |
block atomic writes
|
|
Commit Message
John Garry
Sept. 29, 2023, 10:27 a.m. UTC
From: Prasad Singamsetty <prasad.singamsetty@oracle.com> Userspace may add flag RWF_ATOMIC to pwritev2() to indicate that the write is to be issued with torn write prevention, according to special alignment and length rules. Torn write prevention means that for a power or any other HW failure, all or none of the data will be committed to storage, but never a mix of old and new. For any syscall interface utilizing struct iocb, add IOCB_ATOMIC for iocb->ki_flags field to indicate the same. A call to statx will give the relevant atomic write info: - atomic_write_unit_min - atomic_write_unit_max Both values are a power-of-2. Applications can avail of atomic write feature by ensuring that the total length of a write is a power-of-2 in size and also sized between atomic_write_unit_min and atomic_write_unit_max, inclusive. Applications must ensure that the write is at a naturally-aligned offset in the file wrt the total write length. Signed-off-by: Prasad Singamsetty <prasad.singamsetty@oracle.com> Signed-off-by: John Garry <john.g.garry@oracle.com> --- include/linux/fs.h | 1 + include/uapi/linux/fs.h | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-)
Comments
What is the advantage of using write flags instead of using an atomic open flag (O_ATOMIC)? With an open flag, write, writev, pwritev would all be supported for atomic writes. And this would potentially require less application changes to take advantage of atomic writes. On Fri, Sep 29, 2023 at 3:28 AM John Garry <john.g.garry@oracle.com> wrote: > > From: Prasad Singamsetty <prasad.singamsetty@oracle.com> > > Userspace may add flag RWF_ATOMIC to pwritev2() to indicate that the > write is to be issued with torn write prevention, according to special > alignment and length rules. > > Torn write prevention means that for a power or any other HW failure, all > or none of the data will be committed to storage, but never a mix of old > and new. > > For any syscall interface utilizing struct iocb, add IOCB_ATOMIC for > iocb->ki_flags field to indicate the same. > > A call to statx will give the relevant atomic write info: > - atomic_write_unit_min > - atomic_write_unit_max > > Both values are a power-of-2. > > Applications can avail of atomic write feature by ensuring that the total > length of a write is a power-of-2 in size and also sized between > atomic_write_unit_min and atomic_write_unit_max, inclusive. Applications > must ensure that the write is at a naturally-aligned offset in the file > wrt the total write length. > > Signed-off-by: Prasad Singamsetty <prasad.singamsetty@oracle.com> > Signed-off-by: John Garry <john.g.garry@oracle.com> > --- > include/linux/fs.h | 1 + > include/uapi/linux/fs.h | 5 ++++- > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/include/linux/fs.h b/include/linux/fs.h > index b528f063e8ff..898952dee8eb 100644 > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -328,6 +328,7 @@ enum rw_hint { > #define IOCB_SYNC (__force int) RWF_SYNC > #define IOCB_NOWAIT (__force int) RWF_NOWAIT > #define IOCB_APPEND (__force int) RWF_APPEND > +#define IOCB_ATOMIC (__force int) RWF_ATOMIC > > /* non-RWF related bits - start at 16 */ > #define IOCB_EVENTFD (1 << 16) > diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h > index b7b56871029c..e3b4f5bc6860 100644 > --- a/include/uapi/linux/fs.h > +++ b/include/uapi/linux/fs.h > @@ -301,8 +301,11 @@ typedef int __bitwise __kernel_rwf_t; > /* per-IO O_APPEND */ > #define RWF_APPEND ((__force __kernel_rwf_t)0x00000010) > > +/* Atomic Write */ > +#define RWF_ATOMIC ((__force __kernel_rwf_t)0x00000020) > + > /* mask of flags supported by the kernel */ > #define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\ > - RWF_APPEND) > + RWF_APPEND | RWF_ATOMIC) > > #endif /* _UAPI_LINUX_FS_H */ > -- > 2.31.1 >
On Fri, Oct 06, 2023 at 11:15:11AM -0700, Jeremy Bongio wrote: > What is the advantage of using write flags instead of using an atomic > open flag (O_ATOMIC)? With an open flag, write, writev, pwritev would > all be supported for atomic writes. And this would potentially require > less application changes to take advantage of atomic writes. Atomic writes are not a property of the file or even the inode itself, they are an attribute of the specific IO being issued by the application. Most applications that want atomic writes are using it as a performance optimisation. They are likely already using DIO with either AIO, pwritev2 or io_uring and so are already using the interfaces that support per-IO attributes. Not every IO to every file needs to be atomic, so a per-IO attribute makes a lot of sense for these applications. Add to that that implementing atomic IO semantics in the generic IO paths (e.g. for buffered writes) is much more difficult. It's not an unsolvable problem (especially now with high-order folio support in the page cache), it's just way outside the scope of this patchset. -Dave.
diff --git a/include/linux/fs.h b/include/linux/fs.h index b528f063e8ff..898952dee8eb 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -328,6 +328,7 @@ enum rw_hint { #define IOCB_SYNC (__force int) RWF_SYNC #define IOCB_NOWAIT (__force int) RWF_NOWAIT #define IOCB_APPEND (__force int) RWF_APPEND +#define IOCB_ATOMIC (__force int) RWF_ATOMIC /* non-RWF related bits - start at 16 */ #define IOCB_EVENTFD (1 << 16) diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index b7b56871029c..e3b4f5bc6860 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -301,8 +301,11 @@ typedef int __bitwise __kernel_rwf_t; /* per-IO O_APPEND */ #define RWF_APPEND ((__force __kernel_rwf_t)0x00000010) +/* Atomic Write */ +#define RWF_ATOMIC ((__force __kernel_rwf_t)0x00000020) + /* mask of flags supported by the kernel */ #define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\ - RWF_APPEND) + RWF_APPEND | RWF_ATOMIC) #endif /* _UAPI_LINUX_FS_H */