Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: fix the exclusive open mask in disk_scan_partitions

FMODE_EXEC has nothing to do with exclusive opens, and even is of
the wrong type. We need to check for BLK_OPEN_EXCL here.

Fixes: 985958b8584c ("block: fix wrong mode for blkdev_get_by_dev() from disk_scan_partitions()")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230621124914.185992-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
56e71bdf b6f3f28f

+1 -1
+1 -1
block/genhd.c
··· 366 366 } 367 367 368 368 set_bit(GD_NEED_PART_SCAN, &disk->state); 369 - bdev = blkdev_get_by_dev(disk_devt(disk), mode & ~FMODE_EXEC, NULL, 369 + bdev = blkdev_get_by_dev(disk_devt(disk), mode & ~BLK_OPEN_EXCL, NULL, 370 370 NULL); 371 371 if (IS_ERR(bdev)) 372 372 ret = PTR_ERR(bdev);