All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] kexec: implement -y (--no-sync) option
@ 2015-03-26 19:16 Tejun Heo
  2015-03-26 19:16 ` [PATCH 2/2] kexec: remove ordering constraints from -x (--no-ifdown) and -y (--no-sync) Tejun Heo
  0 siblings, 1 reply; 8+ messages in thread
From: Tejun Heo @ 2015-03-26 19:16 UTC (permalink / raw)
  To: Simon Horman; +Cc: Chris Mason, kexec

From a32a35e46a950cd0e4b4e317a9062c41e79fbfeb Mon Sep 17 00:00:00 2001
From: Tejun Heo <tj@kernel.org>
Date: Thu, 26 Mar 2015 14:56:26 -0400

During kernel develoment, kexec can be used to get out of sticky
situations without going through possibly lenghty reboot; however,
there are situations where the filesystem and/or storage stack are
known to be misbehaving and performing sync before kexecing is
dangerous or just never finishes.

This patch implement -y (--no-sync) option which makes kexec skip
syncing in the similar way as -x (--no-ifdown).

Signed-off-by: Tejun Heo <tj@kernel.org>
Suggested-by: Chris Mason <clm@fb.com>
---
 kexec/kexec.8 | 8 ++++++--
 kexec/kexec.c | 8 +++++++-
 kexec/kexec.h | 4 +++-
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/kexec/kexec.8 b/kexec/kexec.8
index 2575f9e..24d1969 100644
--- a/kexec/kexec.8
+++ b/kexec/kexec.8
@@ -6,7 +6,7 @@
 kexec \- directly boot into a new kernel
 .SH SYNOPSIS
 .B /sbin/kexec
-.B [-v (\-\-version)] [-f (\-\-force)] [-x (\-\-no-ifdown)] [-l (\-\-load)] [-p (\-\-load-panic)] [-u (\-\-unload)] [-e (\-\-exec)] [-t (\-\-type)]
+.B [-v (\-\-version)] [-f (\-\-force)] [-x (\-\-no-ifdown)] [-y (\-\-no-sync)] [-l (\-\-load)] [-p (\-\-load-panic)] [-u (\-\-unload)] [-e (\-\-exec)] [-t (\-\-type)]
 .BI [\-\-mem\-min= addr ]
 .BI [\-\-mem\-max= addr ]
 
@@ -148,7 +148,11 @@ Return the version number of the installed utility.
 .TP
 .B \-x\ (\-\-no\-ifdown)
 Shut down the running kernel, but restore the interface on reload. (If
-this option is used, it must be specified last.)
+this option is used, it must be one of last options specified.)
+.TP
+.B \-y\ (\-\-no\-sync)
+Shut down the running kernel, but skip syncing the filesystems. (If
+this option is used, it must be one of last options specified.)
 .TP
 .BI \-\-mem\-min= addr
 Specify the lowest memory address
diff --git a/kexec/kexec.c b/kexec/kexec.c
index b088916..7123460 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -913,7 +913,10 @@ void usage(void)
 	       " -f, --force          Force an immediate kexec,\n"
 	       "                      don't call shutdown.\n"
 	       " -x, --no-ifdown      Don't bring down network interfaces.\n"
-	       "                      (if used, must be last option\n"
+	       "                      (if used, must be one of last options\n"
+	       "                       specified)\n"
+	       " -y, --no-sync        Don't sync filesystems before kexec.\n"
+	       "                      (if used, must be one of last options\n"
 	       "                       specified)\n"
 	       " -l, --load           Load the new kernel into the\n"
 	       "                      current kernel.\n"
@@ -1218,6 +1221,9 @@ int main(int argc, char *argv[])
 		case OPT_NOIFDOWN:
 			do_ifdown = 0;
 			break;
+		case OPT_NOSYNC:
+			do_sync = 0;
+			break;
 		case OPT_FORCE:
 			do_load = 1;
 			do_shutdown = 0;
diff --git a/kexec/kexec.h b/kexec/kexec.h
index 4be2b2f..b129c15 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -209,6 +209,7 @@ extern int file_types;
 #define OPT_DEBUG		'd'
 #define OPT_FORCE		'f'
 #define OPT_NOIFDOWN		'x'
+#define OPT_NOSYNC		'y'
 #define OPT_EXEC		'e'
 #define OPT_LOAD		'l'
 #define OPT_UNLOAD		'u'
@@ -227,6 +228,7 @@ extern int file_types;
 	{ "version",		0, 0, OPT_VERSION }, \
 	{ "force",		0, 0, OPT_FORCE }, \
 	{ "no-ifdown",		0, 0, OPT_NOIFDOWN }, \
+	{ "no-sync",		0, 0, OPT_NOSYNC }, \
 	{ "load",		0, 0, OPT_LOAD }, \
 	{ "unload",		0, 0, OPT_UNLOAD }, \
 	{ "exec",		0, 0, OPT_EXEC }, \
@@ -241,7 +243,7 @@ extern int file_types;
 	{ "kexec-file-syscall",	0, 0, OPT_KEXEC_FILE_SYSCALL }, \
 	{ "debug",		0, 0, OPT_DEBUG }, \
 
-#define KEXEC_OPT_STR "h?vdfxluet:ps"
+#define KEXEC_OPT_STR "h?vdfxyluet:ps"
 
 extern void dbgprint_mem_range(const char *prefix, struct memory_range *mr, int nr_mr);
 extern void die(const char *fmt, ...)
-- 
2.1.0


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* [PATCH 2/2] kexec: remove ordering constraints from -x (--no-ifdown) and -y (--no-sync)
  2015-03-26 19:16 [PATCH 1/2] kexec: implement -y (--no-sync) option Tejun Heo
@ 2015-03-26 19:16 ` Tejun Heo
  2015-04-13 17:01   ` Tejun Heo
  0 siblings, 1 reply; 8+ messages in thread
From: Tejun Heo @ 2015-03-26 19:16 UTC (permalink / raw)
  To: Simon Horman; +Cc: Chris Mason, kexec

From 81b5889b49f0f2448c3e9543c5c936d52348910c Mon Sep 17 00:00:00 2001
From: Tejun Heo <tj@kernel.org>
Date: Thu, 26 Mar 2015 15:11:09 -0400

Currently, the two options must be the last ones to be honored;
otherwise, they can get silently ignored and both the manpage and help
text point it out.  This is error-prone and trivial to fix.  There
isn't much point in pointing something out in documentation when the
peculiarity can be removed with four lines of extra code.

Update option handling so that the two arguments are honored
regardless of their positions.

Signed-off-by: Tejun Heo <tj@kernel.org>
---
 kexec/kexec.8 |  6 ++----
 kexec/kexec.c | 17 +++++++++--------
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/kexec/kexec.8 b/kexec/kexec.8
index 24d1969..4d0c1d1 100644
--- a/kexec/kexec.8
+++ b/kexec/kexec.8
@@ -147,12 +147,10 @@ target kernel. If a capture kernel is being unloaded then specify -p with -u.
 Return the version number of the installed utility.
 .TP
 .B \-x\ (\-\-no\-ifdown)
-Shut down the running kernel, but restore the interface on reload. (If
-this option is used, it must be one of last options specified.)
+Shut down the running kernel, but restore the interface on reload.
 .TP
 .B \-y\ (\-\-no\-sync)
-Shut down the running kernel, but skip syncing the filesystems. (If
-this option is used, it must be one of last options specified.)
+Shut down the running kernel, but skip syncing the filesystems.
 .TP
 .BI \-\-mem\-min= addr
 Specify the lowest memory address
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 7123460..8ce6885 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -913,11 +913,7 @@ void usage(void)
 	       " -f, --force          Force an immediate kexec,\n"
 	       "                      don't call shutdown.\n"
 	       " -x, --no-ifdown      Don't bring down network interfaces.\n"
-	       "                      (if used, must be one of last options\n"
-	       "                       specified)\n"
 	       " -y, --no-sync        Don't sync filesystems before kexec.\n"
-	       "                      (if used, must be one of last options\n"
-	       "                       specified)\n"
 	       " -l, --load           Load the new kernel into the\n"
 	       "                      current kernel.\n"
 	       " -p, --load-panic     Load the new kernel for use on panic.\n"
@@ -1170,8 +1166,8 @@ int main(int argc, char *argv[])
 	int do_exec = 0;
 	int do_load_jump_back_helper = 0;
 	int do_shutdown = 1;
-	int do_sync = 1;
-	int do_ifdown = 0;
+	int do_sync = 1, skip_sync = 0;
+	int do_ifdown = 0, skip_ifdown = 0;
 	int do_unload = 0;
 	int do_reuse_initrd = 0;
 	int do_kexec_file_syscall = 0;
@@ -1219,10 +1215,10 @@ int main(int argc, char *argv[])
 		case OPT_DEBUG:
 			kexec_debug = 1;
 		case OPT_NOIFDOWN:
-			do_ifdown = 0;
+			skip_ifdown = 1;
 			break;
 		case OPT_NOSYNC:
-			do_sync = 0;
+			skip_sync = 1;
 			break;
 		case OPT_FORCE:
 			do_load = 1;
@@ -1321,6 +1317,11 @@ int main(int argc, char *argv[])
 		}
 	}
 
+	if (skip_ifdown)
+		do_ifdown = 0;
+	if (skip_sync)
+		do_sync = 0;
+
 	if (do_load && (kexec_flags & KEXEC_ON_CRASH) &&
 	    !is_crashkernel_mem_reserved()) {
 		die("Memory for crashkernel is not reserved\n"
-- 
2.1.0


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH 2/2] kexec: remove ordering constraints from -x (--no-ifdown) and -y (--no-sync)
  2015-03-26 19:16 ` [PATCH 2/2] kexec: remove ordering constraints from -x (--no-ifdown) and -y (--no-sync) Tejun Heo
