GNU bug report logs -
#12730
coreutils-8.20: FAIL: tests/du/bind-mount-dir-cycle.sh
Previous Next
Reported by: g.esp <at> free.fr
Date: Thu, 25 Oct 2012 08:46:01 UTC
Severity: normal
Tags: fixed
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #50 received at 12730 <at> debbugs.gnu.org (full text, mbox):
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mon, 05 Nov 2012 02:01:53 +0100
Jim Meyering <jim <at> meyering.net> wrote:
> Thanks for the patch.
> However, I'd rather not duplicate all of that logic solely
> to change the part that deals with type-"none" entries.
> Instead, I'll leave the other 5 types in a separate, new macro,
> and use that from the new ME_DUMMY macro.
>
> I've also removed the outer "#ifndef ME_DUMMY" and added
> a comment and a ChangeLog entry for you. But now,
> you have to proofread that and ACK before I push it.
>
> I've tested only on a system with MOUNTED_GETMNTENT1.
>
> Finally, it's small enough that you don't have to fill
> out copyright paperwork (hence the "tiny change"
> and Copyright-paperwork-exempt notes), but if you think
> you may contribute something else, please start the process now,
> so the lack of an assignment does not delay things.
> Let me know off-list and I'll send you the forms.
>
>
> From 613bcb6205cf2b64d835c19074c5a7e7c6cb99eb Mon Sep 17 00:00:00 2001
> From: Andrew Warshall <warshall <at> 99main.com>
> Date: Sun, 4 Nov 2012 16:41:15 -0800
> Subject: [PATCH] mountlist: do not classify a bind-mounted dir entry
> as "dummy"
>
> * lib/mountlist.c (ME_DUMMY_0): Rename from ME_DUMMY, but omit
> the "none"-testing clause.
> (ME_DUMMY) [MOUNTED_GETMNTENT1]: New macro to encapsulate the
> exception for bind-mounted directories.
> Copyright-paperwork-exempt: Yes
> ---
> ChangeLog | 8 ++++++++
> lib/mountlist.c | 31 +++++++++++++++++++++----------
> 2 files changed, 29 insertions(+), 10 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 720b7a2..2173fb2 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,11 @@
> +2012-11-04 Andrew Warshall <warshall <at> 99main.com> (tiny change)
> +
> + mountlist: do not classify a bind-mounted dir entry as
> "dummy"
> + * lib/mountlist.c (ME_DUMMY_0): Rename from ME_DUMMY, but
> omit
> + the "none"-testing clause.
> + (ME_DUMMY) [MOUNTED_GETMNTENT1]: New macro to encapsulate the
> + exception for bind-mounted directories.
> +
> 2012-11-01 Akim Demaille <akim <at> lrde.epita.fr>
>
> quote: provide a means to escape strings with nul characters
> diff --git a/lib/mountlist.c b/lib/mountlist.c
> index 67154b8..a9a9f2c 100644
> --- a/lib/mountlist.c
> +++ b/lib/mountlist.c
> @@ -149,16 +149,27 @@
> #undef opendir
> #undef closedir
>
> -#ifndef ME_DUMMY
> -# define ME_DUMMY(Fs_name, Fs_type) \
> - (strcmp (Fs_type, "autofs") == 0 \
> - || strcmp (Fs_type, "none") == 0 \
> - || strcmp (Fs_type, "proc") == 0 \
> - || strcmp (Fs_type, "subfs") == 0 \
> - /* for NetBSD 3.0 */ \
> - || strcmp (Fs_type, "kernfs") == 0 \
> - /* for Irix 6.5 */ \
> - || strcmp (Fs_type, "ignore") == 0)
> +#define ME_DUMMY_0(Fs_name, Fs_type) \
> + (strcmp (Fs_type, "autofs") == 0 \
> + || strcmp (Fs_type, "proc") == 0 \
> + || strcmp (Fs_type, "subfs") == 0 \
> + /* for NetBSD 3.0 */ \
> + || strcmp (Fs_type, "kernfs") == 0 \
> + /* for Irix 6.5 */ \
> + || strcmp (Fs_type, "ignore") == 0)
> +
> +/* Historically, we have marked as "dummy" any file system of type
> "none",
> + but now that programs like du need to know about bind-mounted
> directories,
> + we grant an exception to any with "bind" in its list of mount
> options.
> + I.e., those are *not* dummy entries. */
> +#ifdef MOUNTED_GETMNTENT1
> +# define ME_DUMMY(Fs_name, Fs_type, Fs_ent) \
> + (ME_DUMMY_0 (Fs_name, Fs_type) \
> + || (strcmp (Fs_type, "none") == 0 \
> + && !hasmntopt (Fs_ent, "bind")))
> +#else
> +# define ME_DUMMY(Fs_name, Fs_type) \
> + (ME_DUMMY_0 (Fs_name, Fs_type) || strcmp (Fs_type, "none") == 0)
> #endif
>
> #ifdef __CYGWIN__
> --
> 1.8.0
>
This looks fine. It should (I hope) have no effect on a system w/o
MOUNTED_GETMNTENT1; I was more concerned about the effect on anyone
with MOUNTED_GETMNTENT1 but without hasmntopt (i.e. a non-glibc
environment with the same getmntent semantics).
-Andrew Warshall
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQEcBAEBAgAGBQJQlwg5AAoJEESPRWh79T7t4esH/3S1pACjASPJOQ656dqZQH6/
yviN1/KwSRisseyKKX1XjXgDyXnopUTDkd5irRqPFZYxjaj5xagldp4c3f0WhhFY
Kj2Ms5C1h9m4NrTodgCUW8EtfiCkBfdgj372htJHMepN0cQML5WOL+5L94VGLkWx
7EZjiXVZBYpOSjqBA8TNXogMBRurfEuOBp4nWwFgYRgfWQ1eIQS+tzbCjgigLq9a
/Kzu6i2x86ex5Bxcr421J0Lyp86T4CV7J5i3i2NcjvAgUImDLfLJRrbQFDsNhYnE
Tw9kOcTXt84AIIQSQJvB6PBZT8uTPeM8lImtDmxIw9GJNYyhd6zkPQLG6EWJrJU=
=KVEP
-----END PGP SIGNATURE-----
This bug report was last modified 6 years and 223 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.