Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: fix op_is_zone_mgmt() to handle REQ_OP_ZONE_RESET_ALL

REQ_OP_ZONE_RESET_ALL is a zone management request. Fix
op_is_zone_mgmt() to return true for that operation, like it already
does for REQ_OP_ZONE_RESET.

While no problems were reported without this fix, this change allows
strengthening checks in various block device drivers (scsi sd,
virtioblk, DM) where op_is_zone_mgmt() is used to verify that a zone
management command is not being issued to a regular block device.

Fixes: 6c1b1da58f8c ("block: add zone open, close and finish operations")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Damien Le Moal and committed by
Jens Axboe
12a1c935 4c8cf6bd

+1
+1
include/linux/blk_types.h
··· 478 478 { 479 479 switch (op & REQ_OP_MASK) { 480 480 case REQ_OP_ZONE_RESET: 481 + case REQ_OP_ZONE_RESET_ALL: 481 482 case REQ_OP_ZONE_OPEN: 482 483 case REQ_OP_ZONE_CLOSE: 483 484 case REQ_OP_ZONE_FINISH: