lvm2/libdm-iface-not-output-error-message-inside-retry-loop.patch

45 lines
1.6 KiB
Diff

From a70f17fd1dc9a8cccefb946c3501d5cb6f2766bb Mon Sep 17 00:00:00 2001
From: Liuhua Wang <lwang@suse.com>
Date: Mon, 23 Nov 2015 13:49:39 +0800
Subject: [PATCH] libdm-iface: not output error message inside retry loops
This is a workaround to avoid noisy error message being output inside retry loops
in case of remove failure because device busy. But as to the replies from upstream
there may be some issues in udev operations.
References: bsc#940298 boo#957059
Signed-off-by: lwang@suse.com
---
libdm/ioctl/libdm-iface.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: LVM2.2.02.141/libdm/ioctl/libdm-iface.c
===================================================================
--- LVM2.2.02.141.orig/libdm/ioctl/libdm-iface.c
+++ LVM2.2.02.141/libdm/ioctl/libdm-iface.c
@@ -62,6 +62,7 @@
*/
#define MAPPER_CTRL_MINOR 236
#define MISC_MAJOR 10
+#define DM_IOCTL_RETRIES 25
/* dm major version no for running kernel */
static unsigned _dm_version = DM_VERSION_MAJOR;
@@ -1862,7 +1863,7 @@ static struct dm_ioctl *_do_dm_ioctl(str
dmt->major > 0 && dmt->minor == 0 ? "0" : "",
dmt->major > 0 ? ")" : "",
strerror(dmt->ioctl_errno));
- else
+ else if(errno != EBUSY || retry_repeat_count == DM_IOCTL_RETRIES)
log_error("device-mapper: %s ioctl on %s%s%s%.0d%s%.0d%s%s "
"failed: %s",
_cmd_data_v4[dmt->type].name,
@@ -1915,7 +1916,6 @@ void dm_task_update_nodes(void)
update_devs();
}
-#define DM_IOCTL_RETRIES 25
#define DM_RETRY_USLEEP_DELAY 200000
int dm_task_get_errno(struct dm_task *dmt)