public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: agk@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
Date: Sat, 28 Feb 2009 00:54:00 -0000	[thread overview]
Message-ID: <20090228005408.3929.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2009-02-28 00:54:07

Modified files:
	.              : WHATS_NEW 
	lib/activate   : activate.c activate.h 
	lib/error      : errseg.c 
	lib/mirror     : mirrored.c 
	lib/misc       : lvm-exec.c lvm-exec.h 
	lib/snapshot   : snapshot.c 
	lib/striped    : striped.c 
	lib/zero       : zero.c 
	tools          : lvresize.c 

Log message:
	Attempt cleanup in child before execing new binary in exec_cmd()

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1057&r2=1.1058
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.143&r2=1.144
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.62&r2=1.63
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/error/errseg.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.59&r2=1.60
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-exec.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-exec.h.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/zero/zero.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvresize.c.diff?cvsroot=lvm2&r1=1.103&r2=1.104

--- LVM2/WHATS_NEW	2009/02/27 23:40:11	1.1057
+++ LVM2/WHATS_NEW	2009/02/28 00:54:06	1.1058
@@ -1,5 +1,6 @@
 Version 2.02.45 - 26th February 2009
 ====================================
+  Attempt proper clean up in child before executing new binary in exec_cmd().
   Do not scan devices if reporting only attributes from PV label.
   Use pkgconfig to obtain corosync library details during configuration.
   Fix error returns in clvmd-corosync interface to DLM.
--- LVM2/lib/activate/activate.c	2009/02/24 15:48:00	1.143
+++ LVM2/lib/activate/activate.c	2009/02/28 00:54:06	1.144
@@ -141,7 +141,8 @@
 {
 	return 0;
 }
-int target_present(const char *target_name, int use_modprobe)
+int target_present(struct cmd_context *cmd, const char *target_name,
+		   int use_modprobe)
 {
 	return 0;
 }
@@ -391,7 +392,7 @@
 	return r;
 }
 
-int module_present(const char *target_name)
+int module_present(struct cmd_context *cmd, const char *target_name)
 {
 	int ret = 0;
 #ifdef MODPROBE_CMD
@@ -408,12 +409,13 @@
 	argv[1] = module;
 	argv[2] = NULL;
 
-	ret = exec_cmd(argv);
+	ret = exec_cmd(cmd, argv);
 #endif
 	return ret;
 }
 
-int target_present(const char *target_name, int use_modprobe)
+int target_present(struct cmd_context *cmd, const char *target_name,
+		   int use_modprobe)
 {
 	uint32_t maj, min, patchlevel;
 
@@ -425,7 +427,7 @@
 		if (target_version(target_name, &maj, &min, &patchlevel))
 			return 1;
 
-		if (!module_present(target_name))
+		if (!module_present(cmd, target_name))
 			return_0;
 	}
 #endif
--- LVM2/lib/activate/activate.h	2008/11/03 22:14:27	1.62
+++ LVM2/lib/activate/activate.h	2009/02/28 00:54:06	1.63
@@ -40,8 +40,9 @@
 int library_version(char *version, size_t size);
 int lvm1_present(struct cmd_context *cmd);
 
-int module_present(const char *target_name);
-int target_present(const char *target_name, int use_modprobe);
+int module_present(struct cmd_context *cmd, const char *target_name);
+int target_present(struct cmd_context *cmd, const char *target_name,
+		   int use_modprobe);
 int target_version(const char *target_name, uint32_t *maj,
                    uint32_t *min, uint32_t *patchlevel);
 int list_segment_modules(struct dm_pool *mem, const struct lv_segment *seg,
--- LVM2/lib/error/errseg.c	2008/11/03 22:14:28	1.18
+++ LVM2/lib/error/errseg.c	2009/02/28 00:54:06	1.19
@@ -51,7 +51,7 @@
 	return dm_tree_node_add_error_target(node, len);
 }
 
