mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 17:25:38 +00:00
block: Fix flush request sector restore
Make sure that a request bio is not NULL before trying to restore the
request start sector.
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Fixes: 6f8fd758de
("block: Restore sector of flush requests")
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20240501110907.96950-9-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
7b29518728
commit
af147b740f
@ -130,7 +130,8 @@ static void blk_flush_restore_request(struct request *rq)
|
||||
* original @rq->bio. Restore it.
|
||||
*/
|
||||
rq->bio = rq->biotail;
|
||||
rq->__sector = rq->bio->bi_iter.bi_sector;
|
||||
if (rq->bio)
|
||||
rq->__sector = rq->bio->bi_iter.bi_sector;
|
||||
|
||||
/* make @rq a normal request */
|
||||
rq->rq_flags &= ~RQF_FLUSH_SEQ;
|
||||
|
Loading…
Reference in New Issue
Block a user