public inbox for linux-bcache@vger.kernel.org
 help / color / mirror / Atom feed
From: Coly Li <colyli@suse.de>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Cc: "linux-bcache@vger.kernel.org" <linux-bcache@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ming Lei <ming.lei@redhat.com>, Hannes Reinecke <hare@suse.com>,
	Xiao Ni <xni@redhat.com>, Bart Van Assche <bvanassche@acm.org>,
	Christoph Hellwig <hch@lst.de>,
	Enzo Matsumiya <ematsumiya@suse.com>,
	Jens Axboe <axboe@kernel.dk>, Evan Green <evgreen@chromium.org>
Subject: Re: [PATCH] block: tolerate 0 byte discard_granularity in __blkdev_issue_discard()
Date: Tue, 4 Aug 2020 22:43:53 +0800	[thread overview]
Message-ID: <2f70177e-4964-0fce-14bf-506b0821128b@suse.de> (raw)
In-Reply-To: <SN4PR0401MB35983A30C6AE9886EF6E91C79B4A0@SN4PR0401MB3598.namprd04.prod.outlook.com>

On 2020/8/4 22:37, Johannes Thumshirn wrote:
> On 04/08/2020 16:34, Coly Li wrote:
>> On 2020/8/4 22:31, Johannes Thumshirn wrote:
>>> On 04/08/2020 16:23, Coly Li wrote:
>>>> This is the procedure to reproduce the panic,
>>>>   # modprobe scsi_debug delay=0 dev_size_mb=2048 max_queue=1
>>>>   # losetup -f /dev/nvme0n1 --direct-io=on
>>>>   # blkdiscard /dev/loop0 -o 0 -l 0x200
>>>
>>> losetup -f /dev/sdX isn't it?
>>>
>>
>> In my case, I use a NVMe SSD as the backing device of the loop device.
>> Because I don't have a scsi lun.
>>
>> And loading scsi_debug module seems necessary, otherwise the discard
>> process just hang and I cannot see the kernel panic (I don't know why yet).
> 
> OK, now that's highly interesting. Does it also happen if you back loop with
> a file? loop_config_discard() has different cases for the different backing devices/files. S
> 
No, for a file backing, q->limits.discard_granularity is set to
inode->i_sb->s_blocksize. And the encrypted loop device does not support
discard.

Such issue just only happens on a device backing loop device which
announces supporting discard. Without Ming's fix to loop device driver,
discard on LBA 0 will trigger the BUG() panic in my setup (Maybe it is
more easier to trigger this BUG() panic with scsi lun).

Coly Li

  parent reply	other threads:[~2020-08-04 14:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04 14:23 [PATCH] block: tolerate 0 byte discard_granularity in __blkdev_issue_discard() Coly Li
2020-08-04 14:31 ` Johannes Thumshirn
2020-08-04 14:34   ` Coly Li
2020-08-04 14:37     ` Johannes Thumshirn
2020-08-04 14:39       ` Johannes Thumshirn
2020-08-04 14:45         ` Coly Li
2020-08-04 14:54           ` Johannes Thumshirn
2020-08-04 14:43       ` Coly Li [this message]
2020-08-04 23:58 ` Ming Lei
2020-08-05  0:28   ` Martin K. Petersen
2020-08-05  1:54   ` Coly Li
2020-08-05  2:46     ` Ming Lei
2020-08-05  2:52       ` Coly Li

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=2f70177e-4964-0fce-14bf-506b0821128b@suse.de \
    --to=colyli@suse.de \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=ematsumiya@suse.com \
    --cc=evgreen@chromium.org \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --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