提交 4d341d82 编写于 作者: M Mike Snitzer

dm: return earlier from dm_blk_ioctl if target doesn't implement .ioctl

No point checking if the device is suspended if the current target
doesn't even implement .ioctl
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
上级 5ec02084
...@@ -525,14 +525,15 @@ static int dm_blk_ioctl(struct block_device *bdev, fmode_t mode, ...@@ -525,14 +525,15 @@ static int dm_blk_ioctl(struct block_device *bdev, fmode_t mode,
goto out; goto out;
tgt = dm_table_get_target(map, 0); tgt = dm_table_get_target(map, 0);
if (!tgt->type->ioctl)
goto out;
if (dm_suspended_md(md)) { if (dm_suspended_md(md)) {
r = -EAGAIN; r = -EAGAIN;
goto out; goto out;
} }
if (tgt->type->ioctl) r = tgt->type->ioctl(tgt, cmd, arg);
r = tgt->type->ioctl(tgt, cmd, arg);
out: out:
dm_put_live_table(md, srcu_idx); dm_put_live_table(md, srcu_idx);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册