All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libdm-iface: not output error message inside retry loops
@ 2015-08-27  8:30 Liuhua Wang
  2015-08-27 11:59 ` Zdenek Kabelac
  0 siblings, 1 reply; 8+ messages in thread
From: Liuhua Wang @ 2015-08-27  8:30 UTC (permalink / raw)
  To: lvm-devel

    To avoid noisy error message being output inside retry loops
    in case of remove failure because device busy.
---
 libdm/ioctl/libdm-iface.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
index 73af12b..287e917 100644
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
@@ -63,6 +63,8 @@
 #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;
 static unsigned _dm_version_minor = 0;
@@ -1848,7 +1850,7 @@ 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
+			else if(dmt->ioctl_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,
@@ -1901,7 +1903,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)
-- 
1.8.4.5



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-08-31  9:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-27  8:30 [PATCH] libdm-iface: not output error message inside retry loops Liuhua Wang
2015-08-27 11:59 ` Zdenek Kabelac
2015-08-28  2:58   ` Liuhua Wang
2015-08-28 10:16     ` Zdenek Kabelac
2015-08-28 11:24       ` Liuhua Wang
2015-08-28 11:52         ` Zdenek Kabelac
2015-08-31  8:39           ` Liuhua Wang
2015-08-31  9:30             ` Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.