All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/7][retry remove] Add "--retry" option to dmsetup to enable "retry remove" logic
@ 2011-09-20 12:56 Peter Rajnoha
  0 siblings, 0 replies; only message in thread
From: Peter Rajnoha @ 2011-09-20 12:56 UTC (permalink / raw)
  To: lvm-devel

 tools/dmsetup.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index fbdbc6a..f35c8a5 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -140,6 +140,7 @@ enum {
 	NOUDEVSYNC_ARG,
 	OPTIONS_ARG,
 	READAHEAD_ARG,
+	RETRY_ARG,
 	ROWS_ARG,
 	SEPARATOR_ARG,
 	SETUUID_ARG,
@@ -1279,6 +1280,9 @@ static int _simple(int task, const char *name, uint32_t event_nr, int display)
 	if (udev_wait_flag && !dm_task_set_cookie(dmt, &cookie, udev_flags))
 		goto out;
 
+	if (_switches[RETRY_ARG] && task == DM_DEVICE_REMOVE)
+		dm_task_retry_remove(dmt);
+
 	r = dm_task_run(dmt);
 
       out:
@@ -2805,7 +2809,7 @@ static void _usage(FILE *out)
 		"        [--checks] [-v|--verbose [-v|--verbose ...]]\n"
 		"        [-r|--readonly] [--noopencount] [--nolockfs] [--inactive]\n"
 		"        [--udevcookie [cookie]] [--noudevrules] [--noudevsync] [--verifyudev]\n"
-		"        [-y|--yes] [--readahead [+]<sectors>|auto|none]\n"
+		"        [-y|--yes] [--readahead [+]<sectors>|auto|none] [--retry]\n"
 		"        [-c|-C|--columns] [-o <fields>] [-O|--sort <sort_fields>]\n"
 		"        [--nameprefixes] [--noheadings] [--separator <separator>]\n\n");
 	for (i = 0; _commands[i].name; i++)
@@ -3178,6 +3182,7 @@ static int _process_switches(int *argc, char ***argv, const char *dev_dir)
 		{"noudevsync", 0, &ind, NOUDEVSYNC_ARG},
 		{"options", 1, &ind, OPTIONS_ARG},
 		{"readahead", 1, &ind, READAHEAD_ARG},
+		{"retry", 0, &ind, RETRY_ARG},
 		{"rows", 0, &ind, ROWS_ARG},
 		{"separator", 1, &ind, SEPARATOR_ARG},
 		{"setuuid", 0, &ind, SETUUID_ARG},
@@ -3362,6 +3367,8 @@ static int _process_switches(int *argc, char ***argv, const char *dev_dir)
 				}
 			}
 		}
+		if ((ind == RETRY_ARG))
+			_switches[RETRY_ARG]++;
 		if ((ind == ROWS_ARG))
 			_switches[ROWS_ARG]++;
 		if ((ind == SETUUID_ARG))



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-20 12:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20 12:56 [PATCH 2/7][retry remove] Add "--retry" option to dmsetup to enable "retry remove" logic Peter Rajnoha

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.