public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <ming.lei@redhat.com>
Cc: linux-block@vger.kernel.org, Coly Li <colyli@suse.de>,
	Hannes Reinecke <hare@suse.com>, Xiao Ni <xni@redhat.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Evan Green <evgreen@chromium.org>,
	Gwendal Grignou <gwendal@chromium.org>,
	Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
	Andrzej Pietrasiewicz <andrzej.p@collabora.com>,
	Christoph Hellwig <hch@lst.de>,
	stable@vger.kernel.org
Subject: Re: [PATCH RESEND] block: loop: set discard granularity and alignment for block device backed loop
Date: Mon, 17 Aug 2020 06:58:53 -0700	[thread overview]
Message-ID: <bea9ed29-066e-a334-337e-76972ea6b7df@kernel.dk> (raw)
In-Reply-To: <20200817100130.2496059-1-ming.lei@redhat.com>

On 8/17/20 3:01 AM, Ming Lei wrote:
> In case of block device backend, if the backend supports write zeros, the
> loop device will set queue flag of QUEUE_FLAG_DISCARD. However,
> limits.discard_granularity isn't setup, and this way is wrong,
> see the following description in Documentation/ABI/testing/sysfs-block:
> 
> 	A discard_granularity of 0 means that the device does not support
> 	discard functionality.
> 
> Especially 9b15d109a6b2 ("block: improve discard bio alignment in
> __blkdev_issue_discard()") starts to take q->limits.discard_granularity
> for computing max discard sectors. And zero discard granularity may cause
> kernel oops, or fail discard request even though the loop queue claims
> discard support via QUEUE_FLAG_DISCARD.
> 
> Fix the issue by setup discard granularity and alignment.

Applied, thanks.

-- 
Jens Axboe


      parent reply	other threads:[~2020-08-17 13:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-17 10:01 [PATCH RESEND] block: loop: set discard granularity and alignment for block device backed loop Ming Lei
2020-08-17 10:17 ` Christoph Hellwig
2020-08-18  3:00   ` Martin K. Petersen
2020-08-17 13:58 ` 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=bea9ed29-066e-a334-337e-76972ea6b7df@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=andrzej.p@collabora.com \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=colyli@suse.de \
    --cc=evgreen@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=xni@redhat.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