]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xen/blkback: Disable DISCARD support for loopback device (but leave for phy).
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 13 Mar 2012 22:05:58 +0000 (18:05 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 14 Mar 2012 16:16:53 +0000 (12:16 -0400)
Until we back-port the changes from 3.3 which alter the loopback device
to support the full gamma of discard attributes. Otherwise we have to
punch through loop device to retrieve the underlaying disk size and
do other nasty things to get the proper information.

Also there is the outstanding issue that Logical Volumes won't pass
through the DISCARD support, so in most cases we can't take advantage of
this code until that gets fixed.

Fixes Oracle BZ#13779884
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/block/xen-blkback/xenbus.c

index 9e9c8a1fc06ce0b7259b63a1beb16af2c27a2ba9..52ae86cee642659652614520bdd096d6d296e085 100644 (file)
@@ -397,7 +397,11 @@ int xen_blkbk_discard(struct xenbus_transaction xbt, struct backend_info *be)
        type = xenbus_read(XBT_NIL, dev->nodename, "type", NULL);
        if (!IS_ERR(type)) {
                if (strncmp(type, "file", 4) == 0) {
-                       state = 1;
+                       /* For this to work properly (so that discard-* attr
+                        * are propagated to the guest), we should back-port
+                        * loop request_queue discard support.
+                        */
+                       state = 0;
                        blkif->blk_backend_type = BLKIF_BACKEND_FILE;
                }
                if (strncmp(type, "phy", 3) == 0) {