We need to set dma-buf-io tag to be able to share contexts between
multiple files. Use gendisk pointer as a tag, this allows sharing
b/w different partitions of the same block device.

Fixes: 839231d19393 ("block: add dma-buf support for raw bdev")
Signed-off-by: Pavel Begunkov <[email protected]>
---
 block/fops.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/fops.c b/block/fops.c
index 60b9c9b1cefe..6f013780b76b 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -687,6 +687,7 @@ static int blkdev_open(struct inode *inode, struct file 
*filp)
        ret = bdev_open(bdev, mode, filp->private_data, NULL, filp);
        if (ret)
                blkdev_put_no_open(bdev);
+       filp->f_dma_io_tag = (unsigned long)bdev->bd_disk;
        return ret;
 }
 
-- 
2.54.0

Reply via email to