From: Milan Broz Date: Wed, 2 May 2012 12:17:34 +0000 (+0200) Subject: Switch on retry on device remove for libdevmapper. X-Git-Tag: upstream/1.6~288 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bbc3339bdafb14158240c00a777e3c9ddefdd243;p=platform%2Fupstream%2Fcryptsetup.git Switch on retry on device remove for libdevmapper. --- diff --git a/ChangeLog b/ChangeLog index b073b73..3511fc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * Fix loop mapping on readonly file. * Relax --shared test, allow mapping even for overlapping segments. * Support shared flag for LUKS devices (dangerous). + * Switch on retry on device remove for libdevmapper. 2012-04-09 Milan Broz * Fix header check to support old (cryptsetup 1.0.0) header alignment. (1.4.0) diff --git a/configure.in b/configure.in index 40cf066..43c607f 100644 --- a/configure.in +++ b/configure.in @@ -166,6 +166,7 @@ LIBS=$saved_LIBS LIBS="$LIBS $DEVMAPPER_LIBS" AC_CHECK_DECLS([dm_task_secure_data], [], [], [#include ]) +AC_CHECK_DECLS([dm_task_retry_remove], [], [], [#include ]) AC_CHECK_DECLS([DM_UDEV_DISABLE_DISK_RULES_FLAG], [have_cookie=yes], [have_cookie=no], [#include ]) if test "x$enable_udev" = xyes; then if test "x$have_cookie" = xno; then diff --git a/lib/libdevmapper.c b/lib/libdevmapper.c index 804403d..1997c13 100644 --- a/lib/libdevmapper.c +++ b/lib/libdevmapper.c @@ -295,6 +295,11 @@ static int _dm_simple(int task, const char *name, int udev_wait) if (name && !dm_task_set_name(dmt, name)) goto out; +#if HAVE_DECL_DM_TASK_RETRY_REMOVE + /* Used only in DM_DEVICE_REMOVE */ + if (name && !dm_task_retry_remove(dmt)) + goto out; +#endif if (udev_wait && !_dm_task_set_cookie(dmt, &cookie, 0)) goto out;