@ 2015-04-13 17:01   ` Tejun Heo
  2015-04-14  0:29     ` Simon Horman
  0 siblings, 1 reply; 8+ messages in thread
From: Tejun Heo @ 2015-04-13 17:01 UTC (permalink / raw)
  To: Simon Horman; +Cc: Chris Mason, kexec

On Thu, Mar 26, 2015 at 03:16:44PM -0400, Tejun Heo wrote:
> From 81b5889b49f0f2448c3e9543c5c936d52348910c Mon Sep 17 00:00:00 2001
> From: Tejun Heo <tj@kernel.org>
> Date: Thu, 26 Mar 2015 15:11:09 -0400
> 
> Currently, the two options must be the last ones to be honored;
> otherwise, they can get silently ignored and both the manpage and help
> text point it out.  This is error-prone and trivial to fix.  There
> isn't much point in pointing something out in documentation when the
> peculiarity can be removed with four lines of extra code.
> 
> Update option handling so that the two arguments are honored
> regardless of their positions.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>

Ping?

Thanks.

-- 
tejun

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH 2/2] kexec: remove ordering constraints from -x (--no-ifdown) and -y (--no-sync)
  2015-04-13 17:01   ` Tejun Heo
@ 2015-04-14  0:29     ` Simon Horman
  2015-04-14 12:15       ` [PATCH REPOST 1/2] kexec: implement -y (--no-sync) option Tejun Heo
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Horman @ 2015-04-14  0:29 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Chris Mason, kexec

On Mon, Apr 13, 2015 at 01:01:56PM -0400, Tejun Heo wrote:
> On Thu, Mar 26, 2015 at 03:16:44PM -0400, Tejun Heo wrote:
> > From 81b5889b49f0f2448c3e9543c5c936d52348910c Mon Sep 17 00:00:00 2001
> > From: Tejun Heo <tj@kernel.org>
> > Date: Thu, 26 Mar 2015 15:11:09 -0400
> > 
> > Currently, the two options must be the last ones to be honored;
> > otherwise, they can get silently ignored and both the manpage and help
> > text point it out.  This is error-prone and trivial to fix.  There
> > isn't much point in pointing something out in documentation when the
> > peculiarity can be removed with four lines of extra code.
> > 
> > Update option handling so that the two arguments are honored
> > regardless of their positions.
> > 
> > Signed-off-by: Tejun Heo <tj@kernel.org>
> 
> Ping?

Hi Tejun,

For some reason I don't seem to have this patch in my inbox.
Could you repost it?

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* [PATCH REPOST 1/2] kexec: implement -y (--no-sync) option
  2015-04-14  0:29     ` Simon Horman
