public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: prajnoha@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2 ./WHATS_NEW_DM libdm/libdevmapper.h libdm ...
Date: Thu, 22 Sep 2011 17:36:00 -0000	[thread overview]
Message-ID: <20110922173652.3351.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	prajnoha@sourceware.org	2011-09-22 17:36:51

Modified files:
	.              : WHATS_NEW_DM 
	libdm          : libdevmapper.h libdm-deptree.c 

Log message:
	Add dm_tree_retry_remove to use retry logic for device removal in a dm_tree.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.503&r2=1.504
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.152&r2=1.153
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.110&r2=1.111

--- LVM2/WHATS_NEW_DM	2011/09/22 17:23:35	1.503
+++ LVM2/WHATS_NEW_DM	2011/09/22 17:36:50	1.504
@@ -1,5 +1,6 @@
 Version 1.02.68 -
 ==================================
+  Add dm_tree_retry_remove to use retry logic for device removal in a dm_tree.
   Add dm_device_has_mounted_fs fn to check mounted filesystem on a device.
   Add dm_device_has_holders fn to to check use of the device by another device.
   Add dm_sysfs_dir to libdevmapper to retrieve sysfs location thas is set.
--- LVM2/libdm/libdevmapper.h	2011/09/22 17:23:36	1.152
+++ LVM2/libdm/libdevmapper.h	2011/09/22 17:36:50	1.153
@@ -422,6 +422,11 @@
 void dm_tree_use_no_flush_suspend(struct dm_tree_node *dnode);
 
 /*
+ * Retry removal of each device if not successful.
+ */
+void dm_tree_retry_remove(struct dm_tree_node *dnode);
+
+/*
  * Is the uuid prefix present in the tree?
  * Only returns 0 if every node was checked successfully.
  * Returns 1 if the tree walk has to be aborted.
--- LVM2/libdm/libdm-deptree.c	2011/09/22 17:33:51	1.110
+++ LVM2/libdm/libdm-deptree.c	2011/09/22 17:36:50	1.111
@@ -222,7 +222,8 @@
 	struct dm_hash_table *uuids;
 	struct dm_tree_node root;
 	int skip_lockfs;		/* 1 skips lockfs (for non-snapshots) */
-	int no_flush;		/* 1 sets noflush (mirrors/multipath) */
+	int no_flush;			/* 1 sets noflush (mirrors/multipath) */
+	int retry_remove;		/* 1 retries remove if not successful */
 	uint32_t cookie;
 };
 
@@ -1006,7 +1007,7 @@
 }
 
 static int _deactivate_node(const char *name, uint32_t major, uint32_t minor,
-			    uint32_t *cookie, uint16_t udev_flags)
+			    uint32_t *cookie, uint16_t udev_flags, int retry)
 {
 	struct dm_task *dmt;
 	int r = 0;
@@ -1029,6 +1030,10 @@
 	if (!dm_task_set_cookie(dmt, cookie, udev_flags))
 		goto out;
 
+
+	if (retry)
+		dm_task_retry_remove(dmt);
+
 	r = dm_task_run(dmt);
 
 	/* FIXME Until kernel returns actual name so dm-iface.c can handle it */
@@ -1231,7 +1236,8 @@
 			continue;
 
 		if (!_deactivate_node(name, info.major, info.minor,
-				      &child->dtree->cookie, child->udev_flags)) {
+				      &child->dtree->cookie, child->udev_flags,
+				      child->dtree->retry_remove)) {
 			log_error("Unable to deactivate %s (%" PRIu32
 				  ":%" PRIu32 ")", name, info.major,
 				  info.minor);
@@ -1266,6 +1272,11 @@
 	dnode->dtree->no_flush = 1;
 }
 
+void dm_tree_retry_remove(struct dm_tree_node *dnode)
+{
+	dnode->dtree->retry_remove = 1;
+}
+
 int dm_tree_suspend_children(struct dm_tree_node *dnode,
 			     const char *uuid_prefix,
 			     size_t uuid_prefix_len)


             reply	other threads:[~2011-09-22 17:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 17:36 prajnoha [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-02 17:31 zkabelac
2012-02-23 22:45 zkabelac
2012-02-15 12:23 prajnoha
2012-02-15 11:39 prajnoha
2012-02-15 11:27 prajnoha
2012-01-11 12:34 prajnoha
2011-12-21 12:47 zkabelac
2011-09-29  8:53 zkabelac
2011-09-22 17:23 prajnoha
2011-09-22 17:17 prajnoha
2011-09-22 17:09 prajnoha
2011-08-19 16:26 agk
2011-03-10 12:48 zkabelac
2011-02-18 14:38 zkabelac
2011-02-04 16:08 mbroz
2011-01-04 14:43 prajnoha
2010-10-25 13:13 zkabelac
2010-10-15  1:10 agk
2010-04-28 13:37 prajnoha
2009-11-13 12:43 prajnoha
2009-10-22 12:55 prajnoha
2009-06-03 11:40 agk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110922173652.3351.qmail@sourceware.org \
    --to=prajnoha@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).