All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: andrey.zhadchenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 2/2] dm-zero-rq: drop flushes, discards and write zeroes instead of failing them
Date: Wed, 28 Oct 2026 13:31:29 +0100	[thread overview]
Message-ID: <20261028123130.2828357-3-den@openvz.org> (raw)
In-Reply-To: <20261028123130.2828357-1-den@openvz.org>

From: Denis V. Lunev <den@openvz.org>

zero-rq kills every request that is not a read or a write. Requests
queued against the previous table and dispatched to zero-rq after a
table swap therefore fail, a flush with an error returned to the
syncing task and a discard with an I/O error in the log:

  I/O error, dev dm-0, sector 0 op 0x3:(DISCARD) flags 0x4800

ploop reloads a released device to zero-rq precisely to keep the file
system on it from seeing such errors.

Complete flushes, discards and write zeroes as writes are completed.
Reads already return zeros, so all of them are honoured. Drop
num_discard_bios from the constructor: it only matters to bio-based
targets and to targets that pass discards through to a device, and
zero-rq is neither, so "silently drop discards" above it never held.

https://virtuozzo.atlassian.net/browse/VSTOR-152097
Feature: cbt: changed block tracking (for backup)
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
 drivers/md/dm-zero-rq.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/md/dm-zero-rq.c b/drivers/md/dm-zero-rq.c
index 4f09266ff5ed..315ef8c930b3 100644
--- a/drivers/md/dm-zero-rq.c
+++ b/drivers/md/dm-zero-rq.c
@@ -24,11 +24,6 @@ static int zero_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 		return -EINVAL;
 	}
 
-	/*
-	 * Silently drop discards, avoiding -EOPNOTSUPP.
-	 */
-	ti->num_discard_bios = 1;
-
 	return 0;
 }
 
@@ -47,7 +42,10 @@ static int zero_clone_and_map_rq(struct dm_target *ti, struct request *rq,
 
 		break;
 	case REQ_OP_WRITE:
-		/* writes get silently dropped */
+	case REQ_OP_FLUSH:
+	case REQ_OP_DISCARD:
+	case REQ_OP_WRITE_ZEROES:
+		/* writes of any kind get silently dropped */
 		break;
 	default:
 		return DM_MAPIO_KILL;
-- 
2.53.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  parent reply	other threads:[~2026-10-28 12:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 12:31 [Devel] [PATCH hci-8.1 0/2] dm-zero-rq: fix a crash on a flush after ploop release Denis V. Lunev
2026-10-28 12:31 ` [Devel] [PATCH hci-8.1 1/2] dm-zero-rq: fix a NULL dereference mapping a flush request Denis V. Lunev
2026-10-28 12:34   ` no-reply
2026-10-28 12:31 ` Denis V. Lunev [this message]
2026-10-28 12:34   ` [Devel] [PATCH hci-8.1 2/2] dm-zero-rq: drop flushes, discards and write zeroes instead of failing them no-reply
2026-10-29 17:40   ` Konstantin Khorenko
2026-10-28 12:44 ` [Devel] [PATCH hci-8.1 0/2] dm-zero-rq: fix a crash on a flush after ploop release Andrey Zhadchenko
2026-10-29 17:40 ` Konstantin Khorenko
2026-10-29 17:44 ` Konstantin Khorenko

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=20261028123130.2828357-3-den@openvz.org \
    --to=den@openvz.org \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=devel@openvz.org \
    /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.