Hi Zhihao,Hi, Miquel,
Zhihao Cheng <chengzhihao1@xxxxxxxxxx> wrote on Tue, 15 Jun 2021
17:39:05 +0800:
Since commit b35fd7422c2f8("block: check queue's limits.discard_granularity
in __blkdev_issue_discard()") checks rq.limits.discard_granularity in
__blkdev_issue_discard(), we may get following warnings on formatted ftl:
WARNING: CPU: 2 PID: 7313 at block/blk-lib.c:51
__blkdev_issue_discard+0x2a7/0x390
Reproducer:
1. ftl_format /dev/mtd0
2. modprobe ftl
3. mkfs.vfat /dev/ftla
4. mount -odiscard /dev/ftla temp
5. dd if=/dev/zero of=temp/tst bs=1M count=10 oflag=direct
6. dd if=/dev/zero of=temp/tst bs=1M count=10 oflag=direct
Fix it by initializing rq.limits.discard_granularity if device supports
discard operation.
Can you please verify that this is still needed after Christoph's
additional fix:
https://patchwork.kernel.org/project/xen-devel/patch/20210602065345.355274-10-hch@xxxxxx/