mirror of https://gitee.com/openkylin/linux.git
rbd: use snprintf for disk->disk_name
Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
916d4d6727
commit
aedfec59ee
|
@ -1721,7 +1721,8 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
|
|||
if (!disk)
|
||||
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->first_minor = 0;
|
||||
disk->fops = &rbd_bd_ops;
|
||||
|
|
Loading…
Reference in New Issue