提交 57ba1059 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

target/iblock: fix holder printing in iblock_show_configfs_dev_params

bd_contains is never NULL for an open block device.  In addition ibd_bd
is always set to a block device that was exclusively opened by the
target code, so the holder is guranteed to be ib_dev as well.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 74f94454
...@@ -611,9 +611,8 @@ static ssize_t iblock_show_configfs_dev_params(struct se_device *dev, char *b) ...@@ -611,9 +611,8 @@ static ssize_t iblock_show_configfs_dev_params(struct se_device *dev, char *b)
bl += sprintf(b + bl, " "); bl += sprintf(b + bl, " ");
if (bd) { if (bd) {
bl += sprintf(b + bl, "Major: %d Minor: %d %s\n", bl += sprintf(b + bl, "Major: %d Minor: %d %s\n",
MAJOR(bd->bd_dev), MINOR(bd->bd_dev), (!bd->bd_contains) ? MAJOR(bd->bd_dev), MINOR(bd->bd_dev),
"" : (bd->bd_holder == ib_dev) ? "CLAIMED: IBLOCK");
"CLAIMED: IBLOCK" : "CLAIMED: OS");
} else { } else {
bl += sprintf(b + bl, "Major: 0 Minor: 0\n"); bl += sprintf(b + bl, "Major: 0 Minor: 0\n");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册