Commit 3c461711 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

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: eb0570c7 ("block: new zoned loop block device driver")
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 6acf7860
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1174,7 +1174,12 @@ static int zloop_ctl_remove(struct zloop_options *opts)
	int ret;

	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;
	}