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 ./WHATS_NEW_DM lib/activate/d ...
Date: Fri, 18 Mar 2011 12:18:00 -0000	[thread overview]
Message-ID: <20110318121759.15685.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2011-03-18 12:17:58

Modified files:
	.              : WHATS_NEW WHATS_NEW_DM 
	lib/activate   : dev_manager.c 
	libdm/ioctl    : libdm-iface.c 

Log message:
	Mitigate some warnings if running as non-root user.
	
	LVM doesn't behave correctly if running as non-root user,
	there is warning when it detects it.
	
	Despite this, it produces many error messages, saying nothing.
	See https://bugzilla.redhat.com/show_bug.cgi?id=620571
	
	This patch fixes two things:
	1) Removes eror message from device_is_usable() which has no
	information value anyway (real warning is printed inside it).
	
	2) it fixes device-mapper initialization, if we support
	core dm module autoload and device node is present, it should
	fail early and not try recreate existing and correct node.
	(non-root == permission denied here)
	
	N.B. In future code should support user roles, some more
	drastic checks in code are probably contraproductive now.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1956&r2=1.1957
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.455&r2=1.456
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.214&r2=1.215
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-iface.c.diff?cvsroot=lvm2&r1=1.99&r2=1.100

--- LVM2/WHATS_NEW	2011/03/14 17:00:58	1.1956
+++ LVM2/WHATS_NEW	2011/03/18 12:17:57	1.1957
@@ -1,5 +1,6 @@
 Version 2.02.85 - 
 ===================================
+  Mitigate annoying error warning from device is usable check if run as non-root.
   Add missing \0 for grown debug object in _bitset_with_random_bits().
   Fix allocation of system_id buffer in volume_group structure.
   Fix readlink usage inside get_primary_dev().
--- LVM2/WHATS_NEW_DM	2011/03/10 12:48:40	1.455
+++ LVM2/WHATS_NEW_DM	2011/03/18 12:17:57	1.456
@@ -1,5 +1,6 @@
 Version 1.02.64 - 
 ===================================
+  Fallback to control node creation only if node doesn't exist yet.
   Change dm_hash API for binary data to accept const void *key.
   Fix memory access of empty params string in _reload_with_suppression_v4().
   Lower severity of selabel_lookup and matchpathcon failure to log_debug.
--- LVM2/lib/activate/dev_manager.c	2011/02/28 19:53:03	1.214
+++ LVM2/lib/activate/dev_manager.c	2011/03/18 12:17:58	1.215
@@ -141,10 +141,8 @@
 	int only_error_target = 1;
 	int r = 0;
 
-	if (!(dmt = dm_task_create(DM_DEVICE_STATUS))) {
-		log_error("Failed to create dm_task struct to check dev status");
-		return 0;
-	}
+	if (!(dmt = dm_task_create(DM_DEVICE_STATUS)))
+		return_0;
 
 	if (!dm_task_set_major_minor(dmt, MAJOR(dev->dev), MINOR(dev->dev), 1))
 		goto_out;
--- LVM2/libdm/ioctl/libdm-iface.c	2011/03/08 22:43:20	1.99
+++ LVM2/libdm/ioctl/libdm-iface.c	2011/03/18 12:17:58	1.100
@@ -365,8 +365,9 @@
 	_close_control_fd();
 
 	if ((_control_fd = open(control, O_RDWR)) < 0) {
-		if (!(ignore_nodev && errno == ENODEV))
-			log_sys_error("open", control);
+		if (ignore_nodev && errno == ENODEV)
+			return 1;
+		log_sys_error("open", control);
 		return 0;
 	}
 
@@ -412,7 +413,9 @@
 		    !_create_control(control, major, MAPPER_CTRL_MINOR))
 			goto error;
 
-		_open_and_assign_control_fd(control, 1);
+		/* Fallback to old code only if control node doesn't exist */
+		if (!_open_and_assign_control_fd(control, 1))
+			goto error;
 	}
 
 	/*


             reply	other threads:[~2011-03-18 12:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18 12:18 mbroz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-07-31 18:30 agk
2009-06-17 20:55 mbroz
2009-02-12 20:42 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=20110318121759.15685.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).