public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Damien Le Moal <dlemoal@kernel.org>,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
	Zheng Qixing <zhengqixing@huawei.com>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>
Subject: Re: [PATCH] Revert "null_blk: allow byte aligned memory offsets"
Date: Tue, 11 Nov 2025 21:02:10 -0500	[thread overview]
Message-ID: <aRPqoinLQjYFBJsO@kbusch-mbp> (raw)
In-Reply-To: <20251111220838.926321-1-bvanassche@acm.org>

On Tue, Nov 11, 2025 at 02:08:33PM -0800, Bart Van Assche wrote:
> This reverts commit 3451cf34f51bb70c24413abb20b423e64486161b and fixes
> the following KASAN complaint when running test zbd/013

Can I please just get one chance to fix it before a kneejerk revert??

This was in v1, it was mistakenly dropped from v2.

---
diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index f1e67962ecaeb..55c3f4d62c2e3 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -1240,9 +1240,12 @@ static blk_status_t null_transfer(struct nullb *nullb, struct page *page,

        p = kmap_local_page(page) + off;
        if (!is_write) {
-               if (dev->zoned)
+               if (dev->zoned) {
                        valid_len = null_zone_valid_read_len(nullb,
                                pos >> SECTOR_SHIFT, len);
+                       if (valid_len != len)
+                               valid_len -= (pos & (SECTOR_SIZE - 1));
+               }

                if (valid_len) {
                        copy_from_nullb(nullb, p, pos, valid_len);
--

  parent reply	other threads:[~2025-11-12  2:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-11 22:08 [PATCH] Revert "null_blk: allow byte aligned memory offsets" Bart Van Assche
2025-11-11 22:47 ` Chaitanya Kulkarni
2025-11-12  2:02 ` Keith Busch [this message]
2025-11-12  2:15   ` Chaitanya Kulkarni
2025-11-12 14:48   ` Jens Axboe
2025-11-12 18:21   ` Bart Van Assche

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=aRPqoinLQjYFBJsO@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=dlemoal@kernel.org \
    --cc=hch@lst.de \
    --cc=johannes.thumshirn@wdc.com \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=willy@infradead.org \
    --cc=zhengqixing@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox