all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH zfsonlinux v2] patches: fix for zvol sync/flush regression
@ 2025-03-13 11:32 Fabian Grünbichler
  2025-03-16 19:23 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Grünbichler @ 2025-03-13 11:32 UTC (permalink / raw)
  To: pve-devel

this broke with 2.2.7, and can potentially cause data loss or
inconsistency. the patch basically reverts to pre-2.2.7 behaviour,
verified via a fio benchmark.

reported on our forum: https://forum.proxmox.com/threads/163066

cherry-picked from upstream master

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
v2: added Stoiko's T-b/R-b, replaced patch with equivalent upstream
master one

 ...vols-correctly-detect-flush-requests.patch | 63 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 64 insertions(+)
 create mode 100644 debian/patches/0012-linux-zvols-correctly-detect-flush-requests.patch

diff --git a/debian/patches/0012-linux-zvols-correctly-detect-flush-requests.patch b/debian/patches/0012-linux-zvols-correctly-detect-flush-requests.patch
new file mode 100644
index 0000000..25159ef
--- /dev/null
+++ b/debian/patches/0012-linux-zvols-correctly-detect-flush-requests.patch
@@ -0,0 +1,63 @@
+From 4482e91446c35d4194be49b715c6bb8a3ad9ba18 Mon Sep 17 00:00:00 2001
+From: Fabian-Gruenbichler <f.gruenbichler@proxmox.com>
+Date: Wed, 12 Mar 2025 22:39:01 +0100
+Subject: [PATCH 12/12] linux: zvols: correctly detect flush requests (#17131)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+since 4.10, bio->bi_opf needs to be checked to determine all kinds of
+flush requests. this was the case prior to the commit referenced below,
+but the order of ifdefs was not the usual one (newest up top), which
+might have caused this to slip through.
+
+this fixes a regression when using zvols as Qemu block devices, but
+might have broken other use cases as well. the symptoms are that all
+sync writes from within a VM configured to use such a virtual block
+devices are ignored and treated as async writes by the host ZFS layer.
+
+this can be verified using fio in sync mode inside the VM, for example
+with
+
+ fio \
+ --filename=/dev/sda --ioengine=libaio --loops=1 --size=10G \
+ --time_based --runtime=60 --group_reporting --stonewall --name=cc1 \
+ --description="CC1" --rw=write --bs=4k --direct=1 --iodepth=1 \
+ --numjobs=1 --sync=1
+
+which shows an IOPS number way above what the physical device underneath
+supports, with "zpool iostat -r 1" on the hypervisor side showing no
+sync IO occuring during the benchmark.
+
+with the regression fixed, both fio inside the VM and the IO stats on
+the host show the expected numbers.
+
+Fixes: 846b5985192467acabf5484ae610b4b37b7f8162
+"config: remove HAVE_REQ_OP_* and HAVE_REQ_*"
+
+Signed-off-by: Fabian-Gruenbichler <f.gruenbichler@proxmox.com>
+Co-authored-by: Alexander Motin <mav@FreeBSD.org>
+Reviewed-by: Alexander Motin <mav@FreeBSD.org>
+Reviewed-by: Tony Hutter <hutter2@llnl.gov>
+(cherry picked from commit 41823a0ede88377c39ad218ddd1e60776ea5f466)
+Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
+---
+ include/os/linux/kernel/linux/blkdev_compat.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/os/linux/kernel/linux/blkdev_compat.h b/include/os/linux/kernel/linux/blkdev_compat.h
+index c0d377074..26e7b0b2a 100644
+--- a/include/os/linux/kernel/linux/blkdev_compat.h
++++ b/include/os/linux/kernel/linux/blkdev_compat.h
+@@ -356,7 +356,7 @@ bio_set_flush(struct bio *bio)
+ static inline boolean_t
+ bio_is_flush(struct bio *bio)
+ {
+-	return (bio_op(bio) == REQ_OP_FLUSH);
++	return (bio_op(bio) == REQ_OP_FLUSH || op_is_flush(bio->bi_opf));
+ }
+ 
+ /*
+-- 
+2.39.5
+
diff --git a/debian/patches/series b/debian/patches/series
index 229027f..938488c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@
 0009-arc-stat-summary-guard-access-to-freshly-introduced-.patch
 0010-Fix-nfs_truncate_shares-without-etc-exports.d.patch
 0011-zpool-status-tighten-bounds-for-noalloc-stat-availab.patch
+0012-linux-zvols-correctly-detect-flush-requests.patch
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH zfsonlinux v2] patches: fix for zvol sync/flush regression
  2025-03-13 11:32 [pve-devel] [PATCH zfsonlinux v2] patches: fix for zvol sync/flush regression Fabian Grünbichler
@ 2025-03-16 19:23 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2025-03-16 19:23 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fabian Grünbichler

On 13/03/2025 12:32, Fabian Grünbichler wrote:
> this broke with 2.2.7, and can potentially cause data loss or
> inconsistency. the patch basically reverts to pre-2.2.7 behaviour,
> verified via a fio benchmark.
> 
> reported on our forum: https://forum.proxmox.com/threads/163066
> 
> cherry-picked from upstream master
> 
> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> Tested-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> ---
> v2: added Stoiko's T-b/R-b, replaced patch with equivalent upstream
> master one
> 
>  ...vols-correctly-detect-flush-requests.patch | 63 +++++++++++++++++++
>  debian/patches/series                         |  1 +
>  2 files changed, 64 insertions(+)
>  create mode 100644 debian/patches/0012-linux-zvols-correctly-detect-flush-requests.patch
> 
>

applied, with commit subject slightly altered (patches: tag IMO does not give
me as dev nor users if copied in d/changelog much value here), thanks!


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-16 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-13 11:32 [pve-devel] [PATCH zfsonlinux v2] patches: fix for zvol sync/flush regression Fabian Grünbichler
2025-03-16 19:23 ` [pve-devel] applied: " Thomas Lamprecht

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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal