Debian Bug report logs - #839071
zfsutils-linux: Issues based on the fact that ZFS relies on mtab.

version graph

Package: zfsutils-linux; Maintainer for zfsutils-linux is Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@alioth-lists.debian.net>; Source for zfsutils-linux is src:zfs-linux (PTS, buildd, popcon).

Reported by: Eric Desrochers <eric.desrochers@canonical.com>

Date: Wed, 28 Sep 2016 13:42:01 UTC

Severity: normal

Fixed in version 0.7.3-1

Done: Aron Xu <aron@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, eric.desrochers@canonical.com, Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>:
Bug#839071; Package zfsutils-linux. (Wed, 28 Sep 2016 13:42:03 GMT) (full text, mbox, link).


Acknowledgement sent to Eric Desrochers <eric.desrochers@canonical.com>:
New Bug report received and forwarded. Copy sent to eric.desrochers@canonical.com, Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>. (Wed, 28 Sep 2016 13:42:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Eric Desrochers <eric.desrochers@canonical.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: zfsutils-linux: Issues based on the fact that ZFS relies on mtab.
Date: Wed, 28 Sep 2016 09:39:36 -0400
Package: zfsutils-linux
Severity: normal

Dear Maintainer,

ZFS relies on mtab which is a broken concept (putting info about mounted file systems on a mounted file system).
The upstream commit "79251738" addresses the situation by relying on /proc/self/mounts instead. 

Ideally, ZFS should be integrated with libmount in a second phase (ZoL maintainers are aware that eventually a 2nd is needed to integrate libmount), until then /proc/self/mounts is a viable solution to address issues cause by mtab.

Related issues
---
Ubuntu bug      : https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1607920
Upstream bug    : https://github.com/zfsonlinux/zfs/issues/4680

Upstream commit 
---
https://github.com/zfsonlinux/zfs/commit/792517389fad5c495a2738b61c2e9c65dedaaa9a

Eric

-- System Information:
Debian Release: 8.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.2.0-17-generic (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)



Information forwarded to debian-bugs-dist@lists.debian.org, Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>:
Bug#839071; Package zfsutils-linux. (Wed, 28 Sep 2016 13:51:03 GMT) (full text, mbox, link).


Acknowledgement sent to Turbo Fredriksson <turbo@bayour.com>:
Extra info received and forwarded to list. Copy sent to Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>. (Wed, 28 Sep 2016 13:51:03 GMT) (full text, mbox, link).


Message #10 received at 839071@bugs.debian.org (full text, mbox, reply):

From: Turbo Fredriksson <turbo@bayour.com>
To: Eric Desrochers <eric.desrochers@canonical.com>, 839071@bugs.debian.org
Cc: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Re: [Pkg-zfsonlinux-devel] Bug#839071: zfsutils-linux: Issues based on the fact that ZFS relies on mtab.
Date: Wed, 28 Sep 2016 14:48:13 +0100
> ZFS relies on mtab which is a broken concept (putting info about mounted file systems on a mounted file system).
> The upstream commit "79251738" addresses the situation by relying on /proc/self/mounts instead. 

On Debian GNU/Linux almost since the "dawn of time", /etc/mtab is a symlink to /proc/self/mounts so this is less of a problem on Debian GNU/Linux.


Information forwarded to debian-bugs-dist@lists.debian.org, Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>:
Bug#839071; Package zfsutils-linux. (Wed, 28 Sep 2016 14:18:03 GMT) (full text, mbox, link).


Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>. (Wed, 28 Sep 2016 14:18:03 GMT) (full text, mbox, link).


Message #15 received at 839071@bugs.debian.org (full text, mbox, reply):

From: Petter Reinholdtsen <pere@hungry.com>
To: 839071@bugs.debian.org, Eric Desrochers <eric.desrochers@canonical.com>
Subject: Re: Bug#839071: zfsutils-linux: Issues based on the fact that ZFS relies on mtab.
Date: Wed, 28 Sep 2016 16:15:37 +0200
[Turbo Fredriksson]
> On Debian GNU/Linux almost since the "dawn of time", /etc/mtab is a
> symlink to /proc/self/mounts so this is less of a problem on Debian
> GNU/Linux.

Note, the "dawn of time" happened in sysvinit version 2.88dsf-14
released 2011-12-13 to experimental, and version 2.88dsf-16 released
2011-12-17 to unstable.

-- 
Happy hacking
Petter Reinholdtsen



Information forwarded to debian-bugs-dist@lists.debian.org, Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>:
Bug#839071; Package zfsutils-linux. (Wed, 28 Sep 2016 14:18:04 GMT) (full text, mbox, link).


Acknowledgement sent to Eric Desrochers <eric.desrochers@canonical.com>:
Extra info received and forwarded to list. Copy sent to Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>. (Wed, 28 Sep 2016 14:18:04 GMT) (full text, mbox, link).


Message #20 received at 839071@bugs.debian.org (full text, mbox, reply):

From: Eric Desrochers <eric.desrochers@canonical.com>
To: 839071@bugs.debian.org
Subject: Patch for bug #839071
Date: Wed, 28 Sep 2016 10:15:45 -0400
[Message part 1 (text/plain, inline)]

[0001-Change-etc-mtab-to-proc-self-mounts.patch (text/x-patch, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>:
Bug#839071; Package zfsutils-linux. (Thu, 29 Sep 2016 08:21:03 GMT) (full text, mbox, link).


Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>. (Thu, 29 Sep 2016 08:21:03 GMT) (full text, mbox, link).


Message #25 received at 839071@bugs.debian.org (full text, mbox, reply):

From: Petter Reinholdtsen <pere@hungry.com>
To: Eric Desrochers <eric.desrochers@canonical.com>, 839071@bugs.debian.org
Subject: Re: [Pkg-zfsonlinux-devel] Bug#839071: Patch for bug #839071
Date: Thu, 29 Sep 2016 10:17:00 +0200
Hi.

I got a quick question.  The patch seem to set MNTTAB to
"/proc/self/mounts", but include changes like this:

[Eric Desrochers]
> --- a/cmd/mount_zfs/mount_zfs.c
> +++ b/cmd/mount_zfs/mount_zfs.c
> @@ -292,11 +292,11 @@ mtab_is_writeable(void)
>  	struct stat st;
>  	int error, fd;
>  
> -	error = lstat(MNTTAB, &st);
> +	error = lstat("/etc/mtab", &st);
>  	if (error || S_ISLNK(st.st_mode))
>  		return (0);
>  
> -	fd = open(MNTTAB, O_RDWR | O_CREAT, 0644);
> +	fd = open("/etc/mtab", O_RDWR | O_CREAT, 0644);
>  	if (fd < 0)
>  		return (0);
>  
> @@ -318,21 +318,21 @@ mtab_update(char *dataset, char *mntpoint, char *type, char *mntopts)
>  	mnt.mnt_freq = 0;
>  	mnt.mnt_passno = 0;
>  
> -	fp = setmntent(MNTTAB, "a+");
> +	fp = setmntent("/etc/mtab", "a+");
>  	if (!fp) {
>  		(void) fprintf(stderr, gettext(
> -		    "filesystem '%s' was mounted, but %s "
> +		    "filesystem '%s' was mounted, but /etc/mtab "
>  		    "could not be opened due to error %d\n"),
> -		    dataset, MNTTAB, errno);
> +		    dataset, errno);
>  		return (MOUNT_FILEIO);
>  	}
>  
>  	error = addmntent(fp, &mnt);
>  	if (error) {
>  		(void) fprintf(stderr, gettext(
> -		    "filesystem '%s' was mounted, but %s "
> +		    "filesystem '%s' was mounted, but /etc/mtab "
>  		    "could not be updated due to error %d\n"),
> -		    dataset, MNTTAB, errno);
> +		    dataset, errno);
>  		return (MOUNT_FILEIO);
>  	}
>  

Why do you hardcode /etc/mtab here?  I fail to understand how your patch
is intended to work, and hope you can reduce my confusion.

-- 
Happy hacking
Petter Reinholdtsen



Information forwarded to debian-bugs-dist@lists.debian.org, Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>:
Bug#839071; Package zfsutils-linux. (Thu, 29 Sep 2016 08:33:02 GMT) (full text, mbox, link).


Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>. (Thu, 29 Sep 2016 08:33:02 GMT) (full text, mbox, link).


Message #30 received at 839071@bugs.debian.org (full text, mbox, reply):

From: Petter Reinholdtsen <pere@hungry.com>
To: Richard Laager <rlaager@wiktel.com>, 839071@bugs.debian.org, Eric Desrochers <eric.desrochers@canonical.com>
Subject: Re: Bug#839071: Bug#839071: Patch for bug #839071
Date: Thu, 29 Sep 2016 10:28:44 +0200
[Richard Laager]
> The *writing* is hard-coded to /etc/mtab, but if it doesn't exist,
> that's fine. ZFS just won't update /etc/mtab.

Right.  Perhaps better to use two defines, one MNTTAB_READ and one
MNTTAB_WRITE to make this more clear, instead of introducing the
/etc/mtab hardcoding?

-- 
Happy hacking
Petter Reinholdtsen



Information forwarded to debian-bugs-dist@lists.debian.org, Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>:
Bug#839071; Package zfsutils-linux. (Thu, 29 Sep 2016 08:33:04 GMT) (full text, mbox, link).


Acknowledgement sent to Richard Laager <rlaager@wiktel.com>:
Extra info received and forwarded to list. Copy sent to Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>. (Thu, 29 Sep 2016 08:33:04 GMT) (full text, mbox, link).


Message #35 received at 839071@bugs.debian.org (full text, mbox, reply):

From: Richard Laager <rlaager@wiktel.com>
To: Petter Reinholdtsen <pere@hungry.com>, 839071@bugs.debian.org, Eric Desrochers <eric.desrochers@canonical.com>
Subject: Re: [Pkg-zfsonlinux-devel] Bug#839071: Bug#839071: Patch for bug #839071
Date: Thu, 29 Sep 2016 03:24:53 -0500
On 09/29/2016 03:17 AM, Petter Reinholdtsen wrote:
> Why do you hardcode /etc/mtab here?  I fail to understand how your patch
> is intended to work, and hope you can reduce my confusion.

All *reading* is hard-coded to /proc/self/mounts. This removes the
dependency on /etc/mtab.

Ubuntu is specifically concerned about a race on first boot of cloud
images where the /etc/mtab -> /proc/self/mounts has not been created in
time.

The *writing* is hard-coded to /etc/mtab, but if it doesn't exist,
that's fine. ZFS just won't update /etc/mtab.

-- 
Richard



Information forwarded to debian-bugs-dist@lists.debian.org, Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>:
Bug#839071; Package zfsutils-linux. (Thu, 29 Sep 2016 08:39:03 GMT) (full text, mbox, link).


Acknowledgement sent to Richard Laager <rlaager@wiktel.com>:
Extra info received and forwarded to list. Copy sent to Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>. (Thu, 29 Sep 2016 08:39:03 GMT) (full text, mbox, link).


Message #40 received at 839071@bugs.debian.org (full text, mbox, reply):

From: Richard Laager <rlaager@wiktel.com>
To: Petter Reinholdtsen <pere@hungry.com>, 839071@bugs.debian.org, Eric Desrochers <eric.desrochers@canonical.com>
Subject: Re: Bug#839071: Bug#839071: Patch for bug #839071
Date: Thu, 29 Sep 2016 03:34:32 -0500
On 09/29/2016 03:28 AM, Petter Reinholdtsen wrote:
> [Richard Laager]
>> The *writing* is hard-coded to /etc/mtab, but if it doesn't exist,
>> that's fine. ZFS just won't update /etc/mtab.
> 
> Right.  Perhaps better to use two defines, one MNTTAB_READ and one
> MNTTAB_WRITE to make this more clear, instead of introducing the
> /etc/mtab hardcoding?

Maybe. I had originally hoped to simply remove all the writing, but it
seems that some distros still need that. The current hope is to replace
the writing (and maybe reading) with libmount, but that's a bigger patch.

Strictly speaking, I'm not sure it was necessary in the final patch to
replace MNTTAB with hard-coded /etc/mtab, but I'd have to look at the
whole thing again to be sure.

-- 
Richard



Information forwarded to debian-bugs-dist@lists.debian.org, Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>:
Bug#839071; Package zfsutils-linux. (Wed, 06 Dec 2017 03:09:03 GMT) (full text, mbox, link).


Acknowledgement sent to Antonio Russo <antonio.e.russo@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>. (Wed, 06 Dec 2017 03:09:03 GMT) (full text, mbox, link).


Message #45 received at 839071@bugs.debian.org (full text, mbox, reply):

From: Antonio Russo <antonio.e.russo@gmail.com>
To: 839071@bugs.debian.org
Subject: Patch
Date: Tue, 5 Dec 2017 22:06:20 -0500
The proposed patch has been included upstream, and should be reflected in the current package.

Because mtab has "always" been linked to /proc/self/mounts, I'm not sure if
this report was "theoretical" or represented an observed problem that may
have a different root cause.

Could you please clarify if upstream's response is adequate?



Reply sent to Aron Xu <aron@debian.org>:
You have taken responsibility. (Mon, 05 Mar 2018 08:48:03 GMT) (full text, mbox, link).


Notification sent to Eric Desrochers <eric.desrochers@canonical.com>:
Bug acknowledged by developer. (Mon, 05 Mar 2018 08:48:03 GMT) (full text, mbox, link).


Message #50 received at 839071-done@bugs.debian.org (full text, mbox, reply):

From: Aron Xu <aron@debian.org>
To: 839071-done@bugs.debian.org
Subject: Re: Bug #839071: zfsutils-linux: Issues based on the fact that ZFS relies on mtab.
Date: Mon, 5 Mar 2018 16:45:05 +0800
Source-Version: 0.7.3-1

This issue was addressed in upstream 0.7.0-rc2 release, closing now.

Regards,
Aron



Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 03 Apr 2018 07:30:30 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Aug 8 03:40:49 2024; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.