mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
zloop: check for spurious options passed to remove
Zloop uses a command option parser for all control commands,
but most options are only valid for adding a new device. Check
for incorrectly specified options in the remove handler.
Fixes: eb0570c7df ("block: new zoned loop block device driver")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
6acf7860dc
commit
3c4617117a
@@ -1174,7 +1174,12 @@ static int zloop_ctl_remove(struct zloop_options *opts)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!(opts->mask & ZLOOP_OPT_ID)) {
|
if (!(opts->mask & ZLOOP_OPT_ID)) {
|
||||||
pr_err("No ID specified\n");
|
pr_err("No ID specified for remove\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opts->mask & ~ZLOOP_OPT_ID) {
|
||||||
|
pr_err("Invalid option specified for remove\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user