Skip to content

Commit

Permalink
Ensure BLK_OPEN_EXCL is defined in HAVE_BLKDEV_GET_BY_PATH_4ARG case
Browse files Browse the repository at this point in the history
On some systems we already have blkdev_get_by_path() with 4 args
but still the old FMODE_EXCL and not BLK_OPEN_EXCL defined.

Signed-off-by: Dominik Heidler <dheidler@suse.de>
  • Loading branch information
asdil12 committed Dec 19, 2023
1 parent dbda451 commit d56320c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions module/os/linux/zfs/vdev_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ vdev_blkdev_get_by_path(const char *path, spa_mode_t mode, void *holder,
const struct blk_holder_ops *hops)
{
#ifdef HAVE_BLKDEV_GET_BY_PATH_4ARG
#if !defined(BLK_OPEN_EXCL)
#define BLK_OPEN_EXCL FMODE_EXCL
#endif
return (blkdev_get_by_path(path,
vdev_bdev_mode(mode) | BLK_OPEN_EXCL, holder, hops));
#else
Expand Down

0 comments on commit d56320c

Please sign in to comment.