@ 2015-04-14 12:15       ` Tejun Heo
  2015-04-14 12:16         ` [PATCH REPOST 2/2] kexec: remove ordering constraints from -x (--no-ifdown) and -y (--no-sync) Tejun Heo
  2015-04-15  1:09         ` [PATCH REPOST 1/2] kexec: implement -y (--no-sync) option Simon Horman
  0 siblings, 2 replies; 8+ messages in thread
From: Tejun Heo @ 2015-04-14 12:15 UTC (permalink / raw)
  To: Simon Horman; +Cc: Chris Mason, kexec

From a32a35e46a950cd0e4b4e317a9062c41e79fbfeb Mon Sep 17 00:00:00 2001
From: Tejun Heo <tj@kernel.org>
Date: Thu, 26 Mar 2015 14:56:26 -0400

During kernel develoment, kexec can be used to get out of sticky
situations without going through possibly lenghty reboot; however,
there are situations where the filesystem and/or storage stack are
known to be misbehaving and performing sync before kexecing is
dangerous or just never finishes.

This patch implement -y (--no-sync) option which makes kexec skip
syncing in the similar way as -x (--no-ifdown).

Signed-off-by: Tejun Heo <tj@kernel.org>
Suggested-by: Chris Mason <clm@fb.com>
---
Hello, Simon.

Heh, weird.  Let's see if it goes through this time.

Thanks.

 kexec/kexec.8 | 8 ++++++--
 kexec/kexec.c | 8 +++++++-
 kexec/kexec.h | 4 +++-
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/kexec/kexec.8 b/kexec/kexec.8
index 2575f9e..24d1969 100644
--- a/kexec/kexec.8
+++ b/kexec/kexec.8
@@ -6,7 +6,7 @@
 kexec \- directly boot into a new kernel
 .SH SYNOPSIS
 .B /sbin/kexec
-.B [-v (\-\-version)] [-f (\-\-force)] [-x (\-\-no-ifdown)] [-l (\-\-load)] [-p (\-\-load-panic)] [-u (\-\-unload)] [-e (\-\-exec)] [-t (\-\-type)]
+.B [-v (\-\-version)] [-f (\-\-force)] [-x (\-\-no-ifdown)] [-y (\-\-no-sync)] [-l (\-\-load)] [-p (\-\-load-panic)] [-u (\-\-unload)] [-e (\-\-exec)] [-t (\-\-type)]
 .BI [\-\-mem\-min= addr ]
 .BI [\-\-mem\-max= addr ]
 
@@ -148,7 +148,11 @@ Return the version number of the installed utility.
 .TP
 .B \-x\ (\-\-no\-ifdown)
 Shut down the running kernel, but restore the interface on reload. (If
-this option is used, it must be specified last.)
+this option is used, it must be one of last options specified.)
+.TP
+.B \-y\ (\-\-no\-sync)
+Shut down the running kernel, but skip syncing the filesystems. (If
+this option is used, it must be one of last options specified.)
 .TP
 .BI \-\-mem\-min= addr
 Specify the lowest memory address
diff --git a/kexec/kexec.c b/kexec/kexec.c
index b088916..7123460 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -913,7 +913,10 @@ void usage(void)
 	       " -f, --force          Force an immediate kexec,\n"
 	       "                      don't call shutdown.\n"
 	       " -x, --no-ifdown      Don't bring down network interfaces.\n"
-	       "                      (if used, must be last option\n"
+	       "                      (if used, must be one of last options\n"
+	       "                       specified)\n"
+	       " -y, --no-sync        Don't sync filesystems before kexec.\n"
+	       "                      (if used, must be one of last options\n"
 	       "                       specified)\n"
 	       " -l, --load           Load the new kernel into the\n"
 	       "                      current kernel.\n"
@@ -1218,6 +1221,9 @@ int main(int argc, char *argv[])
 		case OPT_NOIFDOWN:
 			do_ifdown = 0;
 			break;
+		case OPT_NOSYNC:
+			do_sync = 0;
+			break;
 		case OPT_FORCE:
 			do_load = 1;
 			do_shutdown = 0;
diff --git a/kexec/kexec.h b/kexec/kexec.h
index 4be2b2f..b129c15 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -209,6 +209,7 @@ extern int file_types;
 #define OPT_DEBUG		'd'
 #define OPT_FORCE		'f'
 #define OPT_NOIFDOWN		'x'
+#define OPT_NOSYNC		'y'
 #define OPT_EXEC		'e'
 #define OPT_LOAD		'l'
 #define OPT_UNLOAD		'u'
@@ -227,6 +228,7 @@ extern int file_types;
 	{ "version",		0, 0, OPT_VERSION }, \
 	{ "force",		0, 0, OPT_FORCE }, \
 	{ "no-ifdown",		0, 0, OPT_NOIFDOWN }, \
+	{ "no-sync",		0, 0, OPT_NOSYNC }, \
 	{ "load",		0, 0, OPT_LOAD }, \
 	{ "unload",		0, 0, OPT_UNLOAD }, \
 	{ "exec",		0, 0, OPT_EXEC }, \
@@ -241,7 +243,7 @@ extern int file_types;
 	{ "kexec-file-syscall",	0, 0, OPT_KEXEC_FILE_SYSCALL }, \
 	{ "debug",		0, 0, OPT_DEBUG }, \
 
-#define KEXEC_OPT_STR "h?vdfxluet:ps"
+#define KEXEC_OPT_STR "h?vdfxyluet:ps"
 
 extern void dbgprint_mem_range(const char *prefix, struct memory_range *mr, int nr_mr);
 extern void die(const char *fmt, ...)
-- 
2.1.0


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* [PATCH REPOST 2/2] kexec: remove ordering constraints from -x (--no-ifdown) and -y (--no-sync)
  2015-04-14 12:15       ` [PATCH REPOST 1/2] kexec: implement -y (--no-sync) option Tejun Heo
