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

Re: Xen VM call trace on fstrim: Error: discard_granularity is 0.


  • To: Arthur Borsboom <arthurborsboom@xxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 18 Jan 2021 11:54:54 +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=ECoIQ7F03ROWxHh0rOIMyqtYBExm0vtddF9D5UGzx3o=; b=NzW1irUYVR7ez0b2ZfU/4TdN+h5BiE2HZMnKCYuqzEIzyy50J+wudhfIT7yHvvOYNJ8fU9Hs90oKDavEXN17xj9wPO5hu6w/DDV38gdzPspDkZcrUGhHm+AabDRP2ARQw3TdSazUHiAYKOr37I3L8Qpv4ifVtyasJCcBrAkooOf/RCljhA+nAoYrsDEd9n6Q7sylUYTgcOXh78Fe5M+/p8Sn7xcwT8yqGiZMqgy9FJ7NRmUxNA10AGWb8Rep8V96WY9mmHAKzf3j0GPEG3y/XU6GZn25HTAFvxoe5ZfbsKpI5YVcsVCt6Nw9rzwTDaID40xE8hjVihy17S4QlaBByw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MMS99ZaBo8OIkZGo6pqBxx8m3oFIPSQ6Ni7fxgIz8HFujmhy+TvaDWIP7Dls6SAjqb+LgpftPa5jyxbwpgJOJJAY8jpXRhbeJeykjNIPISQEtCI2Li2dcRrEvIuYN/2ONswTs7p1OcO1nab6p772TUGPNovkgwD/9cGKW+Cm2nJ/kHuj2biuZofpcyKopo5DHT0UnK3lwjoC3i+KEZMKwb9oZwBhPiAdQ+9U/rJi7qKR8Vt4qSAZK98A3JeEynqtUUHEOBYPErjGSsnL+3E5ow17padb6+6C7lXAMwBmu3v9pV+JRy1WnfPfMf4mXQNWyzymYLWniucwUE+v2UkYwQ==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxx>
  • Delivery-date: Mon, 18 Jan 2021 10:55:13 +0000
  • Ironport-sdr: 3jYeWhbK+hReBmfwOYtcTU5ykpVOqKZjlJrzBYafK085RxMfEfm6hgWRaVEWDNm5DUlKd/08cH 9AShoeA7h+DBFvUvPT7iZmxxhUtscEo55sEhZqlHKzdYk5vT4636zbbim86bAo3DZvdLUVC3Hj YoS8oO7X/3Ex8tqWyJw1GVbz0qkIMjljHnX1uZyItqFkpHXUKHioFzxZO/zwKb+wm9Ov/+gtLg 0bVHowDWPQiYcZOilJMmIAN56ua/XGyT1M48DBE59JZ6/CGq7UTyY1nJilhu93+GRfMAPwnDBx xWg=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Jan 18, 2021 at 11:25:49AM +0100, Arthur Borsboom wrote:
> Find attached the output of xenstore-ls

Thanks, that's very helpful. I think this is ude to QEMU not writing
the discard-aligment node, which leads to blkfront only setting the
discard feature partially.

Could you give a try to the following patch on on domU? I think it
should solve your issues (I've only build tested it).

---8<---
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);
-       if (!err) {
-               info->discard_granularity = discard_granularity;
-               info->discard_alignment = discard_alignment;
-       }
-       info->feature_secdiscard =
-               !!xenbus_read_unsigned(info->xbdev->otherend, "discard-secure",
-                                      0);
+
+       if (!discard_granularity)
+               return;
+
+       info->feature_discard = 1;
+       info->discard_granularity = discard_granularity;
+       info->discard_alignment = discard_alignment;
+       info->feature_secdiscard = !!discard_secure;
 }
 
 static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo)



 


Rackspace

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