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:
Christoph Hellwig 2026-02-24 06:21:45 -08:00 committed by Jens Axboe
parent 6acf7860dc
commit 3c4617117a
1 changed files with 6 additions and 1 deletions

View File

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