public inbox for
help / color / mirror / Atom feed
Subject: LVM2/daemons/clvmd lvm-functions.c
Date: Wed, 30 Jun 2010 21:40:00 -0000	[thread overview]
Message-ID: <> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	2010-06-30 21:40:27

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	Maintain memlock balance in clvmd.
	When a mirror is being downconverted in a cluster, a series of suspends and
	resumes is executed.
	With the change to using UUIDs in dev_manager instead of names, the behaviour
	has changed with regards to including an _mlog in the deptree of a logical
	volume. In the old (pre-UUID-enabled) code, the _mlog would appear in a deptree
	of any volume purely based on a name match: a linear volume foo would include
	foo_mlog in its dependencies if that happened to exist. This behaviour was
	fixed and the mlog is now only included for mirrors.
	By a coincidence, this mlog bug had been hiding a different bug in clvmd. When
	a mirror is being dismantled (and converted to a linear volume), it is first
	suspended as a whole, then later resumed in parts. Nevertheless, the overall
	memlock balance is maintained in this operation. The problem kicks in, because
	even though the mirror log was suspended as part of the mirror, when the
	dismantled mirror is resumed again, it is no longer a mirror and therefore the
	mirror log stays suspended. This would not be a problem in itself, since
	_delete_lv (from metadata/mirror.c) is called on it subsequently, which does an
	activate/deactivate cycle and removes the LV. The activate/deactivate cycle
	correctly prompts clvmd to resume the device: however, in doing this, it will
	issue an unpaired resume operation (the suspend that caused the mirror log to
	be suspended is paired with resuming the dismantled mirror later). We have
	concluded that the path in clvmd should never affect memlock_count, since there
	should never be an unmatched explicit suspend preceding this resume.


--- LVM2/daemons/clvmd/lvm-functions.c	2010/06/21 15:56:58	1.94
+++ LVM2/daemons/clvmd/lvm-functions.c	2010/06/30 21:40:27	1.95
@@ -354,9 +354,13 @@
 	if (!lv_info_by_lvid(cmd, resource, &lvi, 0, 0))
 		goto error;
-	if (lvi.suspended)
-		if (!lv_resume(cmd, resource))
+	if (lvi.suspended) {
+		memlock_inc(cmd);
+		if (!lv_resume(cmd, resource)) {
+			memlock_dec(cmd);
 			goto error;
+		}
+	}
 	/* Now activate it */
 	if (!lv_activate(cmd, resource, exclusive))

             reply	other threads:[~2010-06-30 21:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-30 21:40 mornfall [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-01 22:55 zkabelac
2012-03-01 21:18 zkabelac
2010-11-29 11:05 zkabelac
2009-12-09 19:30 mbroz
2008-06-06 16:37 agk
2007-11-14 13:37 pcaulfield
2007-08-23 12:44 pcaulfield
2006-10-24 18:49 jbrassow
2006-10-06 10:06 pcaulfield
2006-08-22  9:49 pcaulfield
2006-05-15 12:32 pcaulfield
2006-05-15 11:56 agk
2004-09-22 12:10 pcaulfield
2004-06-28 10:26 pcaulfield

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:

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

  git send-email \ \ \ \ \

* 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).