Skip to content

Commit

Permalink
dm: return earlier from dm_blk_ioctl if target doesn't implement .ioctl
Browse files Browse the repository at this point in the history
No point checking if the device is suspended if the current target
doesn't even implement .ioctl

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Mike Snitzer committed Nov 19, 2014
1 parent 5ec0208 commit 4d341d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,14 +525,15 @@ static int dm_blk_ioctl(struct block_device *bdev, fmode_t mode,
goto out;

tgt = dm_table_get_target(map, 0);
if (!tgt->type->ioctl)
goto out;

if (dm_suspended_md(md)) {
r = -EAGAIN;
goto out;
}

if (tgt->type->ioctl)
r = tgt->type->ioctl(tgt, cmd, arg);
r = tgt->type->ioctl(tgt, cmd, arg);

out:
dm_put_live_table(md, srcu_idx);
Expand Down

0 comments on commit 4d341d8

Please sign in to comment.