Skip to content

Commit

Permalink
block: remove the GENHD_FL_HIDDEN check in blkdev_get_no_open
Browse files Browse the repository at this point in the history
Hidden gendisks never hash the block device inode, so this can't happen.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211122130625.1136848-8-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Nov 29, 2021
1 parent 46e7eac commit 1408628
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions block/bdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,14 +750,6 @@ struct block_device *blkdev_get_no_open(dev_t dev)
if (!kobject_get_unless_zero(&bdev->bd_device.kobj))
bdev = NULL;
iput(inode);

if (!bdev)
return NULL;
if ((bdev->bd_disk->flags & GENHD_FL_HIDDEN)) {
put_device(&bdev->bd_device);
return NULL;
}

return bdev;
}

Expand Down

0 comments on commit 1408628

Please sign in to comment.