From 85c7629345e6c9e82affa7a8748dc7110edb4ae7 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sat, 14 Oct 2023 01:02:09 +0200 Subject: [PATCH] libdm: versionion symbol for enhanced dm_task_run When new app links with current dm_task_run() that propagates ioctl() errno - ensure it will not be usable with older version without this supported feature. --- libdm/.exported_symbols.DM_1_02_197 | 1 + libdm/ioctl/libdm-iface.c | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 libdm/.exported_symbols.DM_1_02_197 diff --git a/libdm/.exported_symbols.DM_1_02_197 b/libdm/.exported_symbols.DM_1_02_197 new file mode 100644 index 000000000..e5f0682a0 --- /dev/null +++ b/libdm/.exported_symbols.DM_1_02_197 @@ -0,0 +1 @@ +dm_task_run diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c index ac5fb3add..7e1372325 100644 --- a/libdm/ioctl/libdm-iface.c +++ b/libdm/ioctl/libdm-iface.c @@ -2055,7 +2055,21 @@ int dm_task_get_errno(struct dm_task *dmt) return dmt->ioctl_errno; } -int dm_task_run(struct dm_task *dmt) +#if defined(GNU_SYMVER) +/* + * Enforce new version 1_02_197 of dm_task_run() that propagates + * ioctl() errno is being linked to app. + */ +DM_EXPORT_SYMBOL_BASE(dm_task_run) +int dm_task_run_base(struct dm_task *dmt); +int dm_task_run_base(struct dm_task *dmt) +{ + return dm_task_run(dmt); +} +#endif + +DM_EXPORT_NEW_SYMBOL(int, dm_task_run, 1_02_197) + (struct dm_task *dmt) { struct dm_ioctl *dmi; unsigned command;