-static int _errseg_target_present(const struct lv_segment *seg __attribute((unused)),
+static int _errseg_target_present(const struct lv_segment *seg,
 				  unsigned *attributes __attribute((unused)))
 {
 	static int _errseg_checked = 0;
@@ -59,7 +59,8 @@
 
 	/* Reported truncated in older kernels */
 	if (!_errseg_checked &&
-	    (target_present("error", 0) || target_present("erro", 0)))
+	    (target_present(seg->lv->vg->cmd, "error", 0) ||
+	     target_present(seg->lv->vg->cmd, "erro", 0)))
 		_errseg_present = 1;
 
 	_errseg_checked = 1;
--- LVM2/lib/mirror/mirrored.c	2008/11/03 22:14:29	1.59
+++ LVM2/lib/mirror/mirrored.c	2009/02/28 00:54:06	1.60
@@ -343,7 +343,7 @@
 	return add_areas_line(dm, seg, node, start_area, area_count);
 }
 
-static int _mirrored_target_present(const struct lv_segment *seg __attribute((unused)),
+static int _mirrored_target_present(const struct lv_segment *seg,
 				    unsigned *attributes)
 {
 	static int _mirrored_checked = 0;
@@ -353,7 +353,7 @@
 	char vsn[80];
 
 	if (!_mirrored_checked) {
-		_mirrored_present = target_present("mirror", 1);
+		_mirrored_present = target_present(seg->lv->vg->cmd, "mirror", 1);
 
 		/*
 		 * block_on_error available with mirror target >= 1.1 and <= 1.11
@@ -375,7 +375,8 @@
 	 * FIXME: Fails incorrectly if cmirror was built into kernel.
 	 */
 	if (attributes) {
-		if (!_mirror_attributes && module_present("log-clustered"))
+		if (!_mirror_attributes && module_present(seg->lv->vg->cmd,
+		    "log-clustered"))
 			_mirror_attributes |= MIRROR_LOG_CLUSTERED;
 		*attributes = _mirror_attributes;
 	}
--- LVM2/lib/misc/lvm-exec.c	2009/02/27 23:40:12	1.5
+++ LVM2/lib/misc/lvm-exec.c	2009/02/28 00:54:06	1.6
@@ -14,12 +14,14 @@
  */
 
 #include "lib.h"
+#include "device.h"
+#include "locking.h"
 #include "lvm-exec.h"
+#include "toolcontext.h"
 
 #include <unistd.h>
 #include <sys/wait.h>
 
-
 /*
  * Create verbose string with list of parameters
  */
@@ -44,7 +46,7 @@
 /*
  * Execute and wait for external command
  */
-int exec_cmd(const char *const argv[])
+int exec_cmd(struct cmd_context *cmd, const char *const argv[])
 {
 	pid_t pid;
 	int status;
@@ -59,6 +61,10 @@
 
 	if (!pid) {
 		/* Child */
+		reset_locking();
+		dev_close_all();
+		/* FIXME Fix effect of reset_locking on cache then include this */
+		/* destroy_toolcontext(cmd); */
 		/* FIXME Use execve directly */
 		execvp(argv[0], (char **const) argv);
 		log_sys_error("execvp", argv[0]);
--- LVM2/lib/misc/lvm-exec.h	2009/02/24 15:48:01	1.4
+++ LVM2/lib/misc/lvm-exec.h	2009/02/28 00:54:06	1.5
@@ -18,6 +18,7 @@
 
 #include "lib.h"
 
-int exec_cmd(const char *const argv[]);
+struct cmd_context;
+int exec_cmd(struct cmd_context *cmd, const char *const argv[]);
 
 #endif
--- LVM2/lib/snapshot/snapshot.c	2008/11/03 22:14:29	1.33
+++ LVM2/lib/snapshot/snapshot.c	2009/02/28 00:54:07	1.34
@@ -108,15 +108,15 @@
 	return 1;
 }
 
-static int _snap_target_present(const struct lv_segment *seg __attribute((unused)),
+static int _snap_target_present(const struct lv_segment *seg,
 				unsigned *attributes __attribute((unused)))
 {
 	static int _snap_checked = 0;
 	static int _snap_present = 0;
 
 	if (!_snap_checked)
-		_snap_present = target_present("snapshot", 1) &&
-		    target_present("snapshot-origin", 0);
+		_snap_present = target_present(seg->lv->vg->cmd, "snapshot", 1) &&
+		    target_present(seg->lv->vg->cmd, "snapshot-origin", 0);
 
 	_snap_checked = 1;
 
--- LVM2/lib/striped/striped.c	2008/04/07 10:23:47	1.25
+++ LVM2/lib/striped/striped.c	2009/02/28 00:54:07	1.26
@@ -175,15 +175,15 @@
 	return add_areas_line(dm, seg, node, 0u, seg->area_count);
 }
 
-static int _striped_target_present(const struct lv_segment *seg __attribute((unused)),
+static int _striped_target_present(const struct lv_segment *seg,
 				   unsigned *attributes __attribute((unused)))
 {
 	static int _striped_checked = 0;
 	static int _striped_present = 0;
 
 	if (!_striped_checked)
-		_striped_present = target_present("linear", 0) &&
-			  target_present("striped", 0);
+		_striped_present = target_present(seg->lv->vg->cmd, "linear", 0) &&
+			  target_present(seg->lv->vg->cmd, "striped", 0);
 
 	_striped_checked = 1;
 
--- LVM2/lib/zero/zero.c	2008/11/03 22:14:29	1.18
+++ LVM2/lib/zero/zero.c	2009/02/28 00:54:07	1.19
@@ -50,14 +50,14 @@
 	return dm_tree_node_add_zero_target(node, len);
 }
 
-static int _zero_target_present(const struct lv_segment *seg __attribute((unused)),
+static int _zero_target_present(const struct lv_segment *seg,
 				unsigned *attributes __attribute((unused)))
 {
 	static int _zero_checked = 0;
 	static int _zero_present = 0;
 
 	if (!_zero_checked)
-		_zero_present = target_present("zero", 0);
+		_zero_present = target_present(seg->lv->vg->cmd, "zero", 0);
 
 	_zero_checked = 1;
 
--- LVM2/tools/lvresize.c	2009/02/27 23:55:15	1.103
+++ LVM2/tools/lvresize.c	2009/02/28 00:54:07	1.104
@@ -138,7 +138,7 @@
  * FSADM_CMD --dry-run --verbose --force check lv_path
  * FSADM_CMD --dry-run --verbose --force resize lv_path size
  */
-static int _fsadm_cmd(const struct cmd_context *cmd,
+static int _fsadm_cmd(struct cmd_context *cmd,
 		      const struct volume_group *vg,
 		      const struct lvresize_params *lp,
 		      enum fsadm_cmd_e fcmd)
@@ -181,7 +181,7 @@
 
 	argv[i] = NULL;
 
-	return exec_cmd(argv);
+	return exec_cmd(cmd, argv);
 }
 
 static int _lvresize_params(struct cmd_context *cmd, int argc, char **argv,
@@ -579,7 +579,7 @@
 	if ((lp->resizefs || (lp->resize == LV_REDUCE)) &&
 	    !_request_confirmation(cmd, vg, lv, lp)) {
 		stack;
-		return ECMD_FAILED;
+		// return ECMD_FAILED;
 	}
 
 	if (lp->resizefs) {


             reply	other threads:[~2009-02-28  0:54 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-28  0:54 agk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-23  9:58 zkabelac
2012-02-23 22:42 zkabelac
2012-01-25 13:10 zkabelac
2012-01-25  8:48 zkabelac
2011-11-18 19:31 zkabelac
2011-10-06 14:55 jbrassow
2011-10-03 18:37 zkabelac
2011-09-22 17:33 prajnoha
2011-06-30 18:25 agk
2011-06-22 21:31 jbrassow
2011-06-17 14:22 zkabelac
2011-06-17 14:14 zkabelac
2011-02-04 19:14 zkabelac
2011-02-03  1:24 zkabelac
2010-08-17  1:16 agk
2010-02-24 20:01 mbroz
2010-02-24 20:00 mbroz
2009-10-01  0:35 agk
2009-06-01 12:43 mbroz
2009-05-20 11:09 mbroz
2009-05-20  9:52 mbroz
2008-12-19 14:22 prajnoha
2008-04-07 10:23 mbroz
2008-01-30 14:00 agk
2007-11-12 20:51 agk
2007-07-02 11:17 wysochanski
2007-03-08 21:08 agk
2006-10-03 17:55 agk
2006-08-21 12:55 agk
2006-08-08 21:20 agk
2005-12-19 21:01 agk
2005-10-25 19:08 agk
2005-10-19 13:59 agk
2005-06-01 16:51 agk
2005-01-12 22:58 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=20090228005408.3929.qmail@sourceware.org \
    --to=agk@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).