From: John Garry <john.g.garry@oracle.com>
To: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org
Cc: martin.petersen@oracle.com, djwong@kernel.org,
david@fromorbit.com, himanshu.madhani@oracle.com,
John Garry <john.g.garry@oracle.com>
Subject: [PATCH 2/4] readv.2: Document RWF_ATOMIC flag
Date: Fri, 29 Sep 2023 09:37:15 +0000 [thread overview]
Message-ID: <20230929093717.2972367-3-john.g.garry@oracle.com> (raw)
In-Reply-To: <20230929093717.2972367-1-john.g.garry@oracle.com>
From: Himanshu Madhani <himanshu.madhani@oracle.com>
Add RWF_ATOMIC flag description for pwritev2().
Signed-off-by: Himanshu Madhani <himanshu.madhani@oracle.com>
#jpg: complete rewrite
Signed-off-by: John Garry <john.g.garry@oracle.com>
---
man2/readv.2 | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/man2/readv.2 b/man2/readv.2
index fa9b0e4e44a2..ff09f3bc9792 100644
--- a/man2/readv.2
+++ b/man2/readv.2
@@ -193,6 +193,51 @@ which provides lower latency, but may use additional resources.
.B O_DIRECT
flag.)
.TP
+.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,
+.BR fdatasync (2)
+or
+.BR fsync (2)
+or
+.BR open (2)
+and
+.B O_SYNC
+or
+.B O_DSYNC
+or
+.B pwritev2 ()
+flag
+.B RWF_SYNC
+or
+.B RWF_DSYNC
+is required.
+For when regular files are opened with
+.BR open (2)
+but without
+.B O_SYNC
+or
+.B O_DSYNC
+and the
+.BR pwritev2()
+call is made without
+.B RWF_SYNC
+or
+.BR RWF_DSYNC
+set, the range metadata must already be flushed to storage and the data range
+must not be in unwritten state, shared, a preallocation, or a hole.
+.TP
.BR RWF_SYNC " (since Linux 4.7)"
.\" commit e864f39569f4092c2b2bc72c773b6e486c7e3bd9
Provide a per-write equivalent of the
--
2.31.1
next prev parent reply other threads:[~2023-09-29 9:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-29 9:37 [PATCH 0/4] man2: Document RWF_ATOMIC John Garry
2023-09-29 9:37 ` [PATCH 1/4] statx.2: Document STATX_WRITE_ATOMIC John Garry
2023-09-29 9:37 ` John Garry [this message]
2023-10-03 19:25 ` [PATCH 2/4] readv.2: Document RWF_ATOMIC flag Bart Van Assche
2023-10-04 8:47 ` John Garry
2023-10-04 17:36 ` Bart Van Assche
2023-10-04 22:48 ` Dave Chinner
2023-10-09 17:44 ` Darrick J. Wong
2023-10-09 20:39 ` Dave Chinner
2023-10-09 21:05 ` Darrick J. Wong
2023-10-24 12:35 ` John Garry
2023-10-24 15:39 ` Darrick J. Wong
2023-10-24 12:30 ` John Garry
2023-10-24 15:39 ` Darrick J. Wong
2023-09-29 9:37 ` [PATCH 3/4] man2/open.2: Document RWF_ATOMIC John Garry
2023-09-29 9:37 ` [PATCH 4/4] io_submit.2: " John Garry
2023-10-09 17:45 ` Darrick J. Wong
2023-10-24 11:51 ` John Garry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230929093717.2972367-3-john.g.garry@oracle.com \
--to=john.g.garry@oracle.com \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=himanshu.madhani@oracle.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.