1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

libdm: correct version check

If there ever would be API version 5,
these check would give incorrect results.
This commit is contained in:
Zdenek Kabelac 2021-12-08 10:56:21 +01:00
parent 47ac2659d5
commit 39a121ddbc
2 changed files with 4 additions and 8 deletions

View File

@ -616,8 +616,7 @@ int dm_check_version(void)
int dm_cookie_supported(void) int dm_cookie_supported(void)
{ {
return (dm_check_version() && return (dm_check_version() &&
_dm_version >= 4 && ((_dm_version == 4) ? _dm_version_minor >= 15 : _dm_version > 4));
_dm_version_minor >= 15);
} }
static int _dm_inactive_supported(void) static int _dm_inactive_supported(void)
@ -1441,8 +1440,7 @@ static int _udev_complete(struct dm_task *dmt)
static int _check_uevent_generated(struct dm_ioctl *dmi) static int _check_uevent_generated(struct dm_ioctl *dmi)
{ {
if (!dm_check_version() || if (!dm_check_version() ||
_dm_version < 4 || ((_dm_version == 4) ? _dm_version_minor < 17 : _dm_version < 4))
_dm_version_minor < 17)
/* can't check, assume uevent is generated */ /* can't check, assume uevent is generated */
return 1; return 1;

View File

@ -609,8 +609,7 @@ int dm_check_version(void)
int dm_cookie_supported(void) int dm_cookie_supported(void)
{ {
return (dm_check_version() && return (dm_check_version() &&
_dm_version >= 4 && ((_dm_version == 4) ? _dm_version_minor >= 15 : _dm_version > 4));
_dm_version_minor >= 15);
} }
static int _dm_inactive_supported(void) static int _dm_inactive_supported(void)
@ -1436,8 +1435,7 @@ static int _udev_complete(struct dm_task *dmt)
static int _check_uevent_generated(struct dm_ioctl *dmi) static int _check_uevent_generated(struct dm_ioctl *dmi)
{ {
if (!dm_check_version() || if (!dm_check_version() ||
_dm_version < 4 || ((_dm_version == 4) ? _dm_version_minor < 17 : _dm_version < 4))
_dm_version_minor < 17)
/* can't check, assume uevent is generated */ /* can't check, assume uevent is generated */
return 1; return 1;