* support ZONE_RESET_ALL in liburing
@ 2026-07-15 6:39 Christoph Hellwig
2026-07-15 6:39 ` [PATCH 1/5] configure: shorten the message for the discard command Christoph Hellwig
` (4 more replies)
0 siblings, 5 replies; 13+ messages in thread
From: Christoph Hellwig @ 2026-07-15 6:39 UTC (permalink / raw)
To: Jens Axboe; +Cc: Damien Le Moal, io-uring
Hi Jens,
this is the liburing support for the just submitted ZONE_RESET_ALL uring
cmd support. Also a few fixup for the discard support that stood model.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/5] configure: shorten the message for the discard command
2026-07-15 6:39 support ZONE_RESET_ALL in liburing Christoph Hellwig
@ 2026-07-15 6:39 ` Christoph Hellwig
2026-07-15 8:27 ` Damien Le Moal
2026-07-15 6:39 ` [PATCH 2/5] man: fixups for io_uring_prep_cmd_discard.3 Christoph Hellwig
` (3 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Christoph Hellwig @ 2026-07-15 6:39 UTC (permalink / raw)
To: Jens Axboe; +Cc: Damien Le Moal, io-uring
The current message is pretty long, drop the redundant io_uring.
This aligns it with the soon to be added zone_reset_all message.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index 39c377c9bf8b..b953eddd6ddc 100755
--- a/configure
+++ b/configure
@@ -467,7 +467,7 @@ EOF
if compile_prog "" "" "discard command"; then
discard_cmd="yes"
fi
-print_config "io_uring discard command support" "$discard_cmd"
+print_config "discard command support" "$discard_cmd"
##########################################
# Check idtype_t support
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/5] man: fixups for io_uring_prep_cmd_discard.3
2026-07-15 6:39 support ZONE_RESET_ALL in liburing Christoph Hellwig
2026-07-15 6:39 ` [PATCH 1/5] configure: shorten the message for the discard command Christoph Hellwig
@ 2026-07-15 6:39 ` Christoph Hellwig
2026-07-15 8:28 ` Damien Le Moal
2026-07-15 6:39 ` [PATCH 3/5] liburiung: add io_uring_prep_cmd_zone_reset Christoph Hellwig
` (2 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Christoph Hellwig @ 2026-07-15 6:39 UTC (permalink / raw)
To: Jens Axboe; +Cc: Damien Le Moal, io-uring
Mention the ioctl this is modelled after instead of the io_uring
cmd used to implement io_uring_prep_cmd_discard.3, and drop an
incorrect plural for page cache.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
man/io_uring_prep_cmd_discard.3 | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/man/io_uring_prep_cmd_discard.3 b/man/io_uring_prep_cmd_discard.3
index 97786726f03b..349df86ff9c9 100644
--- a/man/io_uring_prep_cmd_discard.3
+++ b/man/io_uring_prep_cmd_discard.3
@@ -26,14 +26,14 @@ to start discarding
at the specified
.IR offset .
-The command is an asynchronous equivalent of
-.B BLOCK_URING_CMD_DISCARD
+The command is an asynchronous equivalent of the
+.B BLKDISCARD
ioctl with a few differences. It allows multiple parallel discards, and it does
not exclude concurrent writes and reads. As a result, it may lead to races for
the data on the disk, if the application has IO inflight for the same ranges
that the discard operates on. It's the user's responsibility to account for that.
-Furthermore, only best efforts are done to invalidate page caches. The user has
-to make sure that no other inflight requests are modifying or reading the
+Furthermore, only best efforts are done to invalidate the page cache. The user
+has to make sure that no other inflight requests are modifying or reading the
range(s). If that is the case, it might result in stale page cache and data
inconsistencies.
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 3/5] liburiung: add io_uring_prep_cmd_zone_reset
2026-07-15 6:39 support ZONE_RESET_ALL in liburing Christoph Hellwig
2026-07-15 6:39 ` [PATCH 1/5] configure: shorten the message for the discard command Christoph Hellwig
2026-07-15 6:39 ` [PATCH 2/5] man: fixups for io_uring_prep_cmd_discard.3 Christoph Hellwig
@ 2026-07-15 6:39 ` Christoph Hellwig
2026-07-15 8:30 ` Damien Le Moal
2026-07-15 15:09 ` Caleb Sander Mateos
2026-07-15 6:39 ` [PATCH 4/5] man: add io_uring_prep_cmd_zone_reset_all.3 man page Christoph Hellwig
2026-07-15 6:39 ` [PATCH 5/5] test: add zone_reset_all command test Christoph Hellwig
4 siblings, 2 replies; 13+ messages in thread
From: Christoph Hellwig @ 2026-07-15 6:39 UTC (permalink / raw)
To: Jens Axboe; +Cc: Damien Le Moal, io-uring
Add a helper for io_uring zone_reset_all commands.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
configure | 31 +++++++++++++++++++++++++++++++
src/include/liburing.h | 7 +++++++
src/liburing-ffi.map | 5 +++++
3 files changed, 43 insertions(+)
diff --git a/configure b/configure
index b953eddd6ddc..8c5ca801f487 100755
--- a/configure
+++ b/configure
@@ -469,6 +469,21 @@ if compile_prog "" "" "discard command"; then
fi
print_config "discard command support" "$discard_cmd"
+##########################################
+# Check block zone_reset_all cmd support
+zone_reset_all_cmd="no"
+cat > $TMPC << EOF
+#include <linux/blkdev.h>
+int main(void)
+{
+ return BLOCK_URING_CMD_ZONE_RESET_ALL;
+}
+EOF
+if compile_prog "" "" "zone_reset_all command"; then
+ zone_reset_all_cmd="yes"
+fi
+print_config "zone_reset_all command support" "$zone_reset_all_cmd"
+
##########################################
# Check idtype_t support
has_idtype_t="no"
@@ -797,6 +812,22 @@ else cat >> $compat_h << EOF
EOF
fi
+if test "$zone_reset_all_cmd" != "yes"; then
+cat >> $compat_h << EOF
+
+#include <linux/ioctl.h>
+
+#ifndef BLOCK_URING_CMD_ZONE_RESET_ALL
+#define BLOCK_URING_CMD_ZONE_RESET_ALL _IO(0x12, 1)
+#endif
+
+EOF
+else cat >> $compat_h << EOF
+#include <linux/blkdev.h>
+
+EOF
+fi
+
cat >> $compat_h << EOF
#endif
EOF
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 0188937b0de4..214c7778d6a7 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -1685,6 +1685,13 @@ IOURINGINLINE void io_uring_prep_cmd_discard(struct io_uring_sqe *sqe,
sqe->addr3 = nbytes;
}
+IOURINGINLINE void io_uring_prep_cmd_zone_reset_all(struct io_uring_sqe *sqe,
+ int fd)
+ LIBURING_NOEXCEPT
+{
+ io_uring_prep_uring_cmd(sqe, BLOCK_URING_CMD_ZONE_RESET_ALL, fd);
+}
+
IOURINGINLINE void io_uring_prep_pipe(struct io_uring_sqe *sqe, int *fds,
int pipe_flags)
{
diff --git a/src/liburing-ffi.map b/src/liburing-ffi.map
index bd7bc64416d3..fc9701b63907 100644
--- a/src/liburing-ffi.map
+++ b/src/liburing-ffi.map
@@ -275,3 +275,8 @@ LIBURING_2.15 {
io_uring_register_zcrx_ctrl;
io_uring_register_query;
} LIBURING_2.14;
+
+LIBURING_2.16 {
+ global:
+ io_uring_prep_cmd_zone_reset_all;
+} LIBURING_2.14;
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 4/5] man: add io_uring_prep_cmd_zone_reset_all.3 man page
2026-07-15 6:39 support ZONE_RESET_ALL in liburing Christoph Hellwig
` (2 preceding siblings ...)
2026-07-15 6:39 ` [PATCH 3/5] liburiung: add io_uring_prep_cmd_zone_reset Christoph Hellwig
@ 2026-07-15 6:39 ` Christoph Hellwig
2026-07-15 8:33 ` Damien Le Moal
2026-07-15 15:25 ` Gabriel Krisman Bertazi
2026-07-15 6:39 ` [PATCH 5/5] test: add zone_reset_all command test Christoph Hellwig
4 siblings, 2 replies; 13+ messages in thread
From: Christoph Hellwig @ 2026-07-15 6:39 UTC (permalink / raw)
To: Jens Axboe; +Cc: Damien Le Moal, io-uring
Add doccumentation for the new zone reset all io_uring cmd.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
man/io_uring_prep_cmd_zone_reset_all.3 | 54 ++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
create mode 100644 man/io_uring_prep_cmd_zone_reset_all.3
diff --git a/man/io_uring_prep_cmd_zone_reset_all.3 b/man/io_uring_prep_cmd_zone_reset_all.3
new file mode 100644
index 000000000000..251a300c5ed1
--- /dev/null
+++ b/man/io_uring_prep_cmd_zone_reset_all.3
@@ -0,0 +1,54 @@
+.\" Copyright (C) 2026 Christoph Hellwig <hch@lst.de>
+.\"
+.\" SPDX-License-Identifier: LGPL-2.0-or-later
+.\"
+.TH io_uring_prep_cmd_zone_reset_all 3 "Jul 14, 2026" "liburing-2.8" "liburing Manual"
+.SH NAME
+io_uring_prep_cmd_zone_reset_all \- prepare a zone_reset_all command
+.SH SYNOPSIS
+.nf
+.B #include <liburing.h>
+.PP
+.BI "void io_uring_prep_cmd_zone_reset_all(struct io_uring_sqe *" sqe ", int " fd ");"
+.fi
+.SH DESCRIPTION
+The
+.BR io_uring_prep_cmd_zone_reset_all (3)
+function prepares a zone_reset_all command request. The submission queue entry
+.I sqe
+is setup to reset all sequential write required zones on the block device
+pointed to by
+.IR fd .
+
+This command does not synchronize against concurrent file operations, including
+but not limited to reads, write, ioctls and other uring_cmds and only performs
+a best effort invalidation of the page cache for the device. The user has
+to make sure that no other in-flight requests are modifying or reading the
+range(s). If that is the case, it might result in stale page cache and data
+inconsistencies.
+
+Available since Linux 7.TBD.
+
+.SH RETURN VALUE
+None
+.SH ERRORS
+The CQE
+.I res
+field will contain the result of the operation. On success, this field will be
+set to
+.B 0 .
+On error, a negative error value is returned. Note that where synchronous
+system calls will return
+.B -1
+on failure and set
+.I errno
+to the actual error value, io_uring never uses
+.IR errno .
+Instead it returns the negated
+.I errno
+directly in the CQE
+.I res
+field.
+.SH SEE ALSO
+.BR io_uring_get_sqe (3),
+.BR io_uring_submit (3),
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 5/5] test: add zone_reset_all command test
2026-07-15 6:39 support ZONE_RESET_ALL in liburing Christoph Hellwig
` (3 preceding siblings ...)
2026-07-15 6:39 ` [PATCH 4/5] man: add io_uring_prep_cmd_zone_reset_all.3 man page Christoph Hellwig
@ 2026-07-15 6:39 ` Christoph Hellwig
2026-07-15 8:35 ` Damien Le Moal
4 siblings, 1 reply; 13+ messages in thread
From: Christoph Hellwig @ 2026-07-15 6:39 UTC (permalink / raw)
To: Jens Axboe; +Cc: Damien Le Moal, io-uring
Basic sanity checking for the simply zone_reset_all command, mostly
taken from the discard test.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
test/Makefile | 1 +
test/cmd-zone-reset-all.c | 164 ++++++++++++++++++++++++++++++++++++++
2 files changed, 165 insertions(+)
create mode 100644 test/cmd-zone-reset-all.c
diff --git a/test/Makefile b/test/Makefile
index d88a428774cc..8b276817d33c 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -90,6 +90,7 @@ test_srcs := \
connect-rep.c \
coredump.c \
cmd-discard.c \
+ cmd-zone-reset-all.c \
cq-full.c \
cq-overflow.c \
cq-peek-batch.c \
diff --git a/test/cmd-zone-reset-all.c b/test/cmd-zone-reset-all.c
new file mode 100644
index 000000000000..5d8fe4d5f380
--- /dev/null
+++ b/test/cmd-zone-reset-all.c
@@ -0,0 +1,164 @@
+/* SPDX-License-Identifier: MIT */
+
+#include <stdio.h>
+#include <assert.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <linux/fs.h>
+
+#include "liburing.h"
+#include "helpers.h"
+
+static const char *filename;
+
+static int queue_zone_reset_all(struct io_uring *ring, int bdev_fd)
+{
+ struct io_uring_sqe *sqe;
+ struct io_uring_cqe *cqe;
+ int err;
+
+ sqe = io_uring_get_sqe(ring);
+ assert(sqe != NULL);
+ io_uring_prep_cmd_zone_reset_all(sqe, bdev_fd);
+
+ err = io_uring_submit_and_wait(ring, 1);
+ if (err != 1) {
+ fprintf(stderr, "io_uring_submit_and_wait failed %d\n", err);
+ exit(1);
+ }
+
+ err = io_uring_wait_cqe(ring, &cqe);
+ if (err) {
+ fprintf(stderr, "io_uring_wait_cqe failed %d\n", err);
+ exit(1);
+ }
+
+ err = cqe->res;
+ io_uring_cqe_seen(ring, cqe);
+ return err;
+}
+
+
+static int basic_cmd_test(struct io_uring *ring)
+{
+ int ret, fd;
+
+ fd = open(filename, O_DIRECT | O_RDWR | O_EXCL);
+ if (fd < 0) {
+ if (errno == EINVAL || errno == EBUSY)
+ return T_EXIT_SKIP;
+ fprintf(stderr, "open failed %i\n", errno);
+ return T_EXIT_FAIL;
+ }
+
+ ret = queue_zone_reset_all(ring, fd);
+ if (ret) {
+ if (ret == -EINVAL || ret == -EOPNOTSUPP) {
+ printf("cmd not supported, skip\n");
+ ret = T_EXIT_SKIP;
+ } else {
+ fprintf(stderr, "cmd_issue_verify fail ret %i\n", ret);
+ fprintf(stderr, "cmd fail\n");
+ ret = T_EXIT_FAIL;
+ }
+ }
+
+ close(fd);
+ return ret;
+}
+
+static int test_rdonly(struct io_uring *ring)
+{
+ int ret, fd;
+ int ro;
+
+ fd = open(filename, O_DIRECT | O_RDONLY | O_EXCL);
+ if (fd < 0) {
+ if (errno == EINVAL || errno == EBUSY)
+ return T_EXIT_SKIP;
+ fprintf(stderr, "open failed %i\n", errno);
+ return T_EXIT_FAIL;
+ }
+
+ ret = queue_zone_reset_all(ring, fd);
+ if (ret >= 0) {
+ fprintf(stderr, "discarded with O_RDONLY %i\n", ret);
+ return 1;
+ }
+ close(fd);
+
+ fd = open(filename, O_DIRECT | O_RDWR | O_EXCL);
+ if (fd < 0) {
+ if (errno == EINVAL || errno == EBUSY)
+ return T_EXIT_SKIP;
+ fprintf(stderr, "open failed %i\n", errno);
+ return T_EXIT_FAIL;
+ }
+
+ ro = 1;
+ ret = ioctl(fd, BLKROSET, &ro);
+ if (ret) {
+ fprintf(stderr, "BLKROSET 1 failed %i\n", errno);
+ return T_EXIT_FAIL;
+ }
+
+ ret = queue_zone_reset_all(ring, fd);
+ if (ret >= 0) {
+ fprintf(stderr, "discarded with O_RDONLY %i\n", ret);
+ return 1;
+ }
+
+ ro = 0;
+ ret = ioctl(fd, BLKROSET, &ro);
+ if (ret) {
+ fprintf(stderr, "BLKROSET 0 failed %i\n", errno);
+ return T_EXIT_FAIL;
+ }
+ close(fd);
+ return 0;
+}
+
+int main(int argc, char *argv[])
+{
+ struct io_uring ring;
+ int fd, ret;
+
+ if (argc != 2)
+ return T_EXIT_SKIP;
+ filename = argv[1];
+
+ fd = open(filename, O_DIRECT | O_RDONLY | O_EXCL);
+ if (fd < 0) {
+ if (errno == EINVAL || errno == EBUSY)
+ return T_EXIT_SKIP;
+ fprintf(stderr, "open failed %i\n", errno);
+ return T_EXIT_FAIL;
+ }
+ close(fd);
+
+ ret = io_uring_queue_init(16, &ring, 0);
+ if (ret) {
+ fprintf(stderr, "queue init failed: %d\n", ret);
+ return T_EXIT_FAIL;
+ }
+
+ ret = basic_cmd_test(&ring);
+ if (ret == T_EXIT_FAIL) {
+ fprintf(stderr, "basic_cmd_test() failed\n");
+ return T_EXIT_FAIL;
+ }
+
+ ret = test_rdonly(&ring);
+ if (ret == T_EXIT_FAIL) {
+ fprintf(stderr, "test_rdonly() failed\n");
+ return T_EXIT_FAIL;
+ }
+
+ if (ret != T_EXIT_SKIP)
+ ret = T_EXIT_PASS;
+
+ io_uring_queue_exit(&ring);
+ return ret;
+}
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 1/5] configure: shorten the message for the discard command
2026-07-15 6:39 ` [PATCH 1/5] configure: shorten the message for the discard command Christoph Hellwig
@ 2026-07-15 8:27 ` Damien Le Moal
0 siblings, 0 replies; 13+ messages in thread
From: Damien Le Moal @ 2026-07-15 8:27 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe; +Cc: io-uring
On 7/15/26 15:39, Christoph Hellwig wrote:
> The current message is pretty long, drop the redundant io_uring.
> This aligns it with the soon to be added zone_reset_all message.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/5] man: fixups for io_uring_prep_cmd_discard.3
2026-07-15 6:39 ` [PATCH 2/5] man: fixups for io_uring_prep_cmd_discard.3 Christoph Hellwig
@ 2026-07-15 8:28 ` Damien Le Moal
0 siblings, 0 replies; 13+ messages in thread
From: Damien Le Moal @ 2026-07-15 8:28 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe; +Cc: io-uring
On 7/15/26 15:39, Christoph Hellwig wrote:
> Mention the ioctl this is modelled after instead of the io_uring
> cmd used to implement io_uring_prep_cmd_discard.3, and drop an
> incorrect plural for page cache.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/5] liburiung: add io_uring_prep_cmd_zone_reset
2026-07-15 6:39 ` [PATCH 3/5] liburiung: add io_uring_prep_cmd_zone_reset Christoph Hellwig
@ 2026-07-15 8:30 ` Damien Le Moal
2026-07-15 15:09 ` Caleb Sander Mateos
1 sibling, 0 replies; 13+ messages in thread
From: Damien Le Moal @ 2026-07-15 8:30 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe; +Cc: io-uring
On 7/15/26 15:39, Christoph Hellwig wrote:
> Add a helper for io_uring zone_reset_all commands.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 4/5] man: add io_uring_prep_cmd_zone_reset_all.3 man page
2026-07-15 6:39 ` [PATCH 4/5] man: add io_uring_prep_cmd_zone_reset_all.3 man page Christoph Hellwig
@ 2026-07-15 8:33 ` Damien Le Moal
2026-07-15 15:25 ` Gabriel Krisman Bertazi
1 sibling, 0 replies; 13+ messages in thread
From: Damien Le Moal @ 2026-07-15 8:33 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe; +Cc: io-uring
On 7/15/26 15:39, Christoph Hellwig wrote:
> Add doccumentation for the new zone reset all io_uring cmd.
s/doccumentation/documentation
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 5/5] test: add zone_reset_all command test
2026-07-15 6:39 ` [PATCH 5/5] test: add zone_reset_all command test Christoph Hellwig
@ 2026-07-15 8:35 ` Damien Le Moal
0 siblings, 0 replies; 13+ messages in thread
From: Damien Le Moal @ 2026-07-15 8:35 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe; +Cc: io-uring
On 7/15/26 15:39, Christoph Hellwig wrote:
> Basic sanity checking for the simply zone_reset_all command, mostly
s/simply/simple
> taken from the discard test.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/5] liburiung: add io_uring_prep_cmd_zone_reset
2026-07-15 6:39 ` [PATCH 3/5] liburiung: add io_uring_prep_cmd_zone_reset Christoph Hellwig
2026-07-15 8:30 ` Damien Le Moal
@ 2026-07-15 15:09 ` Caleb Sander Mateos
1 sibling, 0 replies; 13+ messages in thread
From: Caleb Sander Mateos @ 2026-07-15 15:09 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Jens Axboe, Damien Le Moal, io-uring
In commit message, "liburiung" -> "liburing"?
On Tue, Jul 14, 2026 at 11:44 PM Christoph Hellwig <hch@lst.de> wrote:
>
> Add a helper for io_uring zone_reset_all commands.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> configure | 31 +++++++++++++++++++++++++++++++
> src/include/liburing.h | 7 +++++++
> src/liburing-ffi.map | 5 +++++
> 3 files changed, 43 insertions(+)
>
> diff --git a/configure b/configure
> index b953eddd6ddc..8c5ca801f487 100755
> --- a/configure
> +++ b/configure
> @@ -469,6 +469,21 @@ if compile_prog "" "" "discard command"; then
> fi
> print_config "discard command support" "$discard_cmd"
>
> +##########################################
> +# Check block zone_reset_all cmd support
> +zone_reset_all_cmd="no"
> +cat > $TMPC << EOF
> +#include <linux/blkdev.h>
> +int main(void)
> +{
> + return BLOCK_URING_CMD_ZONE_RESET_ALL;
> +}
> +EOF
> +if compile_prog "" "" "zone_reset_all command"; then
> + zone_reset_all_cmd="yes"
> +fi
> +print_config "zone_reset_all command support" "$zone_reset_all_cmd"
> +
> ##########################################
> # Check idtype_t support
> has_idtype_t="no"
> @@ -797,6 +812,22 @@ else cat >> $compat_h << EOF
> EOF
> fi
>
> +if test "$zone_reset_all_cmd" != "yes"; then
> +cat >> $compat_h << EOF
> +
> +#include <linux/ioctl.h>
> +
> +#ifndef BLOCK_URING_CMD_ZONE_RESET_ALL
> +#define BLOCK_URING_CMD_ZONE_RESET_ALL _IO(0x12, 1)
> +#endif
> +
> +EOF
> +else cat >> $compat_h << EOF
> +#include <linux/blkdev.h>
> +
> +EOF
> +fi
> +
> cat >> $compat_h << EOF
> #endif
> EOF
> diff --git a/src/include/liburing.h b/src/include/liburing.h
> index 0188937b0de4..214c7778d6a7 100644
> --- a/src/include/liburing.h
> +++ b/src/include/liburing.h
> @@ -1685,6 +1685,13 @@ IOURINGINLINE void io_uring_prep_cmd_discard(struct io_uring_sqe *sqe,
> sqe->addr3 = nbytes;
> }
>
> +IOURINGINLINE void io_uring_prep_cmd_zone_reset_all(struct io_uring_sqe *sqe,
> + int fd)
> + LIBURING_NOEXCEPT
> +{
> + io_uring_prep_uring_cmd(sqe, BLOCK_URING_CMD_ZONE_RESET_ALL, fd);
> +}
> +
> IOURINGINLINE void io_uring_prep_pipe(struct io_uring_sqe *sqe, int *fds,
> int pipe_flags)
> {
> diff --git a/src/liburing-ffi.map b/src/liburing-ffi.map
> index bd7bc64416d3..fc9701b63907 100644
> --- a/src/liburing-ffi.map
> +++ b/src/liburing-ffi.map
> @@ -275,3 +275,8 @@ LIBURING_2.15 {
> io_uring_register_zcrx_ctrl;
> io_uring_register_query;
> } LIBURING_2.14;
> +
> +LIBURING_2.16 {
> + global:
> + io_uring_prep_cmd_zone_reset_all;
> +} LIBURING_2.14;
Does this 2.14 not need to be incremented to 2.15?
Best,
Caleb
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 4/5] man: add io_uring_prep_cmd_zone_reset_all.3 man page
2026-07-15 6:39 ` [PATCH 4/5] man: add io_uring_prep_cmd_zone_reset_all.3 man page Christoph Hellwig
2026-07-15 8:33 ` Damien Le Moal
@ 2026-07-15 15:25 ` Gabriel Krisman Bertazi
1 sibling, 0 replies; 13+ messages in thread
From: Gabriel Krisman Bertazi @ 2026-07-15 15:25 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe; +Cc: Damien Le Moal, io-uring
Christoph Hellwig <hch@lst.de> writes:
> Add doccumentation for the new zone reset all io_uring cmd.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> man/io_uring_prep_cmd_zone_reset_all.3 | 54 ++++++++++++++++++++++++++
> 1 file changed, 54 insertions(+)
> create mode 100644 man/io_uring_prep_cmd_zone_reset_all.3
>
> diff --git a/man/io_uring_prep_cmd_zone_reset_all.3 b/man/io_uring_prep_cmd_zone_reset_all.3
> new file mode 100644
> index 000000000000..251a300c5ed1
> --- /dev/null
> +++ b/man/io_uring_prep_cmd_zone_reset_all.3
> @@ -0,0 +1,54 @@
> +.\" Copyright (C) 2026 Christoph Hellwig <hch@lst.de>
> +.\"
> +.\" SPDX-License-Identifier: LGPL-2.0-or-later
> +.\"
> +.TH io_uring_prep_cmd_zone_reset_all 3 "Jul 14, 2026" "liburing-2.8" "liburing Manual"
liburing-2.16
> +.SH NAME
> +io_uring_prep_cmd_zone_reset_all \- prepare a zone_reset_all command
> +.SH SYNOPSIS
> +.nf
> +.B #include <liburing.h>
> +.PP
> +.BI "void io_uring_prep_cmd_zone_reset_all(struct io_uring_sqe *" sqe ", int " fd ");"
> +.fi
> +.SH DESCRIPTION
> +The
> +.BR io_uring_prep_cmd_zone_reset_all (3)
> +function prepares a zone_reset_all command request. The submission queue entry
> +.I sqe
> +is setup to reset all sequential write required zones on the block device
> +pointed to by
> +.IR fd .
> +
> +This command does not synchronize against concurrent file operations, including
> +but not limited to reads, write, ioctls and other uring_cmds and only performs
> +a best effort invalidation of the page cache for the device. The user has
> +to make sure that no other in-flight requests are modifying or reading the
> +range(s). If that is the case, it might result in stale page cache and data
> +inconsistencies.
> +
> +Available since Linux 7.TBD.
> +
> +.SH RETURN VALUE
> +None
> +.SH ERRORS
> +The CQE
> +.I res
> +field will contain the result of the operation. On success, this field will be
> +set to
> +.B 0 .
> +On error, a negative error value is returned. Note that where synchronous
> +system calls will return
> +.B -1
> +on failure and set
> +.I errno
> +to the actual error value, io_uring never uses
> +.IR errno .
> +Instead it returns the negated
> +.I errno
> +directly in the CQE
> +.I res
> +field.
> +.SH SEE ALSO
> +.BR io_uring_get_sqe (3),
> +.BR io_uring_submit (3),
> --
> 2.53.0
>
--
Gabriel Krisman Bertazi
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2026-07-15 15:25 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-15 6:39 support ZONE_RESET_ALL in liburing Christoph Hellwig
2026-07-15 6:39 ` [PATCH 1/5] configure: shorten the message for the discard command Christoph Hellwig
2026-07-15 8:27 ` Damien Le Moal
2026-07-15 6:39 ` [PATCH 2/5] man: fixups for io_uring_prep_cmd_discard.3 Christoph Hellwig
2026-07-15 8:28 ` Damien Le Moal
2026-07-15 6:39 ` [PATCH 3/5] liburiung: add io_uring_prep_cmd_zone_reset Christoph Hellwig
2026-07-15 8:30 ` Damien Le Moal
2026-07-15 15:09 ` Caleb Sander Mateos
2026-07-15 6:39 ` [PATCH 4/5] man: add io_uring_prep_cmd_zone_reset_all.3 man page Christoph Hellwig
2026-07-15 8:33 ` Damien Le Moal
2026-07-15 15:25 ` Gabriel Krisman Bertazi
2026-07-15 6:39 ` [PATCH 5/5] test: add zone_reset_all command test Christoph Hellwig
2026-07-15 8:35 ` Damien Le Moal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox