Skip to content

Commit 0077a50

Browse files
committed
rbd: resurrect setting of disk->private_data in rbd_init_disk()
rbd_open() and rbd_release() expect that disk->private_data is set to rbd_dev. Otherwise we hit a NULL pointer dereference when mapping the image. URL: https://tracker.ceph.com/issues/51759 Fixes: 195b195 ("rbd: use blk_mq_alloc_disk and blk_cleanup_disk") Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
1 parent cdb330f commit 0077a50

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/block/rbd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4943,6 +4943,7 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
49434943
disk->minors = RBD_MINORS_PER_MAJOR;
49444944
}
49454945
disk->fops = &rbd_bd_ops;
4946+
disk->private_data = rbd_dev;
49464947

49474948
blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
49484949
/* QUEUE_FLAG_ADD_RANDOM is off by default for blk-mq */

0 commit comments

Comments
 (0)