From: Roger Pau Monne <hidden> Date: 2021-01-18 15:21:56
Don't require the discard-alignment xenstore node to be present in
order to correctly setup the feature. This can happen with versions of
QEMU that only write the discard-granularity but not the
discard-alignment node.
Assume discard-alignment is 0 if not present. While there also fix the
logic to not enable the discard feature if discard-granularity is not
present.
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>
---
drivers/block/xen-blkfront.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
From: Jürgen Groß <jgross@suse.com> Date: 2021-01-19 07:45:28
On 18.01.21 16:15, Roger Pau Monne wrote:
quoted hunk
Don't require the discard-alignment xenstore node to be present in
order to correctly setup the feature. This can happen with versions of
QEMU that only write the discard-granularity but not the
discard-alignment node.
Assume discard-alignment is 0 if not present. While there also fix the
logic to not enable the discard feature if discard-granularity is not
present.
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>
---
drivers/block/xen-blkfront.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
This would mean that "discard-secure" will be evaluated only if the
other two items are set in Xenstore. From blkif.h I can't see this is
required, and your patch is modifying today's behavior in this regard.
You might want to have three xenbus_read_unsigned() calls instead.
Juergen
From: Roger Pau Monné <hidden> Date: 2021-01-19 10:26:07
On Tue, Jan 19, 2021 at 08:43:01AM +0100, Jürgen Groß wrote:
On 18.01.21 16:15, Roger Pau Monne wrote:
quoted
Don't require the discard-alignment xenstore node to be present in
order to correctly setup the feature. This can happen with versions of
QEMU that only write the discard-granularity but not the
discard-alignment node.
Assume discard-alignment is 0 if not present. While there also fix the
logic to not enable the discard feature if discard-granularity is not
present.
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>
---
drivers/block/xen-blkfront.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
This would mean that "discard-secure" will be evaluated only if the
other two items are set in Xenstore. From blkif.h I can't see this is
required, and your patch is modifying today's behavior in this regard.
You might want to have three xenbus_read_unsigned() calls instead.
You are right, discard-secure should be fetched regardless of whether
discard-alignment exists.
I can fetch discard-granularity and discard-alignment using
xenbus_gather and keep discard-secure using xenbus_read_unsigned. Let
me send a new version.
Thanks, Roger.
From: Jürgen Groß <jgross@suse.com> Date: 2021-01-19 10:39:05
On 19.01.21 11:06, Roger Pau Monné wrote:
On Tue, Jan 19, 2021 at 08:43:01AM +0100, Jürgen Groß wrote:
quoted
On 18.01.21 16:15, Roger Pau Monne wrote:
quoted
Don't require the discard-alignment xenstore node to be present in
order to correctly setup the feature. This can happen with versions of
QEMU that only write the discard-granularity but not the
discard-alignment node.
Assume discard-alignment is 0 if not present. While there also fix the
logic to not enable the discard feature if discard-granularity is not
present.
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>
---
drivers/block/xen-blkfront.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
This would mean that "discard-secure" will be evaluated only if the
other two items are set in Xenstore. From blkif.h I can't see this is
required, and your patch is modifying today's behavior in this regard.
You might want to have three xenbus_read_unsigned() calls instead.
You are right, discard-secure should be fetched regardless of whether
discard-alignment exists.
I can fetch discard-granularity and discard-alignment using
xenbus_gather and keep discard-secure using xenbus_read_unsigned. Let
me send a new version.
I'm still not convinced this is correct. blkif.h doesn't mention that
discard-alignment will be valid only with discard-granularity being
present.
Juergen
From: Roger Pau Monné <hidden> Date: 2021-01-19 10:48:36
On Tue, Jan 19, 2021 at 11:11:26AM +0100, Jürgen Groß wrote:
On 19.01.21 11:06, Roger Pau Monné wrote:
quoted
On Tue, Jan 19, 2021 at 08:43:01AM +0100, Jürgen Groß wrote:
quoted
On 18.01.21 16:15, Roger Pau Monne wrote:
quoted
Don't require the discard-alignment xenstore node to be present in
order to correctly setup the feature. This can happen with versions of
QEMU that only write the discard-granularity but not the
discard-alignment node.
Assume discard-alignment is 0 if not present. While there also fix the
logic to not enable the discard feature if discard-granularity is not
present.
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>
---
drivers/block/xen-blkfront.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
This would mean that "discard-secure" will be evaluated only if the
other two items are set in Xenstore. From blkif.h I can't see this is
required, and your patch is modifying today's behavior in this regard.
You might want to have three xenbus_read_unsigned() calls instead.
You are right, discard-secure should be fetched regardless of whether
discard-alignment exists.
I can fetch discard-granularity and discard-alignment using
xenbus_gather and keep discard-secure using xenbus_read_unsigned. Let
me send a new version.
I'm still not convinced this is correct. blkif.h doesn't mention that
discard-alignment will be valid only with discard-granularity being
present.
No, in fact I think I need to rework this a little further. Just
having feature-discard = 1 should enable the discard functionality, by
setting discard-granularity = physical block size and
discard-alignment = 0.
Roger.