public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: mbroz@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2 ./WHATS_NEW lib/cache/lvmcache.c lib/comm ...
Date: Tue, 24 Nov 2009 16:10:00 -0000	[thread overview]
Message-ID: <20091124161027.22448.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-11-24 16:10:26

Modified files:
	.              : WHATS_NEW 
	lib/cache      : lvmcache.c 
	lib/commands   : toolcontext.c toolcontext.h 

Log message:
	Refresh device filters before full device rescan in lvmcache.
	
	The sysfs filter initialise hash of available devices using
	scan of /sys/block. We need to refresh even this hash
	when performing full scan otherwise the newly appeared
	device could be rejected, because there is no entry
	in sysfs filter.
	
	This easily could happen when attaching new device
	to cluster node. (Only force refresh of context
	in clvmd -R works here now).
	
	Unfortunately consequences of this are much worse,
	missing device part on that node is replaced with missing segment
	(even when no partial arg is selected) and this directly
	lead to data corruption.
	
	See https://bugzilla.redhat.com/show_bug.cgi?id=538515
	
	Simply fix it by refreshing device filters in lvmcache
	before performing the full device scan.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1323&r2=1.1324
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.71&r2=1.72
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.86&r2=1.87
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.h.diff?cvsroot=lvm2&r1=1.35&r2=1.36

--- LVM2/WHATS_NEW	2009/11/24 16:08:49	1.1323
+++ LVM2/WHATS_NEW	2009/11/24 16:10:25	1.1324
@@ -1,5 +1,6 @@
 Version 2.02.56 - 
 ====================================
+  Refresh device filters before full device rescan in lvmcache.
   Return error status if vgchange fails to activate some volume.
   Fix memory lock imbalance in locking code.
   Revert vg_read_internal change, clvmd cannot use vg_read now. (2.02.55)
--- LVM2/lib/cache/lvmcache.c	2009/10/27 17:00:46	1.71
+++ LVM2/lib/cache/lvmcache.c	2009/11/24 16:10:25	1.72
@@ -510,6 +510,11 @@
 		goto out;
 	}
 
+	if (full_scan == 2 && !refresh_filters(cmd)) {
+		log_error("refresh filters failed");
+		goto out;
+	}
+
 	if (!(iter = dev_iter_create(cmd->filter, (full_scan == 2) ? 1 : 0))) {
 		log_error("dev_iter creation failed");
 		goto out;
--- LVM2/lib/commands/toolcontext.c	2009/10/16 17:41:50	1.86
+++ LVM2/lib/commands/toolcontext.c	2009/11/24 16:10:26	1.87
@@ -1223,6 +1223,16 @@
 	}
 }
 
+int refresh_filters(struct cmd_context *cmd)
+{
+	if (cmd->filter) {
+		cmd->filter->destroy(cmd->filter);
+		cmd->filter = NULL;
+	}
+
+	return _init_filters(cmd, 0);
+}
+
 int refresh_toolcontext(struct cmd_context *cmd)
 {
 	log_verbose("Reloading config files");
--- LVM2/lib/commands/toolcontext.h	2009/10/16 17:41:50	1.35
+++ LVM2/lib/commands/toolcontext.h	2009/11/24 16:10:26	1.36
@@ -105,6 +105,7 @@
 				       const char *system_dir);
 void destroy_toolcontext(struct cmd_context *cmd);
 int refresh_toolcontext(struct cmd_context *cmd);
+int refresh_filters(struct cmd_context *cmd);
 int config_files_changed(struct cmd_context *cmd);
 int init_lvmcache_orphans(struct cmd_context *cmd);
 


             reply	other threads:[~2009-11-24 16:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-24 16:10 mbroz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-10-11  9:09 zkabelac
2010-05-13 13:04 mbroz
2010-04-01 10:34 agk
2009-11-24 16:11 mbroz
2008-04-02 21:23 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=20091124161027.22448.qmail@sourceware.org \
    --to=mbroz@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).