linux-brain/drivers/block
Roger Pau Monne 61bdab3d77 xen-blkfront: allow discard-* nodes to be optional
commit 0549cd67b01016b579047bce045b386202a8bcfc upstream.

This is inline with the specification described in blkif.h:

 * discard-granularity: should be set to the physical block size if
   node is not present.
 * discard-alignment, discard-secure: should be set to 0 if node not
   present.

This was detected as QEMU would only create the discard-granularity
node but not discard-alignment, and thus the setup done in
blkfront_setup_discard would fail.

Fix blkfront_setup_discard to not fail on missing nodes, and also fix
blkif_set_queue_limits to set the discard granularity to the physical
block size if none is specified in xenbus.

Fixes: ed30bf317c ('xen-blkfront: Handle discard requests.')
Reported-by: Arthur Borsboom <arthurborsboom@gmail.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Tested-By: Arthur Borsboom <arthurborsboom@gmail.com>
Link: https://lore.kernel.org/r/20210119105727.95173-1-roger.pau@citrix.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-03 23:25:58 +01:00
..
aoe block: aoe: Fix kernel crash due to atomic sleep when exiting 2019-08-08 07:29:02 -06:00
drbd block: drbd: remove a stray unlock in __drbd_send_protocol() 2019-11-08 06:55:22 -07:00
mtip32xx block: mtip32xx: Remove call to memset after dma_alloc_coherent 2019-06-29 09:42:50 -06:00
paride paride/pcd: need to check if cd->disk is null in pcd_detect 2019-09-04 07:04:37 -06:00
rsxx rsxx: add missed destroy_workqueue calls in remove 2019-11-14 13:59:49 -07:00
xen-blkback xen/xenbus: Add 'will_handle' callback support in xenbus_watch_path() 2020-12-30 11:51:46 +01:00
zram Revert "zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()" 2020-07-22 09:33:12 +02:00
Kconfig block: rsxx: select CONFIG_CRC32 2021-01-17 14:05:36 +01:00
Makefile drivers/block: Remove DAC960 driver 2018-10-17 09:42:30 -06:00
amiflop.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
ataflop.c ataflop: Mark expected switch fall-through 2019-07-29 15:24:58 -06:00
brd.c brd: check and limit max_part par 2020-02-24 08:37:02 +01:00
cryptoloop.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 30 2019-05-24 17:27:10 +02:00
floppy.c block/floppy: fix contended case in floppy_queue_rq() 2020-06-17 16:40:38 +02:00
loop.c block: loop: set discard granularity and alignment for block device backed loop 2020-09-03 11:27:01 +02:00
loop.h block/loop: Use global lock for ioctl() operation. 2018-11-08 06:30:11 -07:00
nbd.c nbd: freeze the queue while we're adding connections 2021-02-03 23:25:56 +01:00
null_blk.h null_blk: format pr_* logs with pr_fmt 2019-09-16 08:38:29 -06:00
null_blk_main.c null_blk: fix passing of REQ_FUA flag in null_handle_rq 2020-09-03 11:26:55 +02:00
null_blk_zoned.c null_blk: Fix zone size initialization 2021-01-06 14:48:37 +01:00
pktcdvd.c pktcdvd: remove warning on attempting to register non-passthrough dev 2019-09-22 10:01:05 -06:00
ps3disk.c ps3disk: use the default segment boundary 2020-06-24 17:50:15 +02:00
ps3vram.c block/ps3vram: Use %llu to format sector_t after LBDAF removal 2019-06-13 03:17:50 -06:00
rbd.c rbd: require global CAP_SYS_ADMIN for mapping and unmapping 2020-09-17 13:47:53 +02:00
rbd_types.h rbd: support for object-map and fast-diff 2019-07-08 14:01:45 +02:00
skd_main.c Linux 5.2-rc6 2019-07-01 08:16:08 -06:00
skd_s1120.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
sunvdc.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
swim.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
swim3.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
swim_asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
sx8.c sx8: use a per-host tag_set 2018-11-09 08:14:14 -07:00
umem.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 349 2019-06-05 17:37:08 +02:00
umem.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 348 2019-06-05 17:37:08 +02:00
virtio_blk.c block: virtio_blk: fix handling single range discard request 2020-09-03 11:26:54 +02:00
xen-blkfront.c xen-blkfront: allow discard-* nodes to be optional 2021-02-03 23:25:58 +01:00
xsysace.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
z2ram.c powerpc updates for 4.20 2018-10-26 14:36:21 -07:00