All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2] drivers/vhost/blk: return UNSUPP for write zeroes on a backend without it
Date: Tue, 24 Nov 2026 14:44:04 +0100	[thread overview]
Message-ID: <179552784464.17420.6667041891082011483.b4-review@b4> (raw)
In-Reply-To: <20261124131259.498924-1-alexander.ivanov@virtuozzo.com>

I won't apply this version, please send v2 with the changes below.

On Tue, 24 Nov 2026 14:12:59 +0100, Alexander Ivanov wrote:
> A VMM may therefore offer VIRTIO_BLK_F_WRITE_ZEROES without checking
> the limit of the backend, and need not cap max_write_zeroes_sectors at
> it.

- The code is fine. Change the VMM advice: offer the feature only when
  the backend supports WRITE ZEROES at setup, just do not cap the limit.
- Say in the message that this replaces the contract of 3b2e28a4f6b7
  and add its Fixes: line.
- Give the dropped nr_sects > max_sects check its own paragraph, and
  keep each paragraph to four sentences.
- Send it in one series with the DISCARD v2, on top of it or under it,
  with one way to test the op in vhost_blk_req_done().

The next sentence of the message already shows why the advice is
wrong: on a backend that never supports WRITE ZEROES, the guest keeps
the limit it read at probe for good. dm_kcopyd_zero() then picks WRITE
ZEROES, so dm-thin zeroing of new blocks and dm-snapshot fail in the
guest, where today they work because the feature is not offered. The
QEMU side is not written yet, so this sentence is what it will follow.

> splits a WRITE ZEROES bio by it.

3b2e28a4f6b7 ("drivers/vhost/blk: support VIRTIO_BLK_F_WRITE_ZEROES")
documented IOERR for a backend without WRITE ZEROES and a limit the
VMM sets from the backend; it is in released kernels, so this patch
needs

  Fixes: 3b2e28a4f6b7 ("drivers/vhost/blk: support VIRTIO_BLK_F_WRITE_ZEROES")

Dropping the nr_sects > max_sects check is a change of its own: the
guest sees UINT_MAX when the VMM leaves the limit 0, so before this
patch every request above the backend limit got IOERR. That reason
belongs in its own paragraph. The second paragraph has five sentences
now, and the -EOPNOTSUPP outcome and the dm-kcopyd failure are each
said twice in the message.

The DISCARD series (still waiting for your answer to Andrey) rewrites
the same condition in vhost_blk_parse_write_zeroes() and adds an op
test to vhost_blk_req_done() with op_is_discard(req->bi_opf), while
this patch uses bio_op(bio). The two do not apply on each other, so
please put them in one series and use one form.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

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

  reply	other threads:[~2026-11-24 13:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 13:12 Alexander Ivanov
2026-11-24 13:44 ` Konstantin Khorenko [this message]
2026-12-01  0:02 ` no-reply

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=179552784464.17420.6667041891082011483.b4-review@b4 \
    --to=khorenko@virtuozzo.com \
    --cc=alexander.ivanov@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.