public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/tools lvchange.c
@ 2011-12-01  0:04 jbrassow
  0 siblings, 0 replies; 8+ messages in thread
From: jbrassow @ 2011-12-01  0:04 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2011-12-01 00:04:21

Modified files:
	tools          : lvchange.c 

Log message:
	Do not allow users to change permissions on RAID sub-LVs.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.136&r2=1.137

--- LVM2/tools/lvchange.c	2011/11/18 19:22:49	1.136
+++ LVM2/tools/lvchange.c	2011/12/01 00:04:21	1.137
@@ -43,6 +43,14 @@
 		return 0;
 	}
 
+	/* Not allowed to change permissions on RAID sub-LVs directly */
+	if ((lv->status & RAID_META) || (lv->status & RAID_IMAGE)) {
+		log_error("Cannot change permissions of RAID %s \"%s\"",
+			  (lv->status & RAID_IMAGE) ? "image" :
+			  "metadata area", lv->name);
+		return 0;
+	}
+
 	if (lv_access & LVM_WRITE) {
 		lv->status |= LVM_WRITE;
 		log_verbose("Setting logical volume \"%s\" read/write",


^ permalink raw reply	[flat|nested] 8+ messages in thread
* LVM2/tools lvchange.c
@ 2010-06-28 19:10 mornfall
  0 siblings, 0 replies; 8+ messages in thread
From: mornfall @ 2010-06-28 19:10 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2010-06-28 19:10:16

Modified files:
	tools          : lvchange.c 

Log message:
	Refactor the handles_missing_pv logic in lvchange.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.120&r2=1.121

--- LVM2/tools/lvchange.c	2010/05/06 11:15:56	1.120
+++ LVM2/tools/lvchange.c	2010/06/28 19:10:16	1.121
@@ -714,32 +714,31 @@
 
 int lvchange(struct cmd_context *cmd, int argc, char **argv)
 {
-	if (!arg_count(cmd, available_ARG) && !arg_count(cmd, contiguous_ARG)
-	    && !arg_count(cmd, permission_ARG) && !arg_count(cmd, readahead_ARG)
-	    && !arg_count(cmd, minor_ARG) && !arg_count(cmd, major_ARG)
-	    && !arg_count(cmd, persistent_ARG) && !arg_count(cmd, addtag_ARG)
-	    && !arg_count(cmd, deltag_ARG) && !arg_count(cmd, refresh_ARG)
-	    && !arg_count(cmd, alloc_ARG) && !arg_count(cmd, monitor_ARG)
-	    && !arg_count(cmd, poll_ARG) && !arg_count(cmd, resync_ARG)) {
+	int update = /* options other than -a, --refresh or --monitor */
+		arg_count(cmd, contiguous_ARG) || arg_count(cmd, permission_ARG) ||
+		arg_count(cmd, readahead_ARG) || arg_count(cmd, persistent_ARG) ||
+		arg_count(cmd, addtag_ARG) || arg_count(cmd, deltag_ARG) ||
+		arg_count(cmd, resync_ARG) || arg_count(cmd, alloc_ARG);
+
+	if (!update &&
+            !arg_count(cmd, available_ARG) && !arg_count(cmd, refresh_ARG) &&
+            !arg_count(cmd, monitor_ARG) && !arg_count(cmd, poll_ARG) &&
+            /* for persistent_ARG */
+	    !arg_count(cmd, minor_ARG) && !arg_count(cmd, major_ARG)) {
 		log_error("Need 1 or more of -a, -C, -j, -m, -M, -p, -r, "
 			  "--resync, --refresh, --alloc, --addtag, --deltag, "
 			  "--monitor or --poll");
 		return EINVALID_CMD_LINE;
 	}
 
-	int avail_only = /* i.e. only one of -a or --refresh is given */
-	    !(arg_count(cmd, contiguous_ARG) || arg_count(cmd, permission_ARG) ||
-	     arg_count(cmd, readahead_ARG) || arg_count(cmd, persistent_ARG) ||
-	     arg_count(cmd, addtag_ARG) || arg_count(cmd, deltag_ARG) ||
-	     arg_count(cmd, resync_ARG) || arg_count(cmd, alloc_ARG));
 
 	if ((arg_count(cmd, ignorelockingfailure_ARG) ||
-	     arg_count(cmd, sysinit_ARG)) && !avail_only) {
+	     arg_count(cmd, sysinit_ARG)) && update) {
 		log_error("Only -a permitted with --ignorelockingfailure and --sysinit");
 		return EINVALID_CMD_LINE;
 	}
 
-	if (avail_only)
+	if (!update)
 		cmd->handles_missing_pvs = 1;
 
 	if (!argc) {
@@ -769,6 +768,6 @@
 	}
 
 	return process_each_lv(cmd, argc, argv,
-			       avail_only ? 0 : READ_FOR_UPDATE, NULL,
+			       update ? READ_FOR_UPDATE : 0, NULL,
 			       &lvchange_single);
 }


^ permalink raw reply	[flat|nested] 8+ messages in thread
* LVM2/tools lvchange.c
@ 2009-11-04 12:39 zkabelac
  0 siblings, 0 replies; 8+ messages in thread
From: zkabelac @ 2009-11-04 12:39 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2009-11-04 12:39:56

Modified files:
	tools          : lvchange.c 

Log message:
	minor code comment update

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.111&r2=1.112

--- LVM2/tools/lvchange.c	2009/09/29 20:22:35	1.111
+++ LVM2/tools/lvchange.c	2009/11/04 12:39:56	1.112
@@ -610,7 +610,7 @@
 		docmds++;
 	}
 
-	/* read ahead sector change */
+	/* persistent device number change */
 	if (arg_count(cmd, persistent_ARG)) {
 		if (!archived && !archive(lv->vg)) {
 			stack;


^ permalink raw reply	[flat|nested] 8+ messages in thread
* LVM2/tools lvchange.c
@ 2009-07-15  5:48 mornfall
  0 siblings, 0 replies; 8+ messages in thread
From: mornfall @ 2009-07-15  5:48 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2009-07-15 05:48:36

Modified files:
	tools          : lvchange.c 

Log message:
	Take just a read lock when activating in lvchange.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.106&r2=1.107

--- LVM2/tools/lvchange.c	2009/07/15 05:47:55	1.106
+++ LVM2/tools/lvchange.c	2009/07/15 05:48:36	1.107
@@ -732,6 +732,7 @@
 		return EINVALID_CMD_LINE;
 	}
 
-	return process_each_lv(cmd, argc, argv, READ_FOR_UPDATE, NULL,
+	return process_each_lv(cmd, argc, argv,
+			       avail_only ? 0 : READ_FOR_UPDATE, NULL,
 			       &lvchange_single);
 }


^ permalink raw reply	[flat|nested] 8+ messages in thread
* LVM2/tools lvchange.c
@ 2006-10-24 15:30 agk
  0 siblings, 0 replies; 8+ messages in thread
From: agk @ 2006-10-24 15:30 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-10-24 15:30:33

Modified files:
	tools          : lvchange.c 

Log message:
	fix forcesync local active detection

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.70&r2=1.71

--- LVM2/tools/lvchange.c	2006/10/23 23:03:55	1.70
+++ LVM2/tools/lvchange.c	2006/10/24 15:30:33	1.71
@@ -205,17 +205,18 @@
 			return ECMD_FAILED;
 		}
 
-		if (info.exists && !arg_count(cmd, yes_ARG)) {
-			if (yes_no_prompt("Do you really want to deactivate "
+		if (info.exists) {
+			if (!arg_count(cmd, yes_ARG) &&
+			    yes_no_prompt("Do you really want to deactivate "
 					  "logical volume %s to resync it? [y/n]: ",
 					  lv->name) == 'n') {
 				log_print("Logical volume \"%s\" not resynced",
 					  lv->name);
 				return ECMD_FAILED;
 			}
-		}
 
-		active = 1;
+			active = 1;
+		}
 	}
 
 	if ((lv->vg->status & CLUSTERED) && !activate_lv_excl(cmd, lv)) {


^ permalink raw reply	[flat|nested] 8+ messages in thread
* LVM2/tools lvchange.c
@ 2004-05-05 18:27 agk
  0 siblings, 0 replies; 8+ messages in thread
From: agk @ 2004-05-05 18:27 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-05-05 18:27:56

Modified files:
	tools          : lvchange.c 

Log message:
	stray space

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.55&r2=1.56


^ permalink raw reply	[flat|nested] 8+ messages in thread
* LVM2/tools lvchange.c
@ 2004-03-26 21:49 agk
  0 siblings, 0 replies; 8+ messages in thread
From: agk @ 2004-03-26 21:49 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-03-26 21:49:57

Modified files:
	tools          : lvchange.c 

Log message:
	and another typo

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.51&r2=1.52


^ permalink raw reply	[flat|nested] 8+ messages in thread
* LVM2/tools lvchange.c
@ 2004-03-26 21:47 agk
  0 siblings, 0 replies; 8+ messages in thread
From: agk @ 2004-03-26 21:47 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-03-26 21:47:43

Modified files:
	tools          : lvchange.c 

Log message:
	typo

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.50&r2=1.51


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-12-01  0:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-01  0:04 LVM2/tools lvchange.c jbrassow
  -- strict thread matches above, loose matches on Subject: below --
2010-06-28 19:10 mornfall
2009-11-04 12:39 zkabelac
2009-07-15  5:48 mornfall
2006-10-24 15:30 agk
2004-05-05 18:27 agk
2004-03-26 21:49 agk
2004-03-26 21:47 agk

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