kernel-fxtec-pro1x/drivers/block
Ming Lei 3e7f61593b block: loop: set discard granularity and alignment for block device backed loop
commit bcb21c8cc9947286211327d663ace69f07d37a76 upstream.

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.

Fixes: c52abf563049 ("loop: Better discard support for block devices")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Coly Li <colyli@suse.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Xiao Ni <xni@redhat.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Evan Green <evgreen@chromium.org>
Cc: Gwendal Grignou <gwendal@chromium.org>
Cc: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Cc: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-03 11:24:26 +02:00
..
aoe
drbd signal: Allow cifs and drbd to receive their terminating signals 2020-01-27 14:51:05 +01:00
mtip32xx
paride
rsxx rsxx: add missed destroy_workqueue calls in remove 2019-12-13 08:51:06 +01:00
xen-blkback xen/blkback: Avoid unmapping unmapped grant pages 2020-01-09 10:19:09 +01:00
zram Revert "zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()" 2020-07-22 09:32:10 +02:00
amiflop.c amiflop: clean up on errors during setup 2019-12-01 09:16:25 +01:00
ataflop.c
brd.c brd: check and limit max_part par 2020-02-24 08:34:53 +01:00
cryptoloop.c
DAC960.c
DAC960.h
floppy.c floppy: check FDC index for errors before assigning it 2020-02-28 16:38:45 +01:00
Kconfig
loop.c block: loop: set discard granularity and alignment for block device backed loop 2020-09-03 11:24:26 +02:00
loop.h
Makefile
nbd.c nbd: Fix memory leak in nbd_add_socket 2020-07-16 08:17:24 +02:00
null_blk.h
null_blk_main.c null_blk: fix passing of REQ_FUA flag in null_handle_rq 2020-09-03 11:24:23 +02:00
null_blk_zoned.c null_blk: return error for invalid zone size 2020-06-07 13:17:56 +02:00
pktcdvd.c pktcdvd: remove warning on attempting to register non-passthrough dev 2019-10-07 18:57:15 +02:00
ps3disk.c ps3disk: use the default segment boundary 2020-06-25 15:32:49 +02:00
ps3vram.c
rbd.c rbd: call rbd_dev_unprobe() after unwatching and flushing notifies 2020-04-23 10:30:15 +02:00
rbd_types.h
skd_main.c skd: fixup usage of legacy IO API 2019-12-01 09:16:20 +01:00
skd_s1120.h
sunvdc.c
swim.c
swim3.c
swim_asm.S
sx8.c
umem.c
umem.h
virtio_blk.c virtio-blk: free vblk-vqs in error path of virtblk_probe() 2020-07-09 09:37:11 +02:00
xen-blkfront.c xen/blkfront: fix memory allocation flags in blkfront_setup_indirect() 2020-04-17 10:48:53 +02:00
xsysace.c
z2ram.c