[Pkg-sysvinit-commits] r1274 - in sysvinit/trunk/debian: . patches
pere at alioth.debian.org
pere at alioth.debian.org
Tue May 20 06:36:16 UTC 2008
Author: pere
Date: 2008-05-20 06:36:15 +0000 (Tue, 20 May 2008)
New Revision: 1274
Added:
sysvinit/trunk/debian/patches/84_killall_fuse.dpatch
Modified:
sysvinit/trunk/debian/changelog
sysvinit/trunk/debian/patches/00list
Log:
* Avoid shutdown problems with user space file systems, by not
stat()-ing files when killing processes during
shutdown (Closes: #476695). Patch from Goswin von Brederlow.
Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog 2008-05-20 06:15:22 UTC (rev 1273)
+++ sysvinit/trunk/debian/changelog 2008-05-20 06:36:15 UTC (rev 1274)
@@ -10,6 +10,9 @@
debian/sysv-rc/man8/ja/update-rc.d.8 and
debian/sysv-rc/etc/init.d/rc to UTF-8 (Closes: #478657).
Patch from Ben Finney.
+ * Avoid shutdown problems with user space file systems, by not
+ stat()-ing files when killing processes during
+ shutdown (Closes: #476695). Patch from Goswin von Brederlow.
-- Petter Reinholdtsen <pere at debian.org> Mon, 19 May 2008 08:26:01 +0200
Modified: sysvinit/trunk/debian/patches/00list
===================================================================
--- sysvinit/trunk/debian/patches/00list 2008-05-20 06:15:22 UTC (rev 1273)
+++ sysvinit/trunk/debian/patches/00list 2008-05-20 06:36:15 UTC (rev 1274)
@@ -38,6 +38,7 @@
82_killall_retval
82_killall_exclude_pids
83_killall_manref
+84_killall_fuse
90_shutdown_H
91_sulogin_lockedpw
92_sata-hddown
Added: sysvinit/trunk/debian/patches/84_killall_fuse.dpatch
===================================================================
--- sysvinit/trunk/debian/patches/84_killall_fuse.dpatch (rev 0)
+++ sysvinit/trunk/debian/patches/84_killall_fuse.dpatch 2008-05-20 06:36:15 UTC (rev 1274)
@@ -0,0 +1,77 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 84_killall_fuse.dpatch by Goswin von Brederlow.
+
+Goal:
+
+ Make killall5 work better with user space file systems, needing
+ running processes to do stat(). Avoid stat() when the information
+ isn't used, and lock process in memory to avoid paging when fuse
+ user space process is stopped.
+
+Fixes: #476695
+Status wrt upstream: Should be sent upstream. Not done yet.
+Notes:
+
+ at DPATCH@
+Index: trunk/src/killall5.c
+===================================================================
+--- trunk/src/killall5.c (revision 1266)
++++ trunk/src/killall5.c (working copy)
+@@ -40,10 +40,13 @@
+ #include <syslog.h>
+ #include <getopt.h>
+ #include <stdarg.h>
++#include <sys/mman.h>
+
+ char *Version = "@(#)killall5 2.86 31-Jul-2004 miquels at cistron.nl";
+
+ #define STATNAMELEN 15
++#define DO_STAT 1
++#define NO_STAT 0
+
+ /* Info about a process. */
+ typedef struct proc {
+@@ -166,7 +169,7 @@
+ /*
+ * Read the proc filesystem.
+ */
+-int readproc()
++int readproc(int do_stat)
+ {
+ DIR *dir;
+ FILE *fp;
+@@ -306,7 +309,7 @@
+
+ /* Try to stat the executable. */
+ snprintf(path, sizeof(path), "/proc/%s/exe", d->d_name);
+- if (stat(path, &st) == 0) {
++ if (do_stat && stat(path, &st) == 0) {
+ p->dev = st.st_dev;
+ p->ino = st.st_ino;
+ }
+@@ -519,7 +522,7 @@
+ argv += optind;
+
+ /* Print out process-ID's one by one. */
+- readproc();
++ readproc(DO_STAT);
+ for(f = 0; f < argc; f++) {
+ if ((q = pidof(argv[f])) != NULL) {
+ spid = 0;
+@@ -595,12 +598,15 @@
+ signal(SIGSTOP, SIG_IGN);
+ signal(SIGKILL, SIG_IGN);
+
++ /* lock us into memory */
++ mlockall(MCL_CURRENT | MCL_FUTURE);
++
+ /* Now stop all processes. */
+ kill(-1, SIGSTOP);
+ sent_sigstop = 1;
+
+ /* Read /proc filesystem */
+- if (readproc() < 0) {
++ if (readproc(NO_STAT) < 0) {
+ kill(-1, SIGCONT);
+ exit(1);
+ }
More information about the Pkg-sysvinit-commits
mailing list