linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	Damien Le Moal <damien.lemoal@wdc.com>
Cc: linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/4] block: fix bio_split_rw_at to take zone_write_granularity into account
Date: Fri, 1 Nov 2024 14:34:31 +0900	[thread overview]
Message-ID: <a7b87e01-045e-423e-854d-4707f9102c75@kernel.org> (raw)
In-Reply-To: <20241101052206.437530-2-hch@lst.de>

On 11/1/24 14:21, Christoph Hellwig wrote:
> Otherwise it can create unaligned writes on zoned devices.
> 
> Fixes: a805a4fa4fa3 ("block: introduce zone_write_granularity limit")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  block/blk-merge.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-merge.c b/block/blk-merge.c
> index d813d799cee7..d6895859a2fb 100644
> --- a/block/blk-merge.c
> +++ b/block/blk-merge.c
> @@ -358,7 +358,8 @@ int bio_split_rw_at(struct bio *bio, const struct queue_limits *lim,
>  	 * split size so that each bio is properly block size aligned, even if
>  	 * we do not use the full hardware limits.
>  	 */
> -	bytes = ALIGN_DOWN(bytes, lim->logical_block_size);
> +	bytes = ALIGN_DOWN(bytes, lim->zone_write_granularity ?
> +			lim->zone_write_granularity : lim->logical_block_size);

Nit: we could also do:

	bytes = ALIGN_DOWN(bytes,
		max(lim->logical_block_size, lim->zone_write_granularity));

Also, I wonder if we should leave read split as is based on the logical block
size only ? Probably does not matter much...

>  
>  	/*
>  	 * Bio splitting may cause subtle trouble such as hang when doing sync


-- 
Damien Le Moal
Western Digital Research

  reply	other threads:[~2024-11-01  5:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-01  5:21 fix a few zoned append issues Christoph Hellwig
2024-11-01  5:21 ` [PATCH 1/4] block: fix bio_split_rw_at to take zone_write_granularity into account Christoph Hellwig
2024-11-01  5:34   ` Damien Le Moal [this message]
2024-11-01  5:47     ` Christoph Hellwig
2024-11-01  5:21 ` [PATCH 2/4] block: lift bio_is_zone_append to bio.h Christoph Hellwig
2024-11-01  5:37   ` Damien Le Moal
2024-11-01  5:48     ` Christoph Hellwig
2024-11-04 10:44   ` Johannes Thumshirn
2024-11-01  5:21 ` [PATCH 3/4] btrfs: use bio_is_zone_append in the completion handler Christoph Hellwig
2024-11-01  5:38   ` Damien Le Moal
2024-11-04 10:45   ` Johannes Thumshirn
2024-11-05  6:09   ` Naohiro Aota
2024-11-01  5:21 ` [PATCH 4/4] btrfs: split bios to the fs sector size boundary Christoph Hellwig
2024-11-01  5:40   ` Damien Le Moal
2024-11-04 10:45   ` Johannes Thumshirn
2024-11-05  6:00   ` Naohiro Aota

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=a7b87e01-045e-423e-854d-4707f9102c75@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=clm@fb.com \
    --cc=damien.lemoal@wdc.com \
    --cc=dsterba@suse.com \
    --cc=hch@lst.de \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).