@ 2015-04-14 12:16         ` Tejun Heo
  2015-04-15  1:09         ` [PATCH REPOST 1/2] kexec: implement -y (--no-sync) option Simon Horman
  1 sibling, 0 replies; 8+ messages in thread
From: Tejun Heo @ 2015-04-14 12:16 UTC (permalink / raw)
  To: Simon Horman; +Cc: Chris Mason, kexec

From 81b5889b49f0f2448c3e9543c5c936d52348910c Mon Sep 17 00:00:00 2001
From: Tejun Heo <tj@kernel.org>
Date: Thu, 26 Mar 2015 15:11:09 -0400

Currently, the two options must be the last ones to be honored;
otherwise, they can get silently ignored and both the manpage and help
text point it out.  This is error-prone and trivial to fix.  There
isn't much point in pointing something out in documentation when the
peculiarity can be removed with four lines of extra code.

Update option handling so that the two arguments are honored
regardless of their positions.

Signed-off-by: Tejun Heo <tj@kernel.org>
---
 kexec/kexec.8 |  6 ++----
 kexec/kexec.c | 17 +++++++++--------
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/kexec/kexec.8 b/kexec/kexec.8
index 24d1969..4d0c1d1 100644
--- a/kexec/kexec.8
+++ b/kexec/kexec.8
@@ -147,12 +147,10 @@ target kernel. If a capture kernel is being unloaded then specify -p with -u.
 Return the version number of the installed utility.
 .TP
 .B \-x\ (\-\-no\-ifdown)
