On 9/27/21 10:22 PM, Christoph Hellwig wrote: > Just use the disk attached to the request_queue instead. > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > --- Please consider adding :- root@dev linux-block (for-next) # git diff drivers/mtd diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index b8ae1ec14e17..f0488694afdb 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -59,7 +59,7 @@ static blk_status_t do_blktrans_request(struct mtd_blktrans_ops *tr, } if (blk_rq_pos(req) + blk_rq_cur_sectors(req) > - get_capacity(req->rq_disk)) + get_capacity(req->q->disk)) return BLK_STS_IOERR; switch (req_op(req)) { * Without above patch :- root@dev linux-block (for-next) # makej drivers/mtd/ DESCEND objtool CALL scripts/atomic/check-atomics.sh CALL scripts/checksyscalls.sh CC [M] drivers/mtd/mtd_blkdevs.o CC [M] drivers/mtd/mtdblock.o LD [M] drivers/mtd/mtd.o drivers/mtd/mtd_blkdevs.c: In function ‘do_blktrans_request’: drivers/mtd/mtd_blkdevs.c:62:29: error: ‘struct request’ has no member named ‘rq_disk’ 62 | get_capacity(req->rq_disk)) | ^~ make[2]: *** [scripts/Makefile.build:277: drivers/mtd/mtd_blkdevs.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [scripts/Makefile.build:540: drivers/mtd] Error 2 make: *** [Makefile:1868: drivers] Error 2 root@dev linux-block (for-next) # * With above patch :- root@dev linux-block (for-next) # makej drivers/mtd/ DESCEND objtool CALL scripts/atomic/check-atomics.sh CALL scripts/checksyscalls.sh CC [M] drivers/mtd/mtd_blkdevs.o -ck