[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen-blkfront: don't make discard-alignment mandatory


  • To: Jürgen Groß <jgross@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 19 Jan 2021 11:06:51 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lc8cFj7Eh/9trtedhQvRmKRka4ZR+13SpzisBpzDx6g=; b=eA1mhZfzWE7o1o3NHmurcOJWH2WeXXG7d5n6LyH3ZpGM2WDll2x9DqQX+Yu/nupsvmVAVZVof2xNwRC9W4dH6Mb0svDh7L3VsP86nu6u2SPb2f79f/mwOwAVgYmzG+pU7e6WgMj5hZnuFWG4wEFVDktS3+hUBjUPIAPm7xkm9Bs+Tyy83vTO8Ol7N1fGHUsgFsjjiHFZ4plaQ+e/U6RXsjlY/C/AB9ZBGzdmMC7O3kWHmRzpBG37oIjqu+6x40cbyFpoZlMhyJffzRNGUJ5X9xb1s1xPwXfT51UkE7IOeQcs+QoXvj8bYQtn/DZ0oro28dYHvEUhzQg4W4Xsci1ZzQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JI0XUotUQaEZValQfSFcb7Pn0oDqqMixD51pQEdPNBKF+XTimHLUqfd8V0KyN6iVp+f7JBBtToTh9o19wCgs2IWVO3xm4HaWa9MqHAfW4pirSFEljHWmyHA+bEGi8qPEecOENrIkAF4fACwvRKXGV7gAsnGvoC3auLNt4GUI4vdcQmUiQthEdTHUqyY1+KA6fT+haAGv45XJbrI3bwItuV4e/C6gP2ke7SerFTRr4Ywz1tfJE339kmYsnFyaOYklyq3rKi+iAnOjn0vMwABiu9gMR2khuowr9jvpYvxC2EVwk9U5hXgqicxdY/igATjhQYpqMuDqh2AoGYjWK5KIaA==
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: <linux-kernel@xxxxxxxxxxxxxxx>, Arthur Borsboom <arthurborsboom@xxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Jens Axboe <axboe@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <linux-block@xxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 19 Jan 2021 10:07:16 +0000
  • Ironport-sdr: C22xdEYPtmlMTywRWCzJWkbz4H34HboZFqMQZaLRBHJU6B7XaruOD7Pm60y4S+1oNspAVig0y6 4MJvJ520QTu85q9CcpmDZEn61DPRyYV6QEQ9kl9r/AdnokSiP0Ezv+GKLvKF/p8k4f+1Uj2429 wvQn/3YspDHrG8U+AP1GeqWYvezAOJt4EKbptRwESiPn24yDG2PndQjtvUK14tlLssweM58yuy uHcJQeHsdsb/s1Ua/41cFU+nwxMRXwJgBWBHi2t0kgwQQ4EsaLf6kMB1mww/W4LVm8LjXBIo8g lH8=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Jan 19, 2021 at 08:43:01AM +0100, Jürgen Groß wrote:
> On 18.01.21 16:15, Roger Pau Monne wrote:
> > 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 <arthurborsboom@xxxxxxxxx>
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> > ---
> > Cc: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
> > Cc: Juergen Gross <jgross@xxxxxxxx>
> > Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> > Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> > Cc: "Roger Pau Monné" <roger.pau@xxxxxxxxxx>
> > Cc: Jens Axboe <axboe@xxxxxxxxx>
> > Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
> > Cc: linux-block@xxxxxxxxxxxxxxx
> > Cc: Arthur Borsboom <arthurborsboom@xxxxxxxxx>
> > ---
> >   drivers/block/xen-blkfront.c | 25 +++++++++++++------------
> >   1 file changed, 13 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> > index 5265975b3fba..5a93f7cc2939 100644
> > --- a/drivers/block/xen-blkfront.c
> > +++ b/drivers/block/xen-blkfront.c
> > @@ -2179,22 +2179,23 @@ static void blkfront_closing(struct blkfront_info 
> > *info)
> >   static void blkfront_setup_discard(struct blkfront_info *info)
> >   {
> > -   int err;
> > -   unsigned int discard_granularity;
> > -   unsigned int discard_alignment;
> > +   unsigned int discard_granularity = 0;
> > +   unsigned int discard_alignment = 0;
> > +   unsigned int discard_secure = 0;
> > -   info->feature_discard = 1;
> > -   err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
> > +   xenbus_gather(XBT_NIL, info->xbdev->otherend,
> >             "discard-granularity", "%u", &discard_granularity,
> >             "discard-alignment", "%u", &discard_alignment,
> > +           "discard-secure", "%u", &discard_secure,
> >             NULL);
> 
> 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.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.