[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9ba10b14-931b-42db-b7c2-e6f9aa95e477@acm.org>
Date: Tue, 3 Oct 2023 12:25:58 -0700
From: Bart Van Assche <bvanassche@....org>
To: John Garry <john.g.garry@...cle.com>, linux-kernel@...r.kernel.org,
linux-api@...r.kernel.org
Cc: martin.petersen@...cle.com, djwong@...nel.org, david@...morbit.com,
himanshu.madhani@...cle.com
Subject: Re: [PATCH 2/4] readv.2: Document RWF_ATOMIC flag
On 9/29/23 02:37, John Garry wrote:
> +.BR RWF_ATOMIC " (since Linux 6.7)"
> +Allows block-based filesystems to indicate that write operations will be issued
> +with torn-write protection. Torn-write protection means that for a power 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
> +stx_atomic_write_unit_min and stx_atomic_write_unit_max, both inclusive. The
> +write must be at a natural offset within the file with respect to the total
> +write length. 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,
It seems wrong to me to start the first sentence with "Allows". Atomic
behavior should be mandatory if RWF_ATOMIC has been set.
Additionally, shouldn't it be documented what value will be stored in
errno if the atomic write has been rejected?
Thanks,
Bart.
Powered by blists - more mailing lists