From patchwork Mon Jul 8 11:42:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 13726449 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 341892E85E; Mon, 8 Jul 2024 11:42:52 +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=1720438974; cv=fail; b=LF7g6JoXtkfksXUNSqGDSL0v1tHQAihH5qH13gGj7S+7wpfa6NVdccWNwMUptxU0sCFZFcAtBHEy0xbQ5TtnAxA8KwnIRrp42qDPSTAtXGkpkIIgrfL+gN/W/rBBZBciBTkP1eGXyQmxxGwfRxzfP+8T7mgTQxTfSddh1nDBktU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720438974; c=relaxed/simple; bh=eyZHP5mUb+/5XFU+iTnTIR95nEgjYlGJs2O6ZYqdplU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=LGnpkhO3eLjKuMxQwsWiJ8KX7Iipq9BRNQA60ytRRvN1W0d1WNloRoLwTQT7AaWthgpwgQShXlWOYKtnGNRr5WF9xMXfcu76ecStU2knuiaI+DdMUvLoAvKb76bZqbf4btFATbJXjcB+ep6J/EyMekh2FpUdZ0G4Su2fyz54X4k= 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=WpG0+eWb; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=WyEib+0u; 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="WpG0+eWb"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="WyEib+0u" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4687fSHF017369; Mon, 8 Jul 2024 11:42:45 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-11-20; bh=sCHF3MIVR5HjKIMbiEuRSfTCjMYovwBt0xTf6g7SMVs=; b= WpG0+eWbvxj4TYFeHt3vMPrffDkBufHlAu1u2sX6W7nQX1ijvShgNffvcBjM6JD+ VMb+tlNDU3AIHVWg2fTtmgIV4oiekgoI14THE5jhFrmugyB73pMIJudzbfL37rA0 e2Xp5uBabbBfLiEMZnDN9Ve9NZ1PRzTFqpHJO0fb4wKiSzzsPd7o6Bmo2KykaCZ7 m1utEYjCXIgOk471QkAlt99YPB8SzfKZiPplYvXbLVPVxdPiNkCL6aLaCGt7JTXJ kptVnVEeblXkBkZ/KP8wrt1BgKvDEUHYQt/8D4UgMwkDO4yDDYqlRvZtiKvexHxL WjWcaCImytPkYymkXMPm/g== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 406wknjdpb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Jul 2024 11:42:45 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 468BCMeG007502; Mon, 8 Jul 2024 11:42:44 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2173.outbound.protection.outlook.com [104.47.58.173]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 407tu1hccj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Jul 2024 11:42:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mj4hzZN2gaVOgRyRXUlPSIUYYS3qEyBWgvuX6JCYIn6lNCUwKW0f0ZdiEyIYuCvwFg4NT60VMUSEj5jgVYnTbQZRmjOM4MwswekhEcQSBysDudbW4neZiHSdQHhKhhVfhQyCL9jw1ggq3999k4ARxLAyVtQWBViFbcDG0Zh7oVtgH0IlLNyBXc24ywXAFPUXoFomdUnAMD859/AqraJ5mNotBoUGsiSWKAqyDhg8wj+HRR09HZjAWFqGGgLb+aiIcqpdKK/DUVbD3m5yFC0IR1eCNexfAL153JQvrnTMbwT3/8R0g4werRELlr5RP6JV5sNQCa015sxIzPTBUPxt0Q== 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=sCHF3MIVR5HjKIMbiEuRSfTCjMYovwBt0xTf6g7SMVs=; b=Z4zLPUzgxYxOPfJPA5Cd+dO9wYa6RT1sOUIvsDSWiF2kvyjoYgXxnQCS47iynLdNGrdvqDVhP+M3qQSOebtyT/j6iylYuTMj06kcW1IAE21kXrtmU/CxtCAroM912AYBg8tjV/F/DKk4VbMmPl6RIFtXMDpud4NIwSb5/Goi6X2BhFnqed157czhKzI72E0yy82yHmLH6xgbl0KUn5kWKwJ5cMJBgNYnriE7+PUCFKafdR+WV9egjvNfqYyedDvume1ysrp1Rj5FgXoTak3hrGIyW5q3PQuOxfT14me/WHX4N9Nm2GIXLW7bmAm6mmH6r8UEyFBgSFiV4WkBX7GO0Q== 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=sCHF3MIVR5HjKIMbiEuRSfTCjMYovwBt0xTf6g7SMVs=; b=WyEib+0uTWXpbZyKrywuh/A29oBWIazSJfgFlGEccHpMGGGcHen5FGLH45Xk1EAyjQ2lFemiFveVb42xylM/U/YWZsoNFKAiAeM3RW2Zn1+QPInnWI0GUJffksHmTZDih3MBVd5PsM4WLQnC4GhnLVH1i4eJOa82Tb2Qj559Tx0= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by PH0PR10MB4454.namprd10.prod.outlook.com (2603:10b6:510:3a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Mon, 8 Jul 2024 11:42: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%6]) with mapi id 15.20.7741.033; Mon, 8 Jul 2024 11:42:43 +0000 From: John Garry To: alx@kernel.org Cc: linux-man@vger.kernel.org, linux-fsdevel@vger.kernel.org, axboe@kernel.dk, hch@lst.de, djwong@kernel.org, dchinner@redhat.com, martin.petersen@oracle.com, Himanshu Madhani , John Garry Subject: [PATCH v3 1/3] statx.2: Document STATX_WRITE_ATOMIC Date: Mon, 8 Jul 2024 11:42:25 +0000 Message-Id: <20240708114227.211195-2-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240708114227.211195-1-john.g.garry@oracle.com> References: <20240708114227.211195-1-john.g.garry@oracle.com> X-ClientProxiedBy: BL1PR13CA0026.namprd13.prod.outlook.com (2603:10b6:208:256::31) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|PH0PR10MB4454:EE_ X-MS-Office365-Filtering-Correlation-Id: 77b33cf9-4252-43d8-44cb-08dc9f431435 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: SSTxjSLSB3D83Am88Wl3xNc3Dm8i4f6IVFLWUtx758varlqQ6LvsqU2V6G6RrlxXfnvv3/OIUpLzp/gteMMeBEza7k99btFTPc0p5KU+XzE+RhaMd4t1POj3t+A2v8tHf+foY5X1Fnr09gZOMKb5JurTWX65ocEK2STTNiNLqKpYFHpAgpSyaif8eVizf+CNEWqAc2gqr2X+F1nAUM4Jr98UNgDzwjigLSf4qATp6Qi9NW3V184rCSa8ew21rZ3Mv/6vzZ0im+q6AZ4DwsDivmnKxZbhCe6naJf4EZiEvayh8QjhloySul8j2Pz3l+nWVP8pJ2MJdN2gnx3RUmNWbnNcN98hWwZkgLsN5rx1c7O/e9yhm0DOd0SnD58OglNXeF18LcOOBAARXBouLFPd4zVo/IYPBo2VmxZHMMrNdudPzl/voROQ4uQOAMUdV9gnOeW18i+2co5t1sMP/jdHEejwrO9YxP5TEAwCK2NLcdSLhtppXpHQmbLhB4Rez4tv0AnRKrIYbZZuWFmLNP84N/AMUgw8/F4StlP8dBrtldM6UaR6FLmVRBWqzGN0sJQQqD5Y1GPqsf5CWui5B/we6xU1vmnaUkJWzdrUxxRHA6ZN0FXM8XRFK1ShRGxDZeKNdnmHrAH3YT9hMiNQtta/QMnd+QP3gSKxOLo6ODoQeoOz/czClWajWyPWmyMD6rjenl+VAnXbZNWsT03cKnpy3Jspb8CJHUhhOn+0Ibbe//sY374XnK/MWeqBd8ydccuT7/McX57B4gC1b6orOsCeJw7XcwaPAavuuEwyZMsdfz7OVXHkqkqJSiDoQ8rMhjxIrdn1cAfTyNhDRWotWcbTiDUMkn/R09XqKg3DPd5O0J9QPzVrYqrgqW0yckHZOgZ9WaEQjz1ktTaWSdKVVuqlU4VD6LBli11hE0TsptyXh/Hc68Mc6f0YnDEewe5xEl9P0M7N0odu1VDhYwwgkF2ES+TEHV61is0f0JZV6nflT1sckxpdSdY5kD4q/Y1oD5YbeoCKF1tQAYDqhCc5+t3O1JKCxqGB42gjv0EBrGb1HGkB8GuUs8Epzuy3W+WVFHOvgDFW1gDVgYT6wYFY0+4pLUfcwL+9a70wJs/k9A1jRdNOIkMEy0GCvYqhDgnXNAjTVokppx0lVYsgFkMWkqySfOVMpcfehtTaD2AG9DeQbWYjlejpCpA+O+D91LRSsyawBwfzAFhrJO8IqPL9Wwsmlki48zHb3KIAs69hJgjr0EZe6HQSX+C/uU5ktYlry7ITV0aMkUnpMHj+/KCDU9z2zm9/Hx+1ZM1s8q41FFAn4H4v2OWsqvbSeocqZQd1Y7prHAR1QQNiTkDwm/9qvxa67A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1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OJmgcV/w3TQCdqGfgQsOiRxBTJhyHDrtW/khqLOY9kqsTtosM5QmIvRUWGEzIO1fdXPHAIut0R4XAwbnyRWA4FTQqtmAh9zLrCF8F4V2Wu6jZiH9W4RFJTf3PEZENmnrWfqWAOhOUA998yhMCuqvLD+D49fecJE4QgA2xs1F2W+ulnoqPSXs0f2mtBnSwPM2W/rg7ec6IVWz1l+i6crA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77b33cf9-4252-43d8-44cb-08dc9f431435 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 11:42:43.1278 (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: r65Yt3z81yd3llZVz65MvBubGL9RPQxZedFlArb2acsoNU0LNy28XgeCDdr5NB8XGNxREIjm4CrFS+NfTtyxxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4454 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-07-08_06,2024-07-05_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 spamscore=0 adultscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2407080089 X-Proofpoint-GUID: Xqwrcl2hpcXCXo9AJVZbrokeCrU1qynO X-Proofpoint-ORIG-GUID: Xqwrcl2hpcXCXo9AJVZbrokeCrU1qynO From: Himanshu Madhani Add the text to the statx man page. Signed-off-by: Himanshu Madhani Signed-off-by: John Garry --- man/man2/statx.2 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/man/man2/statx.2 b/man/man2/statx.2 index 3d47319c6..36ecc8360 100644 --- a/man/man2/statx.2 +++ b/man/man2/statx.2 @@ -70,6 +70,11 @@ struct statx { __u32 stx_dio_offset_align; \& __u64 stx_subvol; /* Subvolume identifier */ +\& + /* Direct I/O atomic write limits */ + __u32 stx_atomic_write_unit_min; + __u32 stx_atomic_write_unit_max; + __u32 stx_atomic_write_segments_max; }; .EE .in @@ -259,6 +264,9 @@ STATX_DIOALIGN Want stx_dio_mem_align and stx_dio_offset_align STATX_MNT_ID_UNIQUE Want unique stx_mnt_id (since Linux 6.8) STATX_SUBVOL Want stx_subvol (since Linux 6.10; support varies by filesystem) +STATX_WRITE_ATOMIC Want stx_atomic_write_unit_min, stx_atomic_write_unit_max, + and stx_atomic_write_segments_max. + (since Linux 6.11; support varies by filesystem) .TE .in .P @@ -463,6 +471,24 @@ Subvolumes are fancy directories, i.e. they form a tree structure that may be walked recursively. Support varies by filesystem; it is supported by bcachefs and btrfs since Linux 6.10. +.I stx_atomic_write_unit_min +The minimum size (in bytes) supported for direct I/O +.RB ( O_DIRECT ) +on the file to be written with torn-write protection. This value is guaranteed +to be a power-of-2. +.TP +.I stx_atomic_write_unit_max +The maximum size (in bytes) supported for direct I/O +.RB ( O_DIRECT ) +on the file to be written with torn-write protection. This value is guaranteed +to be a power-of-2. +.TP +.I stx_atomic_write_segments_max +The maximum number of elements in an array of vectors for a write with +torn-write protection enabled. See +.BR RWF_ATOMIC +flag for +.BR pwritev2 (2). .P For further information on the above fields, see .BR inode (7). @@ -516,6 +542,9 @@ It cannot be written to, and all reads from it will be verified against a cryptographic hash that covers the entire file (e.g., via a Merkle tree). .TP +.BR STATX_ATTR_WRITE_ATOMIC " (since Linux 6.11)" +The file supports torn-write protection. +.TP .BR STATX_ATTR_DAX " (since Linux 5.8)" The file is in the DAX (cpu direct access) state. DAX state attempts to From patchwork Mon Jul 8 11:42:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 13726451 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 D29E42B9D4; Mon, 8 Jul 2024 11:42:54 +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=1720438976; cv=fail; b=rTgvHNErs6aViuwU2YQdbOkGY0mNck6BVgXE81xrPaXtw3ep6PopwCOjUZ0pau9uECvgze+L/i/+gEIZNNg4fSihpKgfM7IeaFpSBWcY7FBnGTRuMf/zbppZpuuexgiTC5CtZqAxW1JFMhOoXCC99qmgxdHgLqWq/h0HPl6pSAI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720438976; c=relaxed/simple; bh=5bQ8NX86qRxb5I1gv88lk0UbcjwfB0MQa2SHXTR5LhE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=HDGjsdVxCgBhbzSUGUxJ9g+JyLAgKZ5dJfJxMKVJ9ohdFroiFi/+SqbTPsplwOKJzHRW7RH1OuSUFi6uleipCcSr/DJmBxxlp4fDTUm+INcmJXEibtZPhCbnp0oHENvL0hMavJnUjU19xR5admO7SZZYNytr7i6z+FFz5L4gwv0= 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=mDRIGh3b; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=vAQWwuWt; 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="mDRIGh3b"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="vAQWwuWt" 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 4687fYSD011958; Mon, 8 Jul 2024 11:42:47 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-11-20; bh=xb/OUh+Fp2Beb9QpU/oFatH5trNYo+2QIQK9nzjzGg0=; b= mDRIGh3bCdwWgfEWOoEXxz14jra8QeYjuXq7Ktdy6hwcsVrZM+/brWV63m6T8nTd 8rtgwYfr5B7tNHnkmvG1gVZdT+NoVyWsRoxAODPXuqWZpWCdI3/0x/8hfa080rPB JQkvLU51IVdkak32S8gZSTa9DcjC9SO9VpbXRBCX+lPJ0tjcdREubF/7xrVTxldc cTD3I1qLwcvuxSb0UnAaR3TLL8WpfSqKX56L/23WEYOBYXLIh8Rh6xLHNrzUorqU O3OLwnKUsRuQcGEDfZV113yjoiyxARs/hq/1E41r8l3mkPAiMcNIMh/xDPZajQaY qhmHhv6GJKhuXOH2MAccQg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 406wybje3c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Jul 2024 11:42:47 +0000 (GMT) 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 468BF9Ih014343; Mon, 8 Jul 2024 11:42:46 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2174.outbound.protection.outlook.com [104.47.58.174]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 407txf98yu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Jul 2024 11:42:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P9r2lHzUC0c/fNrLp0DbkdQi8hraQ+bmw+aEBW81ULRKdyf5sq/UDI/iqeds+YPLfrLJAISU+/RTfo16fkxiYmghc9iTfLQKmwuAAcDlvPOzfx5QS0M3/cJy6Ff5tlqOcx5Y5MaVxEEBCx6sRfqGZwvP/za8RzWwO/lt2VhZwYu7MI0EjD+XNMyFI/9LTr0Gld8pBljz10dB6bKaavWMwX3nPyYtROz4Ra2/o6kmmLi2cinGlOfLkJ4nKcv8DuQ2QfuWBUXsQQI51d/uhzQJ+DSqf3d5jNKxMVkBMwwA6q07DqaTPwUaIIMkfKNVQKWDWDUYhygGxtCK9tvl3mMcpQ== 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=xb/OUh+Fp2Beb9QpU/oFatH5trNYo+2QIQK9nzjzGg0=; b=IsLT5yZOtLVjn31id9gH1UbRRJSlW5ZJkR0daiVJvq8cRzS6h2bHLBRtZee3hE/lozLoL02A1dRuAxc9r2jm8ptgjSXVX6QpnzUFN+OAXZ1NQkv9uK/A4tTTaEE4ObLlAvmWxl+OK0+RewQAGoHoEmms65bV8FGx0AamReyysJVBjs/qpXwDX4BrOfSTPrhk/KMUWavClcV94P7Rc9EuFH27xcHqbVM1CGRbV5lAAg/RQoDi29Dul2FKbZ+Hp7Z2fflGcmt+bj9PYWexBoPySJEAXQK0lz5DhwVGItlAB5zH33nTy5isx5GHqP99ui6h1XZaHBFSMtjwW8Q2RKJqAw== 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=xb/OUh+Fp2Beb9QpU/oFatH5trNYo+2QIQK9nzjzGg0=; b=vAQWwuWtqxUs+t9nHxSrGs6//Dl+gM1iZkxPz4f8gcDrN3ajo+OtT4F/UBhnQPPHnoc+nZ+Y+3mHpmPCWiRzQMEWncGW6X1S4y0LRUElkApNeJBlr98J1DE9csCBTakAbnz//FIgL8NtJBclfOpowsYsRQmQZH/n1KsKRC2J79w= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by PH0PR10MB4454.namprd10.prod.outlook.com (2603:10b6:510:3a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Mon, 8 Jul 2024 11:42:44 +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.7741.033; Mon, 8 Jul 2024 11:42:44 +0000 From: John Garry To: alx@kernel.org Cc: linux-man@vger.kernel.org, linux-fsdevel@vger.kernel.org, axboe@kernel.dk, hch@lst.de, djwong@kernel.org, dchinner@redhat.com, martin.petersen@oracle.com, Himanshu Madhani , John Garry Subject: [PATCH v3 2/3] readv.2: Document RWF_ATOMIC flag Date: Mon, 8 Jul 2024 11:42:26 +0000 Message-Id: <20240708114227.211195-3-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240708114227.211195-1-john.g.garry@oracle.com> References: <20240708114227.211195-1-john.g.garry@oracle.com> X-ClientProxiedBy: BLAPR03CA0145.namprd03.prod.outlook.com (2603:10b6:208:32e::30) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|PH0PR10MB4454:EE_ X-MS-Office365-Filtering-Correlation-Id: b0ddb2f2-c099-4b37-31ce-08dc9f43151d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: Y9Iy27Q2bOCwqSfo2vclDjjhmk0RbXLpWVv+54EHe0p29kS05n3qtFdKmte1jjp4Gsq7yW2UM70SYlEY9afjty4dXJVB/PeYKSM6FKHfzLuN5+uUH4Zw63Q5IW5FJLp0/Js6wKJMbg/6kdeIycKOQEQGAnnDlJDdUcIErJ0MVwvUt9f2a1K0kqNYBQBs8m0DzWjORczeQsV1VrM8oqCKR//q2cfuagV7BST98rHTfj2RxfULAScFoeBt58R91B1Z5U7NXm23f0s2+U3zvzjC1wN4YKrBG2nXUkewznmUv9SI4+MC5gXIY62Bvf6iAucl0sisc+Ad5Eb1FuqGNnvd8+Yje9F10F1dhWMpfzZTBQbWuRZruIHH1qRiJ0fFT7Ctf67mXJHARxUh9q0xJVVLkcqOvlxlG/gTg0zE3HmJzBnR9LKEvcepJMk1UKITs7Zr1MGj3jUsbSFML8O2mypWgGA/0IpmvdETB5Co3xr5E3JcC5cCpb11CoWv0w4p3wdV5WZ8Yx0GbcVWxp680W9yo84N7LkuNceXQzJ2zEqtl31Mw55gAQCSaZaFbCGeAldCNWGo+4X4cGIngQqVfEOK0aZF9pUjYgQ2QPLdqg49dFAEE1tAIB3CC9vvi5geMapyW2UhTXnl0XXamnSZcmVKI9yhYRn6jnqcFhYAjttbFTfmssLWd8Auq29SSk/xEnzzJqEqokwJCvOjyjFXaB47DSFmsD3SfWXxKlhAzE/4Q9iH1zGPyqN4XPQDMcaZHnaoOYuor71Yo9FxY2bDqMHDPbakIXrjrtxPYkOJ+0lUIVGfT1cfqTdUCWnBPW3RxUXy4Ox935G7/yG4/vS9muCm5TpVo/M9QdOZkV+00UnrnsIerLvuTEcNCyUjKvm47sAewP6Aw9T6A4SqYr/WXZhtWlUC17312gtrxTQy9yVzSLyM4rP3FDgB85msAb+wnbekU8nJHyvLY47uQ1URtm723kxWGfp2JPXE2mJfPTFdt23jdvEACnnthN21YYOQwlMi7ht48tYt8/t6PQGNomfenAYMFXJ0SU3C/DdXa3RM7fgx3BXDWNkrc7/rCf+fQO19+y8i97YciYjlgaPOJQVYvemS0pIrNko9wTgM7UD6dKBb+AXHwHI/0ryJQwcHBSXRb2fQK8HhFK6qnW0X8bNXap+hV1EoQFQHNBNW9GKMrPnDdL/F/ALZvWdc2sXg7HgZGdEt7h1rjYqHnmEIt+jq6bUX2vKMskleYf0/qdN3wcmVqyfDyf0iq1kv9HkGQ6sek7bVTvM/DvCH1gOFHBbBTmQZIg8HtNWRqtnJQggd2jNhv7Eti0aCicmGzF6+pXg7QwmEYdglULs6HLev/luqLw== 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)(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N9coRshfJPNwa/bPvefUQuQ2wQbGClINaMrBbztBBRPX83HEQ01XkMtu6GLkRRV7uWaFP2Kpa0HSs3fpYACjdWQT63rzbJaY868nJCWYWj+jl0pbyGn385zIeE6WgVrDaUV0ci09uGae9XqT6zxlnRRa+dIJgpYfK/ZZh2J2UaJclY14cdQdcT34Ioc2Vzp/95FCbzQJOGdtS+5gaH+sd29DvT9HJKod++Hs1WCkDbyF5d9qZoUnhUHu8BVaHV93WGUrw9p+w= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0ddb2f2-c099-4b37-31ce-08dc9f43151d X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 11:42:44.6421 (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: JPmSBIA6KSaUN08CBPSehBEVMPcB2UBtyox7FqqxhoevzXcRg8FiGi42HI7j9dkAgy1u7luRtwvKgc3DbfgEaw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4454 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-07-08_06,2024-07-05_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 bulkscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2407080089 X-Proofpoint-GUID: 4Vq8wO0UQKHSTHOYwNZc4tYVVpBCuhVo X-Proofpoint-ORIG-GUID: 4Vq8wO0UQKHSTHOYwNZc4tYVVpBCuhVo From: Himanshu Madhani Add RWF_ATOMIC flag description for pwritev2(). Signed-off-by: Himanshu Madhani [jpg: complete rewrite] Signed-off-by: John Garry --- man/man2/readv.2 | 73 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/man/man2/readv.2 b/man/man2/readv.2 index eecde06dc..78d8305e3 100644 --- a/man/man2/readv.2 +++ b/man/man2/readv.2 @@ -193,6 +193,61 @@ which provides lower latency, but may use additional resources. .B O_DIRECT flag.) .TP +.BR RWF_ATOMIC " (since Linux 6.11)" +Requires that writes to regular files in block-based filesystems be issued with +torn-write protection. Torn-write protection means that for a power failure or +any other hardware failure, all or none of the data from the write will be +stored, but never a mix of old and new data. This flag is meaningful only for +.BR pwritev2 (), +and its effect applies only to the data range written by the system call. +The total write length must be power-of-2 and must be sized between +.I stx_atomic_write_unit_min + and +.I stx_atomic_write_unit_max +, both inclusive. The +write must be at a naturally-aligned offset within the file with respect to the +total write length - for example, a write of length 32KB at a file offset of +32KB is permitted, however a write of length 32KB at a file offset of 48KB is +not permitted. The upper limit of +.I iovcnt +for +.BR pwritev2 () +is in +.I stx_atomic_write_segments_max. +Torn-write protection only works with +.B O_DIRECT +flag, i.e. buffered writes are not supported. To guarantee consistency from +the write between a file's in-core state with the storage device, +.BR fdatasync (2), +or +.BR fsync (2), +or +.BR open (2) +and either +.B O_SYNC +or +.B O_DSYNC, +or +.B pwritev2 () +and either +.B RWF_SYNC +or +.B RWF_DSYNC +is required. Flags +.B O_SYNC +or +.B RWF_SYNC +provide the strongest guarantees for +.BR RWF_ATOMIC, +in that all data and also file metadata updates will be persisted for a +successfully completed write. Just using either flags +.B O_DSYNC +or +.B RWF_DSYNC +means that all data and any file updates will be persisted for a successfully +completed write. Not using any sync flags means that there +is no guarantee that data or filesystem updates are persisted. +.TP .BR RWF_SYNC " (since Linux 4.7)" .\" commit e864f39569f4092c2b2bc72c773b6e486c7e3bd9 Provide a per-write equivalent of the @@ -279,10 +334,26 @@ values overflows an .I ssize_t value. .TP +.B EINVAL + For +.BR RWF_ATOMIC +set, +the combination of the sum of the +.I iov_len +values and the +.I offset +value +does not comply with the length and offset torn-write protection rules. +.TP .B EINVAL The vector count, .IR iovcnt , -is less than zero or greater than the permitted maximum. +is less than zero or greater than the permitted maximum. For +.BR RWF_ATOMIC +set, this maximum is in +.I stx_atomic_write_segments_max +from +.I statx. .TP .B EOPNOTSUPP An unknown flag is specified in \fIflags\fP. From patchwork Mon Jul 8 11:42:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 13726452 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 474A778C75; Mon, 8 Jul 2024 11:44:57 +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=1720439098; cv=fail; b=kg9NT6ZrBDc0yJ3p9HWRbQLaqjKdLO6tbtBpJ6bj+e1BZBI7vx7L5rWsE0HybrCqNbbPDjuF8NCPFrD77kJD3SRLagz+9PKOpNIyMLAXbz3G+MQRdgv4rIHolyJBYCVCmQ/HrJCAWuiFoOsjKKwgqku30s7npIWIeSfW4cydjJg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720439098; c=relaxed/simple; bh=tIU1k6+5ierHaB9xfoAaIM1AsL6e9FpBJWhaSKt5Ruo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=GsMDVqaF5kKslgI9viJ29ydhsoRuaLknZBxVzLVl7piwh9uHN1npXHCPyktqjpbQrsz0eV74oaGdWj/k5Qrtv3mbO/CS6ykgt18hYuyFq5LsBWgYMvf8oCZ/ftVfpP+PKoCiHh2NYuyxclDpZeJOgnkvZCspqLO0niGa8JdA2PA= 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=VUqDR/x8; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=UHKZFX8V; 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="VUqDR/x8"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="UHKZFX8V" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4687fT97017381; Mon, 8 Jul 2024 11:42:49 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-11-20; bh=v7AsdXcCPVPAZxrzQhNhlYIKZDnq2FMf+utEDc8C5Kw=; b= VUqDR/x8mTOh1VcYwSOMwphKmdyPVVXbL8b+kjXjrwbyNEN+Uo7SqJAKoUAZCQ0L wTX3oapawrQ1OORoLBYJj4jhHEbAP4mJTqEzDB+McT6Mq02WR9K4Ee3nDiTd+pDz FI81HmMphJdi/NHw7k7cH/O1nD0M+E5TTeSsnvJpJqyGxQh0zEv50IjMdKk6Qd5X YCuxukaRX0wDpEIrJ6x+IPh63zVc4UZ2KP1ZpZeAYbbn3Nof5E4WdVbR0Zv4JOfE 4HCyN71qExS5zNJBNkKNL09f6leyrw9Hb4iAkts7sH2MPrKxzYsFztJUGJJVHNMd P+rAwiif5H1y641OgDrOxg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 406wknjdpg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Jul 2024 11:42:49 +0000 (GMT) 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 468BUeEQ013665; Mon, 8 Jul 2024 11:42:48 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 407txf990m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Jul 2024 11:42:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WWnDIelnc97woAMbHsEAn3R7DrCHWvPvXYSeki50V/cOmjRYAjxrOZ2Sm8tRGS08vpzMJhrCGuB59A6PkNVLzlKQtGgiGNwSipMugGhHRNl+6v5iAMD1Ic6ZpV63dPXxrwKCt0W6MEEVa7jo4G07Kf2FCVOF3sxM6DFl4cDg2YLv8depkg5TK17MluIJUPl8+0C3i93g2cQ77W17SCDXNZLPc73UAYuZLZmBRiBn2ayf1kqyX5ti5tcxUfXJlFPsJuvMioxvOcPiWIS/G0EWxYNbTrk6k0TEbYLllxwkM5SdTaNbevAd1TTcP1QDkYu8VV2SKGVO1katYpKz3arBlg== 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=v7AsdXcCPVPAZxrzQhNhlYIKZDnq2FMf+utEDc8C5Kw=; b=hxwvzdLrAkyAv5S0cEJbP6KP7Qad71N+RS7R5shwQgaZTi0JtRUxV+QXp42kCaAxd0aitAIXnbiyPydbLGr3PfzBFXzkR3UWKwKc0/HLwiESvb5ydrOTURXXtxJduUYbybMq5PdKYbEqzkbyNvoHZWcgrReMI8ye3aKV90xCiUv8AOQenqlqE9YXjE5Wor6m3ZipjAh5W7+mLAfg9GWz5LULf5GbO+9CZaZJKYhXQFjl6HJ2qlJXMA72mxfUvcH4cEeW+9s90/q/dF3w3bkkfXi5jhDXVSkY15hq6plF6vX48t0xBhI+1uVmow335XmOAjh0oxHN7E+MrcMbPyHsvQ== 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=v7AsdXcCPVPAZxrzQhNhlYIKZDnq2FMf+utEDc8C5Kw=; b=UHKZFX8V1cwypHhpa8WGtTkzIAyj1AcXRPSZeCScVvC6179/KtJiPwwIj4ou3emsxBTzd3MFKdrHja5rK+r7JsHOHC0rljdfjTPSciFQVZzVFRV4H9ptj53JdA5j4B9X/RVWJFchtbLv4qa0y8BbeHnAQrhaI20OaHBut0SXst4= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by PH0PR10MB4454.namprd10.prod.outlook.com (2603:10b6:510:3a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Mon, 8 Jul 2024 11:42:46 +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.7741.033; Mon, 8 Jul 2024 11:42:46 +0000 From: John Garry To: alx@kernel.org Cc: linux-man@vger.kernel.org, linux-fsdevel@vger.kernel.org, axboe@kernel.dk, hch@lst.de, djwong@kernel.org, dchinner@redhat.com, martin.petersen@oracle.com, John Garry Subject: [PATCH v3 3/3] io_submit.2: Document RWF_ATOMIC Date: Mon, 8 Jul 2024 11:42:27 +0000 Message-Id: <20240708114227.211195-4-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240708114227.211195-1-john.g.garry@oracle.com> References: <20240708114227.211195-1-john.g.garry@oracle.com> X-ClientProxiedBy: BL1P222CA0005.NAMP222.PROD.OUTLOOK.COM (2603:10b6:208:2c7::10) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|PH0PR10MB4454:EE_ X-MS-Office365-Filtering-Correlation-Id: 5266b2d3-d29f-4f6a-f16b-08dc9f43163b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: lYh3G8X9XT0Ag9CUCxwfEBBff7oZM37pHbWlmpetd8OPNS9d24l1BDA0M9XIj07FBn82NIX/co4f/cyxWy3wjd67v/Ozmph7fBNc8eBd7psMuzFiqk8iKWUViLL4z0tDO7K1xNWAwK1sbMcc540epIxN/Jsq6vDipP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6tkKBll/gEZ8wTJWGvg2ftfII2fRX7CVOnBa1/GMiKQbWIDll8goktYKZ6A7/v8fB5FQwxKLTY+HhBw4ipQu9b9OqJvzY+CA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rv18cAolxW3FxfTEoAw8EydxgB+91m+rCU75R7H04kgyF8CIed/RyK4iH/GuSG+Vyw7m42uVUqJjAIb1s/8I9oK7gV+KZpVPL2KLOMHTlw0dNsDLRKJv9puiu5U/Npq/gLPBbdNdMlddazZX1f93/jDpGSPeJ2WWehFFPZ/jOASFGJsrVeXi6wnQeTRZJFIHImmAhPM35UCHpp2nxskXc8osEm5cIbbI4MvcFD/KTm1eY0/xGd+2qw5HEuQtE1JmqoVCHr/j40okLSl055CDeeO+mpM3z8cz4tjxRZSPYaZPWl1bzKyZSXM4MfktyDrqau/2NLZZXbPxsnRYgBi1yLrdeIn1L2s2lwPpVl+16paHkBXWvwsKiZRYcUvIGyazwpOXq7pedEwtj5AJABuMKY7Sm8kyqY8Vf+5D7+UvR+a78w30LB0sdQ6a8Ix5Ph7lm4TCvc78efKii8GcGFZoepw15+slIi0cyv5JHydnnHZwsekqEQ9cNUpwOk976UxywXTQfQwPXO2juW/tZCH/B4lyRkg6kGo/dLWsJR53/NYkJgnuG2aZr2bEp0IbsGnjMcXd7pHGNoVNJy2s9DGdS0JaDauNn05lHd6gwlMJK/vejNlsssNRe14VM6ZBWZD12GptX4jLn2C2ZXv6YkO6ety9b8NnQzKspR5Ww6zArnrZ74B31ApXTNUzQp/GruGqwQvZDUJVRuPVduWp3q2Xe6V9CN5HRfvFaK6Oj+qNyiy0796LvHEXNdanxB8fZxVfjPNHvpi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Tl12677UkIcGETX3C9lbdR1Jpb/GolPrw3nsgC1N8uvmgU2HUJVIf7RpSFHcxMCIyygpp/fQ+HOBZDty1q8uXEHRImX1r0SumTiRf9mcGcrsYekP0MeTqt+Z/6cgd/VwcSEAv5JLoQGT6vp+wz6wbClyl02PN3e4gd/QsfeTqAGDRXiEiihhUDL4XAYbvjDtpoN0Y6cLJgt0GxYVJ+gOP7PaFf3MCLDaw68t2tpb5UhqpTvwb0XSfK/ZycqTTZEnxno991xsSGWkrZowlkOm/UxwXnPyKGSniD7QuTJLbbh3t6mrEfSihJnPymZHgPisNLg51Pq3ThsE2RWRE6UmLiCaG2+nIYOyqKr+SPPdD2kFqy56Jvq+r2CxYhexjvE/ppZ0l+6qURS76Q59j7MU7xbZwgjFZ9V32OurntL+ZMcsV4i+CFea19z4rwlg2BN7jZZJ44Jo+tQGEbKaIYF4YSGYOk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5266b2d3-d29f-4f6a-f16b-08dc9f43163b X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 11:42:46.5924 (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: ivMayjrJn2gDdAu5ig5X+OODePzIcaeiNSOn5xZqDzhWf9FXp2zKueM0sVmhi6Oq6kpGzv5STwwy2+kfL4ymeA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4454 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-07-08_06,2024-07-05_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 bulkscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2407080089 X-Proofpoint-GUID: 1mnfvAeb9_CykNwItJBEIa1fbhBRP7b0 X-Proofpoint-ORIG-GUID: 1mnfvAeb9_CykNwItJBEIa1fbhBRP7b0 Document RWF_ATOMIC for asynchronous I/O. Signed-off-by: John Garry --- man/man2/io_submit.2 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/man/man2/io_submit.2 b/man/man2/io_submit.2 index c53ae9aaf..ef6414d24 100644 --- a/man/man2/io_submit.2 +++ b/man/man2/io_submit.2 @@ -140,6 +140,23 @@ as well the description of .B O_SYNC in .BR open (2). +.TP +.BR RWF_ATOMIC " (since Linux 6.11)" +Write a block of data such that a write will never be +torn from power fail or similar. See the description +of the flag of the same name in +.BR pwritev2 (2). +For usage with +.BR IOCB_CMD_PWRITEV, +the upper vector limit is in +.I stx_atomic_write_segments_max. +See +.B STATX_WRITE_ATOMIC +and +.I stx_atomic_write_segments_max +description +in +.BR statx (2). .RE .TP .I aio_lio_opcode