xen-blkfront: fix data size for xenbus_gather in blkfront_connect
authorMarek Marczykowski <marmarek@mimuw.edu.pl>
Tue, 3 May 2011 16:04:52 +0000 (12:04 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 12 May 2011 12:55:51 +0000 (08:55 -0400)
barrier variable is int, not long. This overflow caused another variable
override: "err" (in PV code) and "binfo" (in xenlinux code -
drivers/xen/blkfront/blkfront.c). The later caused incorrect device
flags (RO/removable etc).

Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
[v1: Changed title]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/block/xen-blkfront.c

index 9cb8668ff5f412908e99dadcafd6d025904a2cdc..20759817ad57921a86f80eef40b74e4f5f978f65 100644 (file)
@@ -1141,7 +1141,7 @@ static void blkfront_connect(struct blkfront_info *info)
        }
 
        err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
-                           "feature-barrier", "%lu", &barrier,
+                           "feature-barrier", "%d", &barrier,
                            NULL);
 
        /*