From: Roger Pau Monne <hidden> Date: 2021-01-19 11:18:08
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: ed30bf317c5ce ('xen-blkfront: Handle discard requests.')
Reported-by: Arthur Borsboom <redacted>
Signed-off-by: Roger Pau Monné <redacted>
---
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Konrad Rzeszutek Wilk <redacted>
Cc: "Roger Pau Monné" <redacted>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: xen-devel@lists.xenproject.org
Cc: linux-block@vger.kernel.org
Cc: Arthur Borsboom <redacted>
---
Changes since v2:
- Allow all discard-* nodes to be optional.
---
drivers/block/xen-blkfront.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
From: Jürgen Groß <jgross@suse.com> Date: 2021-01-19 11:28:56
On 19.01.21 11:57, Roger Pau Monne wrote:
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: ed30bf317c5ce ('xen-blkfront: Handle discard requests.')
Reported-by: Arthur Borsboom <redacted>
Signed-off-by: Roger Pau Monné <redacted>
From: Roger Pau Monné <hidden> Date: 2021-01-19 13:03:01
Forgot to Cc stable for the Fixes tag. Doing it now.
On Tue, Jan 19, 2021 at 11:57:27AM +0100, Roger Pau Monne wrote:
quoted hunk
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: ed30bf317c5ce ('xen-blkfront: Handle discard requests.')
Reported-by: Arthur Borsboom <redacted>
Signed-off-by: Roger Pau Monné <redacted>
---
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Konrad Rzeszutek Wilk <redacted>
Cc: "Roger Pau Monné" <redacted>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: xen-devel@lists.xenproject.org
Cc: linux-block@vger.kernel.org
Cc: Arthur Borsboom <redacted>
---
Changes since v2:
- Allow all discard-* nodes to be optional.
---
drivers/block/xen-blkfront.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
From: Arthur Borsboom <hidden> Date: 2021-01-20 14:54:46
Hi Roger,
I have set up a test environment based on Linux 5.11.0-rc4.
The patch did not apply clean, so I copied/pasted the patch manually.
Without the patch the call trace (as reported) is visible in dmesg.
With the patch the call trace in dmesg is gone, but ... (there is
always a but) ...
Now the discard action returns the following.
[arthur@test-arch ~]$ sudo fstrim -v /
fstrim: /: the discard operation is not supported
It might be correct, but of course I was hoping the Xen VM guest would
pass on the discard request to the block device in the Xen VM host,
which is a disk partition.
Any suggestions?
(Resend due to the previous email being HTML instead of plain text).
On Tue, 19 Jan 2021 at 11:57, Roger Pau Monne [off-list ref] wrote:
quoted hunk
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: ed30bf317c5ce ('xen-blkfront: Handle discard requests.')
Reported-by: Arthur Borsboom <redacted>
Signed-off-by: Roger Pau Monné <redacted>
---
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Konrad Rzeszutek Wilk <redacted>
Cc: "Roger Pau Monné" <redacted>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: xen-devel@lists.xenproject.org
Cc: linux-block@vger.kernel.org
Cc: Arthur Borsboom <redacted>
---
Changes since v2:
- Allow all discard-* nodes to be optional.
---
drivers/block/xen-blkfront.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
From: Jürgen Groß <jgross@suse.com> Date: 2021-01-27 08:28:30
On 19.01.21 11:57, Roger Pau Monne wrote:
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: ed30bf317c5ce ('xen-blkfront: Handle discard requests.')
Reported-by: Arthur Borsboom <redacted>
Signed-off-by: Roger Pau Monné <redacted>