aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorTao Chen <boby.chen@huawei.com>2015-03-27 09:15:54 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2015-04-07 10:32:42 -0400
commit1375590d3e18b4d87d2f768178e93a0c8644a7dc (patch)
treed32405daeee72d703e42f906c9805808039dcd3f /drivers/block
parentde9ad6d4edb63e0ba5d5aae365fb3565064fc00d (diff)
xen-blkback: enlarge the array size of blkback name
The blkback name is like blkback.domid.xvd[a-z], if domid has four digits (means larger than 1000), then the backmost xvd wouldn't be fully shown. Define a BLKBACK_NAME_LEN macro to be 20, enlarge the array size of blkback name, so it will be fully shown in any case. Signed-off-by: Tao Chen <boby.chen@huawei.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/xen-blkback/xenbus.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index e3afe97280b1..b33083e67f8c 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -21,6 +21,9 @@
21#include <xen/grant_table.h> 21#include <xen/grant_table.h>
22#include "common.h" 22#include "common.h"
23 23
24/* Enlarge the array size in order to fully show blkback name. */
25#define BLKBACK_NAME_LEN (20)
26
24struct backend_info { 27struct backend_info {
25 struct xenbus_device *dev; 28 struct xenbus_device *dev;
26 struct xen_blkif *blkif; 29 struct xen_blkif *blkif;
@@ -70,7 +73,7 @@ static int blkback_name(struct xen_blkif *blkif, char *buf)
70 else 73 else
71 devname = devpath; 74 devname = devpath;
72 75
73 snprintf(buf, TASK_COMM_LEN, "blkback.%d.%s", blkif->domid, devname); 76 snprintf(buf, BLKBACK_NAME_LEN, "blkback.%d.%s", blkif->domid, devname);
74 kfree(devpath); 77 kfree(devpath);
75 78
76 return 0; 79 return 0;
@@ -79,7 +82,7 @@ static int blkback_name(struct xen_blkif *blkif, char *buf)
79static void xen_update_blkif_status(struct xen_blkif *blkif) 82static void xen_update_blkif_status(struct xen_blkif *blkif)
80{ 83{
81 int err; 84 int err;
82 char name[TASK_COMM_LEN]; 85 char name[BLKBACK_NAME_LEN];
83 86
84 /* Not ready to connect? */ 87 /* Not ready to connect? */
85 if (!blkif->irq || !blkif->vbd.bdev) 88 if (!blkif->irq || !blkif->vbd.bdev)