-Shut down the running kernel, but restore the interface on reload. (If
-this option is used, it must be one of last options specified.)
+Shut down the running kernel, but restore the interface on reload.
 .TP
 .B \-y\ (\-\-no\-sync)
-Shut down the running kernel, but skip syncing the filesystems. (If
-this option is used, it must be one of last options specified.)
+Shut down the running kernel, but skip syncing the filesystems.
 .TP
 .BI \-\-mem\-min= addr
 Specify the lowest memory address
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 7123460..8ce6885 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -913,11 +913,7 @@ void usage(void)
 	       " -f, --force          Force an immediate kexec,\n"
 	       "                      don't call shutdown.\n"
 	       " -x, --no-ifdown      Don't bring down network interfaces.\n"
-	       "                      (if used, must be one of last options\n"
-	       "                       specified)\n"
 	       " -y, --no-sync        Don't sync filesystems before kexec.\n"
-	       "                      (if used, must be one of last options\n"
-	       "                       specified)\n"
 	       " -l, --load           Load the new kernel into the\n"
 	       "                      current kernel.\n"
 	       " -p, --load-panic     Load the new kernel for use on panic.\n"
@@ -1170,8 +1166,8 @@ int main(int argc, char *argv[])
 	int do_exec = 0;
 	int do_load_jump_back_helper = 0;
 	int do_shutdown = 1;
-	int do_sync = 1;
-	int do_ifdown = 0;
+	int do_sync = 1, skip_sync = 0;
+	int do_ifdown = 0, skip_ifdown = 0;
 	int do_unload = 0;
 	int do_reuse_initrd = 0;
 	int do_kexec_file_syscall = 0;
@@ -1219,10 +1215,10 @@ int main(int argc, char *argv[])
 		case OPT_DEBUG:
 			kexec_debug = 1;
 		case OPT_NOIFDOWN:
