rbd: use snprintf for disk->disk_name

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2011-05-12 20:57:03 -07:00
parent 916d4d6727
commit aedfec59ee
1 changed files with 2 additions and 1 deletions

View File

@ -1721,7 +1721,8 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
if (!disk) if (!disk)
goto out; goto out;
sprintf(disk->disk_name, DRV_NAME "%d", rbd_dev->id); snprintf(disk->disk_name, sizeof(disk->disk_name), DRV_NAME "%d",
rbd_dev->id);
disk->major = rbd_dev->major; disk->major = rbd_dev->major;
disk->first_minor = 0; disk->first_minor = 0;
disk->fops = &rbd_bd_ops; disk->fops = &rbd_bd_ops;