[Top][All Lists]

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

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

From: Paul A. Clarke
Subject: Re: [PATCH] remove "dev=" mount option special processing for df
Date: Wed, 26 Oct 2005 13:27:28 -0500

(I keep forgetting to "Reply to All"...)

On Fri, 2005-10-21 at 17:04, Paul Eggert wrote:
> "Paul A. Clarke" <address@hidden> writes:
> > Why keep around and support obscure (obsolete?) code
> Obscure, yes.  Obsolete, no.  The code is used in some non-Linux
> kernels, and it improves performance greatly in some cases.  [...]

Good info!  Thanks for explaining.

> > 1.  Deprecate and/or remove the support for "dev=" parsing, if not
> > everywhere then at least where it's not supported by the filesystem, or
> > minimally (selfishly) just for Linux.
> OK, you've convinced me for GNU/Linux anyway.

Excellent.  Thanks!

> How about this patch?  I haven't installed it (the code is currently
> frozen) but I'd like you to test it if possible.

It works as I would expect.  Great!

One other thing, which is not a new issue, but while testing this patch,
I discovered a behavior which may warrant attention.  I saw some error
messages displayed that I hadn't seen before.  However, I also saw them
with an unpatched system.  I discovered why, and it's another corner
case, I suppose.  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% /

I tracked the messages down to the following code (displayed as a patch
to remove the error message, for your consideration), and the question
is:  is the case in which the error being emitted really an error?  I'm
doing a "df ." in a filesystem which has nothing to do with the
filesystems which are reporting errors.  Anyway, the patch is below..

Thanks again for your time!

--- df.c.orig   2005-10-25 08:08:38.000000000 -0500
+++ df.c        2005-10-25 08:09:20.000000000 -0500
@@ -609,20 +609,18 @@
   if (! best_match)
     for (me = mount_list; me; me = me->me_next)
        if (me->me_dev == (dev_t) -1)
            if (stat (me->me_mountdir, &disk_stats) == 0)
              me->me_dev = disk_stats.st_dev;
-               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;
        if (statp->st_dev == me->me_dev
            && !STREQ (me->me_type, "lofs")
            && (!best_match || best_match->me_dummy || !me->me_dummy))

reply via email to

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