All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Damien Le Moal <damien.lemoal@hgst.com>,
	Jens Axboe <axboe@fb.com>,
	linux-block@vger.kernel.org, hch@lst.de, hare@suse.de
Subject: Re: [PATCH] block: Fix front merge check
Date: Wed, 20 Jul 2016 21:38:43 -0600	[thread overview]
Message-ID: <9cc4fbbe-4cdd-d9b0-41ca-5dcb13cc6409@kernel.dk> (raw)
In-Reply-To: <8a365634-e2e7-45d9-a86d-10894212a4d2@hgst.com>



On 07/13/2016 07:23 PM, Damien Le Moal wrote:
>
> Jens,
>
> On 7/14/16 01:19, Jens Axboe wrote:
>> On 07/12/2016 10:23 PM, Damien Le Moal wrote:
>>> For a front merge, the maximum number of sectors of the
>>> request must be checked against the front merge BIO sector,
>>> not the current sector of the request.
>>
>> Why does this matter? The merging should only happen before we start the
>> request, hence rq pos and first bio should be one and the same.
>
> The block device of SMR drives is set up as chunked with the chunk size
> equal to the drive zone size. Since write requests directed to
> sequential zones cannot cross zone boundaries, both the front merge code
> and the back merge code must ensure that requests resulting from a merge
> do not cross chunk boundaries.
>
> The back merge code does this well, but the front merge code fails to
> prevent merging when the BIO is the last write in a zone and the request
> is the first write in the following (empty) zone. The check against the
> request LBA does not prevent the merge as the request+bio size fit in
> the empty zone. The check must be against the BIO LBA to detect the
> chunk boundary crossing.

Ah that makes sense, it's on adding the new bio, not against the 
existing rq->bio. Applied for 4.8.

-- 
Jens Axboe

      reply	other threads:[~2016-07-21  3:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-13  5:23 [PATCH] block: Fix front merge check Damien Le Moal
2016-07-13  5:42 ` Hannes Reinecke
2016-07-13 16:19 ` Jens Axboe
2016-07-14  1:23   ` Damien Le Moal
2016-07-21  3:38     ` Jens Axboe [this message]

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=9cc4fbbe-4cdd-d9b0-41ca-5dcb13cc6409@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=axboe@fb.com \
    --cc=damien.lemoal@hgst.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-block@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 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.