diff -Nru mountall-2.36.4/debian/changelog mountall-2.36.4/debian/changelog --- mountall-2.36.4/debian/changelog 2013-02-03 01:38:27.000000000 +0000 +++ mountall-2.36.4/debian/changelog 2013-04-01 02:11:43.000000000 +0000 @@ -1,3 +1,10 @@ +mountall (2.36.4-zfs2) precise; urgency=low + + * Fix upstream-tag typo in gbp.conf file. + * Handle duplicate mount points. + + -- Darik Horn Sun, 31 Mar 2013 21:11:17 -0500 + mountall (2.36.4-zfs1) precise; urgency=low * Provide zfs-mountall virtual package. diff -Nru mountall-2.36.4/debian/gbp.conf mountall-2.36.4/debian/gbp.conf --- mountall-2.36.4/debian/gbp.conf 2013-02-03 01:27:47.000000000 +0000 +++ mountall-2.36.4/debian/gbp.conf 2013-04-01 02:06:43.000000000 +0000 @@ -2,4 +2,4 @@ debian-branch=master/ubuntu/precise debian-tag=master/ubuntu/precise/%(version)s upstream-branch=upstream/ubuntu/precise -upstream-tag-format=upstream/ubuntu/precise/%(version)s +upstream-tag=upstream/ubuntu/precise/%(version)s diff -Nru mountall-2.36.4/debian/patches/0003-readonly-and-atime-options-reflected-during-mount.patch mountall-2.36.4/debian/patches/0003-readonly-and-atime-options-reflected-during-mount.patch --- mountall-2.36.4/debian/patches/0003-readonly-and-atime-options-reflected-during-mount.patch 1970-01-01 00:00:00.000000000 +0000 +++ mountall-2.36.4/debian/patches/0003-readonly-and-atime-options-reflected-during-mount.patch 2013-04-01 02:09:10.000000000 +0000 @@ -0,0 +1,60 @@ +From: Matus Kral +Date: Wed, 30 Jan 2013 08:09:00 +0100 +Subject: readonly and atime options reflected during mount + +--- + src/mountall.c | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +Index: b/src/mountall.c +=================================================================== +--- a/src/mountall.c ++++ b/src/mountall.c +@@ -762,7 +762,7 @@ + size_t bufsz = 4096; + FILE *zfs_stream; + const char zfs_command[] = +- "/sbin/zfs list -H -t filesystem -o name,mountpoint,canmount"; ++ "/sbin/zfs list -H -t filesystem -o name,mountpoint,canmount,readonly,atime"; + int zfs_result; + + nih_debug ("parsing ZFS list"); +@@ -781,7 +781,8 @@ + /* Read one line from the pipe into the buffer. */ + while (fgets (buf, bufsz, zfs_stream) != NULL) { + char *saveptr; +- char *zfs_name, *zfs_mountpoint, *zfs_canmount; ++ char *zfs_name, *zfs_mountpoint, *zfs_canmount, *zfs_optatime, *zfs_optronly; ++ nih_local char *zfs_mntoptions = NULL; + + /* If the line didn't fit, then enlarge the buffer and retry. */ + while ((! strchr (buf, '\n')) && (! feof (zfs_stream))) { +@@ -804,12 +805,26 @@ + } + + /* ASSERT: canmount = on | off | noauto */ +- zfs_canmount = strtok_r (NULL, "\t\n", &saveptr); ++ zfs_canmount = strtok_r (NULL, "\t", &saveptr); + if (! zfs_canmount || strcmp (zfs_canmount, "on")) { + continue; + } + +- new_mount (zfs_mountpoint, zfs_name, FALSE, "zfs", "zfsutil,nobootwait"); ++ NIH_MUST (nih_strcat (&zfs_mntoptions, NULL, "zfsutil")); ++ ++ /* ASSERT: readonly = on | off */ ++ zfs_optronly = strtok_r (NULL, "\t", &saveptr); ++ if ( zfs_optronly && strcmp (zfs_optronly, "off") ) { ++ NIH_MUST (nih_strcat (&zfs_mntoptions, NULL, ",ro")); ++ } ++ ++ /* ASSERT: atime = on | off */ ++ zfs_optatime = strtok_r (NULL, "\t\n", &saveptr); ++ if ( zfs_optatime && strcmp (zfs_optatime, "on") ) { ++ NIH_MUST (nih_strcat (&zfs_mntoptions, NULL, ",noatime")); ++ } ++ ++ new_mount (zfs_mountpoint, zfs_name, FALSE, "zfs", zfs_mntoptions); + } + + zfs_result = pclose (zfs_stream); diff -Nru mountall-2.36.4/debian/patches/0003-solves-dependencies-problem-endless-loop.patch mountall-2.36.4/debian/patches/0003-solves-dependencies-problem-endless-loop.patch --- mountall-2.36.4/debian/patches/0003-solves-dependencies-problem-endless-loop.patch 2013-02-03 01:28:02.000000000 +0000 +++ mountall-2.36.4/debian/patches/0003-solves-dependencies-problem-endless-loop.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -From: Matus Kral -Date: Wed, 30 Jan 2013 05:11:12 +0100 -Subject: solves dependencies problem, endless loop -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -I suppose this needs fixing in mountall original code, but for the time being. - -specific case like this: - -fs                   mountpoint -zfs                  /zfs -zfs/home             /home -zfs/home/1           /zfs/test/1 -zfs/test             /zfs/test - -mountall ended up in a endless loop, waiting for dependencies. if mounts are read ordered by mount points, it's ok.  ---- - src/mountall.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/mountall.c b/src/mountall.c -index 2be5903..5789d7e 100644 ---- a/src/mountall.c -+++ b/src/mountall.c -@@ -762,7 +762,7 @@ parse_zfs_list (void) - size_t bufsz = 4096; - FILE *zfs_stream; - const char zfs_command[] = -- "/sbin/zfs list -H -t filesystem -o name,mountpoint,canmount"; -+ "/sbin/zfs list -H -t filesystem -s mountpoint -o name,mountpoint,canmount"; - int zfs_result; - - nih_debug ("parsing ZFS list"); --- diff -Nru mountall-2.36.4/debian/patches/0004-no-filesystem-should-depend-on-mounting-swap-first.patch mountall-2.36.4/debian/patches/0004-no-filesystem-should-depend-on-mounting-swap-first.patch --- mountall-2.36.4/debian/patches/0004-no-filesystem-should-depend-on-mounting-swap-first.patch 1970-01-01 00:00:00.000000000 +0000 +++ mountall-2.36.4/debian/patches/0004-no-filesystem-should-depend-on-mounting-swap-first.patch 2013-04-01 02:06:59.000000000 +0000 @@ -0,0 +1,23 @@ +From: mk01 +Date: Fri, 1 Feb 2013 02:06:57 +0100 +Subject: no filesystem should depend on mounting swap first + +--- + src/mountall.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/mountall.c b/src/mountall.c +index e2396f6..a23f407 100644 +--- a/src/mountall.c ++++ b/src/mountall.c +@@ -1345,7 +1345,8 @@ mount_policy (void) + && strcmp (mnt->device, "none") + && strcmp (mnt->device, mnt->type) + && (mnt->entry.prev != mounts) +- && strcmp (((Mount *)mnt->entry.prev)->device, "none")) { ++ && strcmp (((Mount *)mnt->entry.prev)->device, "none") ++ && strcmp (((Mount *)mnt->entry.prev)->type, "swap")) { + NihListEntry *dep; + Mount * prior; + +-- diff -Nru mountall-2.36.4/debian/patches/0004-readonly-and-atime-options-reflected-during-mount.patch mountall-2.36.4/debian/patches/0004-readonly-and-atime-options-reflected-during-mount.patch --- mountall-2.36.4/debian/patches/0004-readonly-and-atime-options-reflected-during-mount.patch 2013-02-03 01:28:02.000000000 +0000 +++ mountall-2.36.4/debian/patches/0004-readonly-and-atime-options-reflected-during-mount.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -From: Matus Kral -Date: Wed, 30 Jan 2013 08:09:00 +0100 -Subject: readonly and atime options reflected during mount - ---- - src/mountall.c | 23 +++++++++++++++++++---- - 1 file changed, 19 insertions(+), 4 deletions(-) - -diff --git a/src/mountall.c b/src/mountall.c -index 5789d7e..e2396f6 100644 ---- a/src/mountall.c -+++ b/src/mountall.c -@@ -762,7 +762,7 @@ parse_zfs_list (void) - size_t bufsz = 4096; - FILE *zfs_stream; - const char zfs_command[] = -- "/sbin/zfs list -H -t filesystem -s mountpoint -o name,mountpoint,canmount"; -+ "/sbin/zfs list -H -t filesystem -s mountpoint -o name,mountpoint,canmount,readonly,atime"; - int zfs_result; - - nih_debug ("parsing ZFS list"); -@@ -781,7 +781,8 @@ parse_zfs_list (void) - /* Read one line from the pipe into the buffer. */ - while (fgets (buf, bufsz, zfs_stream) != NULL) { - char *saveptr; -- char *zfs_name, *zfs_mountpoint, *zfs_canmount; -+ char *zfs_name, *zfs_mountpoint, *zfs_canmount, *zfs_optatime, *zfs_optronly; -+ nih_local char *zfs_mntoptions = NULL; - - /* If the line didn't fit, then enlarge the buffer and retry. */ - while ((! strchr (buf, '\n')) && (! feof (zfs_stream))) { -@@ -804,12 +805,26 @@ parse_zfs_list (void) - } - - /* ASSERT: canmount = on | off | noauto */ -- zfs_canmount = strtok_r (NULL, "\t\n", &saveptr); -+ zfs_canmount = strtok_r (NULL, "\t", &saveptr); - if (! zfs_canmount || strcmp (zfs_canmount, "on")) { - continue; - } - -- new_mount (zfs_mountpoint, zfs_name, FALSE, "zfs", "zfsutil,nobootwait"); -+ NIH_MUST (nih_strcat (&zfs_mntoptions, NULL, "zfsutil")); -+ -+ /* ASSERT: readonly = on | off */ -+ zfs_optronly = strtok_r (NULL, "\t", &saveptr); -+ if ( zfs_optronly && strcmp (zfs_optronly, "off") ) { -+ NIH_MUST (nih_strcat (&zfs_mntoptions, NULL, ",ro")); -+ } -+ -+ /* ASSERT: atime = on | off */ -+ zfs_optatime = strtok_r (NULL, "\t\n", &saveptr); -+ if ( zfs_optatime && strcmp (zfs_optatime, "on") ) { -+ NIH_MUST (nih_strcat (&zfs_mntoptions, NULL, ",noatime")); -+ } -+ -+ new_mount (zfs_mountpoint, zfs_name, FALSE, "zfs", zfs_mntoptions); - } - - zfs_result = pclose (zfs_stream); --- diff -Nru mountall-2.36.4/debian/patches/0005-Handle-duplicate-mountpoints.patch mountall-2.36.4/debian/patches/0005-Handle-duplicate-mountpoints.patch --- mountall-2.36.4/debian/patches/0005-Handle-duplicate-mountpoints.patch 1970-01-01 00:00:00.000000000 +0000 +++ mountall-2.36.4/debian/patches/0005-Handle-duplicate-mountpoints.patch 2013-04-01 02:09:15.000000000 +0000 @@ -0,0 +1,47 @@ +From: Darik Horn +Date: Fri, 27 Mar 2013 22:29:47 -0600 +Subject: Handle duplicate mountpoints. + +When mountall is iterating in try_mounts() on new mount point, change +is_parent() to return false when a record is tested against itself +because a mount point cannot be a root of itself. + +Mountall does not preserve the behavior of `mount -a` if more than +one device shares a mountpoint in the /etc/fstab file. Suppose: + + /var/tmp/alfa /mnt/charlie ext2 loop 0 0 + /var/tmp/bravo /mnt/charlie ext2 loop 0 0 + +Both filesystems are mounted on /mnt/charlie by `mount -a`, but +bravo is ignored by `mountall`. This seems to be an artifact of the fix for +LP ##443035 in zfsonlinux/mountall@eca315d06ae4a2913f9b2ec994c68c45fead912f. + +Furthermore, mountall hangs if such mounts are ZFS datasets or other +virtual filesystems that are not backed by a real device node. + +Closes: zfsonlinux/mountall#5 +--- + +Index: b/src/mountall.c +=================================================================== +--- a/src/mountall.c ++++ b/src/mountall.c +@@ -146,6 +146,7 @@ + }; + + #define MOUNT_NAME(_mnt) (strcmp ((_mnt)->type, "swap") \ ++ && strcmp ((_mnt)->type, "zfs") \ + && strcmp ((_mnt)->mountpoint, "none") \ + ? (_mnt)->mountpoint : (_mnt)->device) + +@@ -1121,9 +1122,7 @@ + + len = strlen (root); + if ((! strncmp (path, root, len)) +- && ((path[len] == '\0') +- || (path[len] == '/') +- || (len && path[len-1] == '/'))) ++ && ((path[len] == '/') || (len && path[len-1] == '/'))) + return TRUE; + + return FALSE; diff -Nru mountall-2.36.4/debian/patches/0005-no-filesystem-should-depend-on-mounting-swap-first.patch mountall-2.36.4/debian/patches/0005-no-filesystem-should-depend-on-mounting-swap-first.patch --- mountall-2.36.4/debian/patches/0005-no-filesystem-should-depend-on-mounting-swap-first.patch 2013-02-03 01:28:02.000000000 +0000 +++ mountall-2.36.4/debian/patches/0005-no-filesystem-should-depend-on-mounting-swap-first.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -From: mk01 -Date: Fri, 1 Feb 2013 02:06:57 +0100 -Subject: no filesystem should depend on mounting swap first - ---- - src/mountall.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/mountall.c b/src/mountall.c -index e2396f6..a23f407 100644 ---- a/src/mountall.c -+++ b/src/mountall.c -@@ -1345,7 +1345,8 @@ mount_policy (void) - && strcmp (mnt->device, "none") - && strcmp (mnt->device, mnt->type) - && (mnt->entry.prev != mounts) -- && strcmp (((Mount *)mnt->entry.prev)->device, "none")) { -+ && strcmp (((Mount *)mnt->entry.prev)->device, "none") -+ && strcmp (((Mount *)mnt->entry.prev)->type, "swap")) { - NihListEntry *dep; - Mount * prior; - --- diff -Nru mountall-2.36.4/debian/patches/series mountall-2.36.4/debian/patches/series --- mountall-2.36.4/debian/patches/series 2013-02-03 01:28:02.000000000 +0000 +++ mountall-2.36.4/debian/patches/series 2013-04-01 02:06:59.000000000 +0000 @@ -1,5 +1,5 @@ 0001-Add-ZFS-support.patch 0002-Disregard-the-mounted-dataset-property.patch -0003-solves-dependencies-problem-endless-loop.patch -0004-readonly-and-atime-options-reflected-during-mount.patch -0005-no-filesystem-should-depend-on-mounting-swap-first.patch +0003-readonly-and-atime-options-reflected-during-mount.patch +0004-no-filesystem-should-depend-on-mounting-swap-first.patch +0005-Handle-duplicate-mountpoints.patch