提交 aedfec59 编写于 作者: S Sage Weil

rbd: use snprintf for disk->disk_name

Signed-off-by: NSage Weil <sage@newdream.net>
上级 916d4d67
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册