Skip to content

Commit

Permalink
block: remove the NULL queue check in generic_make_request_checks
Browse files Browse the repository at this point in the history
All registers disks must have a valid queue pointer, so don't bother to
log a warning for that case.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Jul 1, 2020
1 parent c817867 commit 833f84e
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,22 +973,12 @@ static inline blk_status_t blk_check_zone_append(struct request_queue *q,
static noinline_for_stack bool
generic_make_request_checks(struct bio *bio)
{
struct request_queue *q;
struct request_queue *q = bio->bi_disk->queue;
int nr_sectors = bio_sectors(bio);
blk_status_t status = BLK_STS_IOERR;
char b[BDEVNAME_SIZE];

might_sleep();

q = bio->bi_disk->queue;
if (unlikely(!q)) {
printk(KERN_ERR
"generic_make_request: Trying to access "
"nonexistent block-device %s (%Lu)\n",
bio_devname(bio, b), (long long)bio->bi_iter.bi_sector);
goto end_io;
}

/*
* For a REQ_NOWAIT based request, return -EOPNOTSUPP
* if queue is not a request based queue.
Expand Down

0 comments on commit 833f84e

Please sign in to comment.