Skip to content
Commit 0549cd67 authored by Roger Pau Monne's avatar Roger Pau Monne Committed by Juergen Gross
Browse files

xen-blkfront: allow discard-* nodes to be optional



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: ed30bf31 ('xen-blkfront: Handle discard requests.')
Reported-by: default avatarArthur Borsboom <arthurborsboom@gmail.com>
Signed-off-by: default avatarRoger Pau Monné <roger.pau@citrix.com>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Tested-By: default avatarArthur Borsboom <arthurborsboom@gmail.com>
Link: https://lore.kernel.org/r/20210119105727.95173-1-roger.pau@citrix.com


Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent bd9dcef6
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment