[linux-cifs-client] [patch] do not attempt to update /etc/mtab if it is symbolic link

Suresh Jayaraman sjayaraman at suse.de
Mon Jul 27 23:25:04 MDT 2009


Jeff Layton wrote:
> On Sun, 26 Jul 2009 15:01:08 -0500
> Shirish Pargaonkar <shirishpargaonkar at gmail.com> wrote:
> 
>> If /etc/mtab is a symbolic link to e.g. /proc/mounts, do not update it.
>>
>> This is a fix for a bug reported in 4675 on samba bugzilla

While trying to lookup whether linking /etc/mtab to /proc/mounts is a
defined/expected behavior, I came across this:

To quote `mount' man page:

"When the proc filesystem is mounted (say at /proc), the files /etc/mtab
and  /proc/mounts  have  very similar contents. The former has somewhat
more information, such as the mount options used, but is not
necessarily  up-to-date  (cf.  the  -n option below). It is possible to
replace /etc/mtab by a symbolic link to /proc/mounts, and especially
when you have  very large numbers of mounts things will be much faster
with that symlink, but some information is lost that way, and in
particular working  with the loop device will be less convenient, and
using the "user" option will fail."

So, wondering whether this has anything to do with the failure reported
on Samba bugzilla 5118 ("user" fstab option vs "user" mount.cifs option)
as the case was "user" option is expected to work (note: both of them
reported on Debian which apparently links fstab to /proc/mounts)

I have not looked at the code, so I might be wrong..

> Looks good to me.
> 
> Acked-by: Jeff Layton <jlayton at redhat.com>

Thanks,

-- 
Suresh Jayaraman



More information about the linux-cifs-client mailing list