-			do_ifdown = 0;
+			skip_ifdown = 1;
 			break;
 		case OPT_NOSYNC:
-			do_sync = 0;
+			skip_sync = 1;
 			break;
 		case OPT_FORCE:
 			do_load = 1;
@@ -1321,6 +1317,11 @@ int main(int argc, char *argv[])
 		}
 	}
 
+	if (skip_ifdown)
+		do_ifdown = 0;
+	if (skip_sync)
+		do_sync = 0;
+
 	if (do_load && (kexec_flags & KEXEC_ON_CRASH) &&
 	    !is_crashkernel_mem_reserved()) {
 		die("Memory for crashkernel is not reserved\n"
-- 
2.1.0


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH REPOST 1/2] kexec: implement -y (--no-sync) option
  2015-04-14 12:15       ` [PATCH REPOST 1/2] kexec: implement -y (--no-sync) option Tejun Heo
  2015-04-14 12:16         ` [PATCH REPOST 2/2] kexec: remove ordering constraints from -x (--no-ifdown) and -y (--no-sync) Tejun Heo
@ 2015-04-15  1:09         ` Simon Horman
  2015-04-15  2:42           ` Tejun Heo
  1 sibling, 1 reply; 8+ messages in thread
From: Simon Horman @ 2015-04-15  1:09 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Chris Mason, kexec

Hi Tejun,

On Tue, Apr 14, 2015 at 08:15:09AM -0400, Tejun Heo wrote:
> >From a32a35e46a950cd0e4b4e317a9062c41e79fbfeb Mon Sep 17 00:00:00 2001
> From: Tejun Heo <tj@kernel.org>
> Date: Thu, 26 Mar 2015 14:56:26 -0400
> 
> During kernel develoment, kexec can be used to get out of sticky
> situations without going through possibly lenghty reboot; however,
> there are situations where the filesystem and/or storage stack are
> known to be misbehaving and performing sync before kexecing is
> dangerous or just never finishes.
> 
> This patch implement -y (--no-sync) option which makes kexec skip
> syncing in the similar way as -x (--no-ifdown).
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Suggested-by: Chris Mason <clm@fb.com>
> ---
> Hello, Simon.
> 
> Heh, weird.  Let's see if it goes through this time.

Indeed. I have the patches this time.
They both look good and I have applied them.

> Thanks.
> 
>  kexec/kexec.8 | 8 ++++++--
>  kexec/kexec.c | 8 +++++++-
>  kexec/kexec.h | 4 +++-
>  3 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/kexec/kexec.8 b/kexec/kexec.8
> index 2575f9e..24d1969 100644
> --- a/kexec/kexec.8
> +++ b/kexec/kexec.8
> @@ -6,7 +6,7 @@
>  kexec \- directly boot into a new kernel
>  .SH SYNOPSIS
>  .B /sbin/kexec
> -.B [-v (\-\-version)] [-f (\-\-force)] [-x (\-\-no-ifdown)] [-l (\-\-load)] [-p (\-\-load-panic)] [-u (\-\-unload)] [-e (\-\-exec)] [-t (\-\-type)]
> +.B [-v (\-\-version)] [-f (\-\-force)] [-x (\-\-no-ifdown)] [-y (\-\-no-sync)] [-l (\-\-load)] [-p (\-\-load-panic)] [-u (\-\-unload)] [-e (\-\-exec)] [-t (\-\-type)]
>  .BI [\-\-mem\-min= addr ]
>  .BI [\-\-mem\-max= addr ]
>  
> @@ -148,7 +148,11 @@ Return the version number of the installed utility.
>  .TP
>  .B \-x\ (\-\-no\-ifdown)
>  Shut down the running kernel, but restore the interface on reload. (If
> -this option is used, it must be specified last.)
> +this option is used, it must be one of last options specified.)
> +.TP
> +.B \-y\ (\-\-no\-sync)
> +Shut down the running kernel, but skip syncing the filesystems. (If
> +this option is used, it must be one of last options specified.)
>  .TP
>  .BI \-\-mem\-min= addr
>  Specify the lowest memory address
> diff --git a/kexec/kexec.c b/kexec/kexec.c
> index b088916..7123460 100644
> --- a/kexec/kexec.c
> +++ b/kexec/kexec.c
> @@ -913,7 +913,10 @@ void usage(void)
>  	       " -f, --force          Force an immediate kexec,\n"
>  	       "                      don't call shutdown.\n"
>  	       " -x, --no-ifdown      Don't bring down network interfaces.\n"
> -	       "                      (if used, must be last option\n"
> +	       "                      (if used, must be one of last options\n"
> +	       "                       specified)\n"
> +	       " -y, --no-sync        Don't sync filesystems before kexec.\n"
> +	       "                      (if used, must be one of last options\n"
>  	       "                       specified)\n"
>  	       " -l, --load           Load the new kernel into the\n"
>  	       "                      current kernel.\n"
> @@ -1218,6 +1221,9 @@ int main(int argc, char *argv[])
>  		case OPT_NOIFDOWN:
>  			do_ifdown = 0;
>  			break;
> +		case OPT_NOSYNC:
> +			do_sync = 0;
> +			break;
>  		case OPT_FORCE:
>  			do_load = 1;
>  			do_shutdown = 0;
> diff --git a/kexec/kexec.h b/kexec/kexec.h
> index 4be2b2f..b129c15 100644
> --- a/kexec/kexec.h
> +++ b/kexec/kexec.h
> @@ -209,6 +209,7 @@ extern int file_types;
>  #define OPT_DEBUG		'd'
>  #define OPT_FORCE		'f'
>  #define OPT_NOIFDOWN		'x'
> +#define OPT_NOSYNC		'y'
>  #define OPT_EXEC		'e'
>  #define OPT_LOAD		'l'
>  #define OPT_UNLOAD		'u'
> @@ -227,6 +228,7 @@ extern int file_types;
>  	{ "version",		0, 0, OPT_VERSION }, \
>  	{ "force",		0, 0, OPT_FORCE }, \
>  	{ "no-ifdown",		0, 0, OPT_NOIFDOWN }, \
> +	{ "no-sync",		0, 0, OPT_NOSYNC }, \
>  	{ "load",		0, 0, OPT_LOAD }, \
>  	{ "unload",		0, 0, OPT_UNLOAD }, \
>  	{ "exec",		0, 0, OPT_EXEC }, \
> @@ -241,7 +243,7 @@ extern int file_types;
>  	{ "kexec-file-syscall",	0, 0, OPT_KEXEC_FILE_SYSCALL }, \
>  	{ "debug",		0, 0, OPT_DEBUG }, \
>  
> -#define KEXEC_OPT_STR "h?vdfxluet:ps"
> +#define KEXEC_OPT_STR "h?vdfxyluet:ps"
>  
>  extern void dbgprint_mem_range(const char *prefix, struct memory_range *mr, int nr_mr);
>  extern void die(const char *fmt, ...)
> -- 
> 2.1.0
> 

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH REPOST 1/2] kexec: implement -y (--no-sync) option
  2015-04-15  1:09         ` [PATCH REPOST 1/2] kexec: implement -y (--no-sync) option Simon Horman
@ 2015-04-15  2:42           ` Tejun Heo
  0 siblings, 0 replies; 8+ messages in thread
