diff options
-rw-r--r-- | drivers/block/xen-blkfront.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 60006b730872..f47b0961fab1 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -930,9 +930,24 @@ static void blkfront_connect(struct blkfront_info *info) | |||
930 | unsigned int binfo; | 930 | unsigned int binfo; |
931 | int err; | 931 | int err; |
932 | 932 | ||
933 | if ((info->connected == BLKIF_STATE_CONNECTED) || | 933 | switch (info->connected) { |
934 | (info->connected == BLKIF_STATE_SUSPENDED) ) | 934 | case BLKIF_STATE_CONNECTED: |
935 | /* | ||
936 | * Potentially, the back-end may be signalling | ||
937 | * a capacity change; update the capacity. | ||
938 | */ | ||
939 | err = xenbus_scanf(XBT_NIL, info->xbdev->otherend, | ||
940 | "sectors", "%Lu", §ors); | ||
941 | if (XENBUS_EXIST_ERR(err)) | ||
942 | return; | ||
943 | printk(KERN_INFO "Setting capacity to %Lu\n", | ||
944 | sectors); | ||
945 | set_capacity(info->gd, sectors); | ||
946 | |||
947 | /* fall through */ | ||
948 | case BLKIF_STATE_SUSPENDED: | ||
935 | return; | 949 | return; |
950 | } | ||
936 | 951 | ||
937 | dev_dbg(&info->xbdev->dev, "%s:%s.\n", | 952 | dev_dbg(&info->xbdev->dev, "%s:%s.\n", |
938 | __func__, info->xbdev->otherend); | 953 | __func__, info->xbdev->otherend); |