mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Fix lookup_bdev() on Ubuntu
Ubuntu added support for checking inode permissions to lookup_bdev() in kernel commit 193fb6a2c94fab8eb8ce70a5da4d21c7d4023bee (merged in 4.4.0-6.21). Upstream bug: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1636517 This patch adds a test for Ubuntu's variant of lookup_bdev() to configure and calls the function in the correct way. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Hajo Möller <dasjoe@gmail.com> Closes #5336
This commit is contained in:
committed by
Brian Behlendorf
parent
76a87a902e
commit
e02aaf17f1
@@ -263,12 +263,21 @@ bio_set_flags_failfast(struct block_device *bdev, int *flags)
|
||||
|
||||
/*
|
||||
* 2.6.27 API change
|
||||
* The function was exported for use, prior to this it existed by the
|
||||
* The function was exported for use, prior to this it existed but the
|
||||
* symbol was not exported.
|
||||
*
|
||||
* 4.4.0-6.21 API change for Ubuntu
|
||||
* lookup_bdev() gained a second argument, FMODE_*, to check inode permissions.
|
||||
*/
|
||||
#ifndef HAVE_LOOKUP_BDEV
|
||||
#define lookup_bdev(path) ERR_PTR(-ENOTSUP)
|
||||
#endif
|
||||
#ifdef HAVE_1ARG_LOOKUP_BDEV
|
||||
#define vdev_lookup_bdev(path) lookup_bdev(path)
|
||||
#else
|
||||
#ifdef HAVE_2ARGS_LOOKUP_BDEV
|
||||
#define vdev_lookup_bdev(path) lookup_bdev(path, 0)
|
||||
#else
|
||||
#define vdev_lookup_bdev(path) ERR_PTR(-ENOTSUP)
|
||||
#endif /* HAVE_2ARGS_LOOKUP_BDEV */
|
||||
#endif /* HAVE_1ARG_LOOKUP_BDEV */
|
||||
|
||||
/*
|
||||
* 2.6.30 API change
|
||||
|
||||
Reference in New Issue
Block a user