From 3c4d9dd3571e89545d97c8421fd4cbdbaa6895b8 Mon Sep 17 00:00:00 2001 From: Eric Ren Date: Tue, 11 Apr 2017 11:09:26 +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 Patch-refreshed-by: Eric Ren --- libdm/ioctl/libdm-iface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c index cb3e8dc..c1c0771 100644 --- a/libdm/ioctl/libdm-iface.c +++ b/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,8 +1863,8 @@ static struct dm_ioctl *_do_dm_ioctl(struct dm_task *dmt, unsigned command, dmt->major > 0 && dmt->minor == 0 ? "0" : "", dmt->major > 0 ? ")" : "", strerror(dmt->ioctl_errno)); - else - log_error("device-mapper: %s ioctl on %s %s%s%.0d%s%.0d%s%s " + 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, dmi->name, dmi->uuid, @@ -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) -- 2.10.2