bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] remove "dev=" mount option special processing for df


From: Paul Eggert
Subject: Re: [PATCH] remove "dev=" mount option special processing for df
Date: Sun, 30 Oct 2005 17:41:33 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

"Paul A. Clarke" <address@hidden> writes:

> I have some regular mounts and some automounts configured under
> /mnt, yet I just happened to temporarily (or so I thought) mount a
> partition at /mnt, effectively hiding the rest of the original /mnt
> directory tree.  However, the mount information is still in
> /etc/fstab, /etc/mtab, and /proc/mounts.  Anyway, here's what I saw:
>
> $ df .
> Filesystem           1K-blocks      Used Available Use% Mounted on
> df: `/mnt/win/c': No such file or directory
> df: `/mnt/cdrom': No such file or directory
> df: `/mnt/memory-stick': No such file or directory
> df: `/mnt/microdrive': No such file or directory
> /dev/hda7             19592804   8381160  10216372  46% /

Thanks for reporting that.  I'm more inclined to install the following
patch, at least after the feature freeze is over.

2005-10-30  Paul Eggert  <address@hidden>

        * src/df.c (show_point): Don't report stat errors other than EIO,
        since they could be due to shadowed mounts.

--- df.c.~1.169~        2005-10-21 13:34:15.000000000 -0700
+++ df.c        2005-10-30 17:39:00.000000000 -0800
@@ -615,8 +615,15 @@ show_point (const char *point, const str
              me->me_dev = disk_stats.st_dev;
            else
              {
-               error (0, errno, "%s", quote (me->me_mountdir));
-               exit_status = EXIT_FAILURE;
+               /* Report only I/O errors.  Other errors might be
+                  caused by shadowed mount points, which means POINT
+                  can't possibly be on this file system.  */
+               if (errno == EIO)
+                 {
+                   error (0, errno, "%s", quote (me->me_mountdir));
+                   exit_status = EXIT_FAILURE;
+                 }
+
                /* So we won't try and fail repeatedly. */
                me->me_dev = (dev_t) -2;
              }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]