From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <ming.lei@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>,
linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Pei Zhang <pezhang@redhat.com>
Subject: Re: [PATCH V3] block: loop:use kstatfs.f_bsize of backing file to set discard granularity
Date: Fri, 11 Feb 2022 15:11:14 -0700 [thread overview]
Message-ID: <164461747401.23683.16043772172792062024.b4-ty@kernel.dk> (raw)
In-Reply-To: <20220126035830.296465-1-ming.lei@redhat.com>
On Wed, 26 Jan 2022 11:58:30 +0800, Ming Lei wrote:
> If backing file's filesystem has implemented ->fallocate(), we think the
> loop device can support discard, then pass sb->s_blocksize as
> discard_granularity. However, some underlying FS, such as overlayfs,
> doesn't set sb->s_blocksize, and causes discard_granularity to be set as
> zero, then the warning in __blkdev_issue_discard() is triggered.
>
> Christoph suggested to pass kstatfs.f_bsize as discard granularity, and
> this way is fine because kstatfs.f_bsize means 'Optimal transfer block
> size', which still matches with definition of discard granularity.
>
> [...]
Applied, thanks!
[1/1] block: loop:use kstatfs.f_bsize of backing file to set discard granularity
(no commit info)
Best regards,
--
Jens Axboe
prev parent reply other threads:[~2022-02-11 22:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 3:58 [PATCH V3] block: loop:use kstatfs.f_bsize of backing file to set discard granularity Ming Lei
2022-01-26 5:15 ` Christoph Hellwig
2022-02-08 3:22 ` Ming Lei
2022-02-11 22:11 ` 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=164461747401.23683.16043772172792062024.b4-ty@kernel.dk \
--to=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=pezhang@redhat.com \
--cc=vgoyal@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