summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/patches/0001-include-install-refcount.h.patch26
-rw-r--r--debian/patches/0002-libdiskfs-lock-less-reference-counting-for-peropen-o.patch143
-rw-r--r--debian/patches/0003-exec-add-missing-includes.patch39
-rw-r--r--debian/patches/0004-pfinet-add-missing-include.patch26
-rw-r--r--debian/patches/0005-libdiskfs-fix-type-of-dir_cache_id-node_cache_id.patch27
-rw-r--r--debian/patches/0006-Avoid-compiler-warning-about-empty-bodies.patch120
-rw-r--r--debian/patches/0007-libstore-provide-function-declaration-until-availabl.patch38
-rw-r--r--debian/patches/0008-term-fix-memory-leak.patch30
-rw-r--r--debian/patches/0009-libpager-drop-unused-fields-from-struct-pager.patch26
-rw-r--r--debian/patches/0010-ext2fs-fix-diskfs_pager_users.patch29
-rw-r--r--debian/patches/0011-trans-mtab-fix-initialization.patch26
-rw-r--r--debian/patches/0012-libdiskfs-fix-node-leak-in-the-name-cache.patch26
-rw-r--r--debian/patches/series12
13 files changed, 568 insertions, 0 deletions
diff --git a/debian/patches/0001-include-install-refcount.h.patch b/debian/patches/0001-include-install-refcount.h.patch
new file mode 100644
index 00000000..9eed8a72
--- /dev/null
+++ b/debian/patches/0001-include-install-refcount.h.patch
@@ -0,0 +1,26 @@
+From b793108b09138edf0a963d9e3107eb400ee27011 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Thu, 22 May 2014 20:04:33 +0200
+Subject: [PATCH 01/12] include: install refcount.h
+
+* include/Makefile (installhdrs): Add refcount.h.
+---
+ include/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/Makefile b/include/Makefile
+index b8773fe..4de165d 100644
+--- a/include/Makefile
++++ b/include/Makefile
+@@ -22,7 +22,7 @@
+ dir := include
+ makemode := misc
+
+-installhdrs := sys/procfs.h
++installhdrs := sys/procfs.h refcount.h
+
+ include ../Makeconf
+
+--
+2.0.0.rc2
+
diff --git a/debian/patches/0002-libdiskfs-lock-less-reference-counting-for-peropen-o.patch b/debian/patches/0002-libdiskfs-lock-less-reference-counting-for-peropen-o.patch
new file mode 100644
index 00000000..456de971
--- /dev/null
+++ b/debian/patches/0002-libdiskfs-lock-less-reference-counting-for-peropen-o.patch
@@ -0,0 +1,143 @@
+From dc00a94df4a06764d822b29cbf35b532343821c8 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Tue, 6 May 2014 18:58:10 +0200
+Subject: [PATCH 02/12] libdiskfs: lock-less reference counting for peropen
+ objects
+
+* libdiskfs/diskfs.h (struct peropen): Use refcount_t for field refcnt.
+* libdiskfs/peropen-make.c (diskfs_make_peropen): Initialize refcnt.
+* libdiskfs/peropen-rele.c (diskfs_release_peropen): Adjust accordingly.
+* libdiskfs/protid-make.c (diskfs_start_protid): Likewise. Also, the
+node must no longer be locked, adjust comment accordingly.
+(diskfs_create_protid): Likewise.
+---
+ libdiskfs/diskfs.h | 7 ++++---
+ libdiskfs/peropen-make.c | 2 +-
+ libdiskfs/peropen-rele.c | 21 ++++++++++-----------
+ libdiskfs/protid-make.c | 8 ++++----
+ 4 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h
+index 8151ddc..ae1a150 100644
+--- a/libdiskfs/diskfs.h
++++ b/libdiskfs/diskfs.h
+@@ -28,6 +28,7 @@
+ #include <hurd/iohelp.h>
+ #include <idvec.h>
+ #include <features.h>
++#include <refcount.h>
+
+ #ifdef DISKFS_DEFINE_EXTERN_INLINE
+ #define DISKFS_EXTERN_INLINE
+@@ -57,7 +58,7 @@ struct peropen
+ {
+ int filepointer;
+ int lock_status;
+- int refcnt;
++ refcount_t refcnt;
+ int openstat;
+
+ struct node *np;
+@@ -792,12 +793,12 @@ diskfs_create_node (struct node *dir, const char *name, mode_t mode,
+ struct dirstat *ds);
+
+ /* Create and return a protid for an existing peropen PO in CRED,
+- referring to user USER. The node PO->np must be locked. */
++ referring to user USER. */
+ error_t diskfs_create_protid (struct peropen *po, struct iouser *user,
+ struct protid **cred);
+
+ /* Build and return in CRED a protid which has no user identification, for
+- peropen PO. The node PO->np must be locked. */
++ peropen PO. */
+ error_t diskfs_start_protid (struct peropen *po, struct protid **cred);
+
+ /* Finish building protid CRED started with diskfs_start_protid;
+diff --git a/libdiskfs/peropen-make.c b/libdiskfs/peropen-make.c
+index eba037f..6d5ca01 100644
+--- a/libdiskfs/peropen-make.c
++++ b/libdiskfs/peropen-make.c
+@@ -31,7 +31,7 @@ diskfs_make_peropen (struct node *np, int flags, struct peropen *context,
+
+ po->filepointer = 0;
+ po->lock_status = LOCK_UN;
+- po->refcnt = 0;
++ refcount_init (&po->refcnt, 0);
+ po->openstat = flags;
+ po->np = np;
+ po->path = NULL;
+diff --git a/libdiskfs/peropen-rele.c b/libdiskfs/peropen-rele.c
+index d3f7492..877137b 100644
+--- a/libdiskfs/peropen-rele.c
++++ b/libdiskfs/peropen-rele.c
+@@ -22,13 +22,8 @@
+ void
+ diskfs_release_peropen (struct peropen *po)
+ {
+- pthread_mutex_lock (&po->np->lock);
+-
+- if (--po->refcnt)
+- {
+- pthread_mutex_unlock (&po->np->lock);
+- return;
+- }
++ if (refcount_deref (&po->refcnt) > 0)
++ return;
+
+ if (po->root_parent)
+ mach_port_deallocate (mach_task_self (), po->root_parent);
+@@ -40,10 +35,14 @@ diskfs_release_peropen (struct peropen *po)
+ mach_port_deallocate (mach_task_self (), po->shadow_root_parent);
+
+ if (po->lock_status != LOCK_UN)
+- fshelp_acquire_lock (&po->np->userlock, &po->lock_status,
+- &po->np->lock, LOCK_UN);
+-
+- diskfs_nput (po->np);
++ {
++ pthread_mutex_lock (&po->np->lock);
++ fshelp_acquire_lock (&po->np->userlock, &po->lock_status,
++ &po->np->lock, LOCK_UN);
++ diskfs_nput (po->np);
++ }
++ else
++ diskfs_nrele (po->np);
+
+ free (po->path);
+ free (po);
+diff --git a/libdiskfs/protid-make.c b/libdiskfs/protid-make.c
+index b39b92a..22aaa2e 100644
+--- a/libdiskfs/protid-make.c
++++ b/libdiskfs/protid-make.c
+@@ -20,7 +20,7 @@
+ #include <assert.h>
+
+ /* Build and return in CRED a protid which has no user identification, for
+- peropen PO. The node PO->np must be locked. */
++ peropen PO. */
+ error_t
+ diskfs_start_protid (struct peropen *po, struct protid **cred)
+ {
+@@ -29,7 +29,7 @@ diskfs_start_protid (struct peropen *po, struct protid **cred)
+ sizeof (struct protid), cred);
+ if (! err)
+ {
+- po->refcnt++;
++ refcount_ref (&po->refcnt);
+ (*cred)->po = po;
+ (*cred)->shared_object = MACH_PORT_NULL;
+ (*cred)->mapped = 0;
+@@ -55,8 +55,8 @@ diskfs_finish_protid (struct protid *cred, struct iouser *user)
+ assert_perror (err);
+ }
+
+-/* Create and return a protid for an existing peropen PO in CRED for USER.
+- The node PO->np must be locked. */
++/* Create and return a protid for an existing peropen PO in CRED for
++ USER. */
+ error_t
+ diskfs_create_protid (struct peropen *po, struct iouser *user,
+ struct protid **cred)
+--
+2.0.0.rc2
+
diff --git a/debian/patches/0003-exec-add-missing-includes.patch b/debian/patches/0003-exec-add-missing-includes.patch
new file mode 100644
index 00000000..44a0dcd5
--- /dev/null
+++ b/debian/patches/0003-exec-add-missing-includes.patch
@@ -0,0 +1,39 @@
+From 31b2a835f4ed563ae34a6bc07f5fa1dec9b0fa95 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Tue, 20 May 2014 16:02:59 +0200
+Subject: [PATCH 03/12] exec: add missing includes
+
+* exec/exec.c: Include mach/gnumach.h.
+* exec/main.c: Include device/device.h.
+---
+ exec/exec.c | 1 +
+ exec/main.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/exec/exec.c b/exec/exec.c
+index b068f5e..2fc1e44 100644
+--- a/exec/exec.c
++++ b/exec/exec.c
+@@ -24,6 +24,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+
+ #include "priv.h"
++#include <mach/gnumach.h>
+ #include <hurd.h>
+ #include <hurd/exec.h>
+ #include <sys/stat.h>
+diff --git a/exec/main.c b/exec/main.c
+index 27f33b1..78faebd 100644
+--- a/exec/main.c
++++ b/exec/main.c
+@@ -21,6 +21,7 @@
+
+ #include "priv.h"
+ #include <error.h>
++#include <device/device.h>
+ #include <hurd/paths.h>
+ #include <hurd/startup.h>
+ #include <argp.h>
+--
+2.0.0.rc2
+
diff --git a/debian/patches/0004-pfinet-add-missing-include.patch b/debian/patches/0004-pfinet-add-missing-include.patch
new file mode 100644
index 00000000..23aa305f
--- /dev/null
+++ b/debian/patches/0004-pfinet-add-missing-include.patch
@@ -0,0 +1,26 @@
+From 67d467a09126e9246ca7fd57ff63952577497c83 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Thu, 22 May 2014 20:14:02 +0200
+Subject: [PATCH 04/12] pfinet: add missing include
+
+* pfinet/linux-src/include/net/addrconf.h: Include ipv6.h.
+---
+ pfinet/linux-src/include/net/addrconf.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/pfinet/linux-src/include/net/addrconf.h b/pfinet/linux-src/include/net/addrconf.h
+index d711d0d..4b27077 100644
+--- a/pfinet/linux-src/include/net/addrconf.h
++++ b/pfinet/linux-src/include/net/addrconf.h
+@@ -1,6 +1,8 @@
+ #ifndef _ADDRCONF_H
+ #define _ADDRCONF_H
+
++#include "ipv6.h"
++
+ #define RETRANS_TIMER HZ
+
+ #define MAX_RTR_SOLICITATIONS 3
+--
+2.0.0.rc2
+
diff --git a/debian/patches/0005-libdiskfs-fix-type-of-dir_cache_id-node_cache_id.patch b/debian/patches/0005-libdiskfs-fix-type-of-dir_cache_id-node_cache_id.patch
new file mode 100644
index 00000000..d7b53730
--- /dev/null
+++ b/debian/patches/0005-libdiskfs-fix-type-of-dir_cache_id-node_cache_id.patch
@@ -0,0 +1,27 @@
+From acddf44071674746d61895d89172481f85ca8d31 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Wed, 21 May 2014 13:20:29 +0200
+Subject: [PATCH 05/12] libdiskfs: fix type of dir_cache_id, node_cache_id
+
+* libdiskfs/name-cache.c (struct lookup_cache): Fix type of
+dir_cache_id, node_cache_id.
+---
+ libdiskfs/name-cache.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libdiskfs/name-cache.c b/libdiskfs/name-cache.c
+index 8424ffe..c113692 100644
+--- a/libdiskfs/name-cache.c
++++ b/libdiskfs/name-cache.c
+@@ -37,7 +37,7 @@ struct lookup_cache
+ /* Used to indentify nodes to the fs dependent code. 0 for NODE_CACHE_ID
+ means a `negative' entry -- recording that there's definitely no node with
+ this name. */
+- int dir_cache_id, node_cache_id;
++ ino64_t dir_cache_id, node_cache_id;
+
+ /* Name of the node NODE_CACHE_ID in the directory DIR_CACHE_ID. Entries
+ with names too long to fit in this buffer aren't cached at all. */
+--
+2.0.0.rc2
+
diff --git a/debian/patches/0006-Avoid-compiler-warning-about-empty-bodies.patch b/debian/patches/0006-Avoid-compiler-warning-about-empty-bodies.patch
new file mode 100644
index 00000000..370cf735
--- /dev/null
+++ b/debian/patches/0006-Avoid-compiler-warning-about-empty-bodies.patch
@@ -0,0 +1,120 @@
+From 1333bbbcc18502328cdd78b2aadc526ebd552a77 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Tue, 20 May 2014 16:07:44 +0200
+Subject: [PATCH 06/12] Avoid compiler warning about empty bodies
+
+Make empty bodies of control flow statements more explicit. Doing so
+will allow us to use stricter compiler settings. This would have
+cought 4ece292c.
+
+* console-client/xkb/xkb.c: Make empty bodies more explicit
+* libpipe/pipe.c: Likewise.
+* mach-defpager/default_pager.c: Likewise.
+* pfinet/linux-src/net/ipv4/fib_hash.c: Likewise.
+* pflocal/connq.c: Likewise.
+* pflocal/socket.c: Likewise.
+---
+ console-client/xkb/xkb.c | 3 ++-
+ libpipe/pipe.c | 4 +++-
+ mach-defpager/default_pager.c | 4 ++--
+ pfinet/linux-src/net/ipv4/fib_hash.c | 2 +-
+ pflocal/connq.c | 2 +-
+ pflocal/socket.c | 4 +++-
+ 6 files changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/console-client/xkb/xkb.c b/console-client/xkb/xkb.c
+index 0b43913..0039714 100644
+--- a/console-client/xkb/xkb.c
++++ b/console-client/xkb/xkb.c
+@@ -606,10 +606,11 @@ clearcontrols (keypress_t key, boolctrls ctrls, int flags)
+ static void
+ lockcontrols (keypress_t key, boolctrls ctrls, int flags)
+ {
++ /* XXX this needs a closer look. */
+ if (!key.rel)
+ {
+ //setcontrols (key, boolctrls, flags);
+- if (!(flags & noLock));
++ //if (!(flags & noLock))
+ // lboolctrls |= boolctrls;
+ }
+ else
+diff --git a/libpipe/pipe.c b/libpipe/pipe.c
+index 1080b5d..f9300e7 100644
+--- a/libpipe/pipe.c
++++ b/libpipe/pipe.c
+@@ -352,7 +352,9 @@ pipe_send (struct pipe *pipe, int noblock, void *source,
+ if (!err)
+ err = packet_set_ports (control_packet, ports, num_ports);
+ if (err)
+- /* Trash CONTROL_PACKET somehow XXX */;
++ {
++ /* Trash CONTROL_PACKET somehow XXX */
++ }
+ }
+ }
+
+diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c
+index f514ea6..380c724 100644
+--- a/mach-defpager/default_pager.c
++++ b/mach-defpager/default_pager.c
+@@ -88,13 +88,13 @@ synchronized_printf (const char *fmt, ...)
+ #if 0
+ #define dprintf(f, x...) synchronized_printf (f, ##x)
+ #else
+-#define dprintf(f, x...)
++#define dprintf(f, x...) (void) 0
+ #endif
+
+ #if 0
+ #define ddprintf(f, x...) synchronized_printf (f, ##x)
+ #else
+-#define ddprintf(f, x...)
++#define ddprintf(f, x...) (void) 0
+ #endif
+
+ /*
+diff --git a/pfinet/linux-src/net/ipv4/fib_hash.c b/pfinet/linux-src/net/ipv4/fib_hash.c
+index d9e029c..e3987ea 100644
+--- a/pfinet/linux-src/net/ipv4/fib_hash.c
++++ b/pfinet/linux-src/net/ipv4/fib_hash.c
+@@ -406,7 +406,7 @@ static void rtmsg_fib(int, struct fib_node*, int, int,
+ struct nlmsghdr *n,
+ struct netlink_skb_parms *);
+ #else
+-#define rtmsg_fib(a, b, c, d, e, f)
++#define rtmsg_fib(a, b, c, d, e, f) (void) 0
+ #endif
+
+
+diff --git a/pflocal/connq.c b/pflocal/connq.c
+index d88711e..d86f9a2 100644
+--- a/pflocal/connq.c
++++ b/pflocal/connq.c
+@@ -212,7 +212,7 @@ connq_listen (struct connq *cq, struct timespec *tsp, struct sock **sock)
+ request and another listener (should) eventually come along.
+ (In fact it is very probably as the caller has likely done a
+ select and will now follow up with an accept.) */
+- ;
++ { /* Do nothing. */ }
+
+ out:
+ pthread_mutex_unlock (&cq->lock);
+diff --git a/pflocal/socket.c b/pflocal/socket.c
+index 7142c6e..792c637 100644
+--- a/pflocal/socket.c
++++ b/pflocal/socket.c
+@@ -198,7 +198,9 @@ S_socket_accept (struct sock_user *user,
+ ports_port_deref (peer_addr);
+ }
+ else
+- /* TEAR DOWN THE CONNECTION XXX */;
++ {
++ /* TEAR DOWN THE CONNECTION XXX */
++ }
+ }
+ }
+
+--
+2.0.0.rc2
+
diff --git a/debian/patches/0007-libstore-provide-function-declaration-until-availabl.patch b/debian/patches/0007-libstore-provide-function-declaration-until-availabl.patch
new file mode 100644
index 00000000..45151513
--- /dev/null
+++ b/debian/patches/0007-libstore-provide-function-declaration-until-availabl.patch
@@ -0,0 +1,38 @@
+From cf0a11322f70824107ae3ac7a45c21c8a6cac558 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Wed, 21 May 2014 13:30:24 +0200
+Subject: [PATCH 07/12] libstore: provide function declaration until available
+ upstream
+
+Until the Hurd specific header is available, provide a local
+declaration of ped_device_new_from_store.
+
+* libstore/part.c (ped_device_new_from_store): New declaration.
+---
+ libstore/part.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/libstore/part.c b/libstore/part.c
+index 56e904e..fb7f07e 100644
+--- a/libstore/part.c
++++ b/libstore/part.c
+@@ -26,6 +26,16 @@
+
+ #include <parted/parted.h>
+ /*#include <parted/device_gnu.h>*/
++
++/* XXX Until the Hurd specific header is available, provide the
++ declaration of ped_device_new_from_store here. */
++
++/* Initialize a PedDevice using SOURCE. The SOURCE will NOT be destroyed;
++ the caller created it, it is the caller's responsilbility to free it
++ after it calls ped_device_destory. SOURCE is not registered in Parted's
++ list of devices. */
++PedDevice* ped_device_new_from_store (struct store *source);
++
+ #include <string.h>
+ #include <error.h>
+
+--
+2.0.0.rc2
+
diff --git a/debian/patches/0008-term-fix-memory-leak.patch b/debian/patches/0008-term-fix-memory-leak.patch
new file mode 100644
index 00000000..50873ada
--- /dev/null
+++ b/debian/patches/0008-term-fix-memory-leak.patch
@@ -0,0 +1,30 @@
+From 3f55bd402025bb8c21686086c0721b049472c3b4 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Tue, 20 May 2014 16:17:17 +0200
+Subject: [PATCH 08/12] term: fix memory leak
+
+I hope someone fixed that bug.
+
+* term/users.c (pi_destroy_hook): Fix memory leak.
+---
+ term/users.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/term/users.c b/term/users.c
+index 97bc22c..9bd51d0 100644
+--- a/term/users.c
++++ b/term/users.c
+@@ -259,9 +259,7 @@ pi_destroy_hook (struct trivfs_protid *cred)
+ {
+ assert (((struct protid_hook *)cred->hook)->refcnt > 0);
+ if (--((struct protid_hook *)cred->hook)->refcnt == 0)
+- /* XXX don't free for now, so we can try and catch a multiple-freeing
+- bug. */
+- /* free (cred->hook) */;
++ free (cred->hook);
+ }
+ pthread_mutex_unlock (&global_lock);
+ }
+--
+2.0.0.rc2
+
diff --git a/debian/patches/0009-libpager-drop-unused-fields-from-struct-pager.patch b/debian/patches/0009-libpager-drop-unused-fields-from-struct-pager.patch
new file mode 100644
index 00000000..62c7a27b
--- /dev/null
+++ b/debian/patches/0009-libpager-drop-unused-fields-from-struct-pager.patch
@@ -0,0 +1,26 @@
+From 31a897520d73e7be2453428fde4557b68b74b90f Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Sun, 25 May 2014 14:37:55 +0200
+Subject: [PATCH 09/12] libpager: drop unused fields from struct pager
+
+* libpager/priv.h (struct pager): Drop fields next, pprev.
+---
+ libpager/priv.h | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/libpager/priv.h b/libpager/priv.h
+index d49cbb9..1f8405a 100644
+--- a/libpager/priv.h
++++ b/libpager/priv.h
+@@ -59,8 +59,6 @@ struct pager
+
+ int noterm; /* number of threads blocking termination */
+
+- struct pager *next, **pprev;
+-
+ int termwaiting:1;
+ int waitingforseqno:1;
+
+--
+2.0.0.rc2
+
diff --git a/debian/patches/0010-ext2fs-fix-diskfs_pager_users.patch b/debian/patches/0010-ext2fs-fix-diskfs_pager_users.patch
new file mode 100644
index 00000000..2f78e1e2
--- /dev/null
+++ b/debian/patches/0010-ext2fs-fix-diskfs_pager_users.patch
@@ -0,0 +1,29 @@
+From f834b1f76f22f301daf9759973244838fecae56b Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Sun, 25 May 2014 14:18:35 +0200
+Subject: [PATCH 10/12] ext2fs: fix diskfs_pager_users
+
+This fixes a bug introduced in 86122789.
+
+* ext2fs/pager.c (diskfs_pager_users): We count file_pager_bucket,
+which does not include the disk pagers. Fix condition accordingly.
+---
+ ext2fs/pager.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ext2fs/pager.c b/ext2fs/pager.c
+index 017efcc..ce5bc6d 100644
+--- a/ext2fs/pager.c
++++ b/ext2fs/pager.c
+@@ -1449,7 +1449,7 @@ diskfs_pager_users ()
+ {
+ int npagers = ports_count_bucket (file_pager_bucket);
+
+- if (npagers <= 1)
++ if (npagers == 0)
+ return 0;
+
+ if (MAY_CACHE)
+--
+2.0.0.rc2
+
diff --git a/debian/patches/0011-trans-mtab-fix-initialization.patch b/debian/patches/0011-trans-mtab-fix-initialization.patch
new file mode 100644
index 00000000..67d6332f
--- /dev/null
+++ b/debian/patches/0011-trans-mtab-fix-initialization.patch
@@ -0,0 +1,26 @@
+From cab118a3d0142b5585ba5c8a2fc4ab163f835b31 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Fri, 23 May 2014 09:54:10 +0200
+Subject: [PATCH 11/12] trans/mtab: fix initialization
+
+* trans/mtab.c (main): Fix initialization of mtab in one-shot mode.
+---
+ trans/mtab.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/trans/mtab.c b/trans/mtab.c
+index 8c9f8d3..df03b1d 100644
+--- a/trans/mtab.c
++++ b/trans/mtab.c
+@@ -255,7 +255,7 @@ main (int argc, char *argv[])
+ else
+ {
+ /* One-shot mode. */
+- struct mtab mtab = { NULL, 0, 0 };
++ struct mtab mtab = { .lock = PTHREAD_MUTEX_INITIALIZER };
+ err = mtab_populate (&mtab, target_path, insecure);
+ if (err)
+ error (5, err, "%s", target_path);
+--
+2.0.0.rc2
+
diff --git a/debian/patches/0012-libdiskfs-fix-node-leak-in-the-name-cache.patch b/debian/patches/0012-libdiskfs-fix-node-leak-in-the-name-cache.patch
new file mode 100644
index 00000000..a553a57b
--- /dev/null
+++ b/debian/patches/0012-libdiskfs-fix-node-leak-in-the-name-cache.patch
@@ -0,0 +1,26 @@
+From d20ab223f4fdf2b8bcc44a9fdbd664df154a850e Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Sat, 24 May 2014 20:29:23 +0200
+Subject: [PATCH 12/12] libdiskfs: fix node leak in the name cache
+
+* libdiskfs/name-cache.c (diskfs_check_lookup_cache): Release node
+reference in a special case of lookup failure.
+---
+ libdiskfs/name-cache.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libdiskfs/name-cache.c b/libdiskfs/name-cache.c
+index c113692..a212a6d 100644
+--- a/libdiskfs/name-cache.c
++++ b/libdiskfs/name-cache.c
+@@ -249,6 +249,7 @@ diskfs_check_lookup_cache (struct node *dir, const char *name)
+ {
+ /* Lose */
+ pthread_mutex_unlock (&np->lock);
++ diskfs_nrele (np);
+ return 0;
+ }
+ }
+--
+2.0.0.rc2
+
diff --git a/debian/patches/series b/debian/patches/series
index c08b0f99..2682782f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -40,3 +40,15 @@ xkb-compat.patch
mach-defpager-protected-payload.patch
+0001-include-install-refcount.h.patch
+0002-libdiskfs-lock-less-reference-counting-for-peropen-o.patch
+0003-exec-add-missing-includes.patch
+0004-pfinet-add-missing-include.patch
+0005-libdiskfs-fix-type-of-dir_cache_id-node_cache_id.patch
+0006-Avoid-compiler-warning-about-empty-bodies.patch
+0007-libstore-provide-function-declaration-until-availabl.patch
+0008-term-fix-memory-leak.patch
+0009-libpager-drop-unused-fields-from-struct-pager.patch
+0010-ext2fs-fix-diskfs_pager_users.patch
+0011-trans-mtab-fix-initialization.patch
+0012-libdiskfs-fix-node-leak-in-the-name-cache.patch