From: Tejun Heo @ 2015-04-15  2:42 UTC (permalink / raw)
  To: Simon Horman; +Cc: Chris Mason, kexec

On Tue, Apr 14, 2015 at 9:09 PM, Simon Horman <horms@verge.net.au> wrote:
>> Heh, weird.  Let's see if it goes through this time.
>
> Indeed. I have the patches this time.
> They both look good and I have applied them.

Awesome, thanks!

-- 
tejun

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

end of thread, other threads:[~2015-04-15  2:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-26 19:16 [PATCH 1/2] kexec: implement -y (--no-sync) option Tejun Heo
2015-03-26 19:16 ` [PATCH 2/2] kexec: remove ordering constraints from -x (--no-ifdown) and -y (--no-sync) Tejun Heo
2015-04-13 17:01   ` Tejun Heo
2015-04-14  0:29     ` Simon Horman
2015-04-14 12:15       ` [PATCH REPOST 1/2] kexec: implement -y (--no-sync) option Tejun Heo
2015-04-14 12:16         ` [PATCH REPOST 2/2] kexec: remove ordering constraints from -x (--no-ifdown) and -y (--no-sync) Tejun Heo
2015-04-15  1:09         ` [PATCH REPOST 1/2] kexec: implement -y (--no-sync) option Simon Horman
2015-04-15  2:42           ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.