* Autofs problem while using new nfs-utils package
@ 2007-10-06 4:49 Michael Rayment
2007-10-08 15:58 ` Chuck Lever
0 siblings, 1 reply; 2+ messages in thread
From: Michael Rayment @ 2007-10-06 4:49 UTC (permalink / raw)
To: nfs
I just emerged the latest gentoo release of the nfs-utils package,
nfs-utils-1.1.0-r1.ebuild. I found that the autofs code did not work for my
diskless computers that have a readonly /etc directory with a /etc/mtab
symbolically linked to /proc/mounts. This was because the creation of the
mtab lock file /etc/mtab~nnnn failed. I noticed that in the update_mtab()
function, a check was put in to acertain whether this situation existed and
silently carried on whereas the add_mtab() function did not perform the check
and consequently failed. My simple minded fix was to add the the same check
to add_mtab() as can be seen in the context diff below. Automounting worked
fine after the fix was applied. Hopefully some fix will make its way into
the authoratative release so that I do not have to patch my code locally.
Thanks,
Michael Rayment
*** utils/mount/mount.c.sav Sat Oct 6 01:52:21 2007
--- utils/mount/mount.c Sat Oct 6 01:55:25 2007
***************
*** 181,188 ****
--- 181,191 ----
update_mtab(ment.mnt_dir, &ment);
return 0;
}
+ if (mtab_does_not_exist() || !mtab_is_writable())
+ return 0;
+
lock_mtab();
if ((mtab = setmntent(MOUNTED, "a+")) == NULL) {
fprintf(stderr, "Can't open " MOUNTED);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Autofs problem while using new nfs-utils package
2007-10-06 4:49 Autofs problem while using new nfs-utils package Michael Rayment
@ 2007-10-08 15:58 ` Chuck Lever
0 siblings, 0 replies; 2+ messages in thread
From: Chuck Lever @ 2007-10-08 15:58 UTC (permalink / raw)
To: Michael Rayment; +Cc: nfs
[-- Attachment #1: Type: text/plain, Size: 1856 bytes --]
Michael Rayment wrote:
> I just emerged the latest gentoo release of the nfs-utils package,
> nfs-utils-1.1.0-r1.ebuild. I found that the autofs code did not work for my
> diskless computers that have a readonly /etc directory with a /etc/mtab
> symbolically linked to /proc/mounts. This was because the creation of the
> mtab lock file /etc/mtab~nnnn failed. I noticed that in the update_mtab()
> function, a check was put in to acertain whether this situation existed and
> silently carried on whereas the add_mtab() function did not perform the check
> and consequently failed. My simple minded fix was to add the the same check
> to add_mtab() as can be seen in the context diff below. Automounting worked
> fine after the fix was applied. Hopefully some fix will make its way into
> the authoratative release so that I do not have to patch my code locally.
At first blush, this seems reasonable to me. I assume you copied this
logic from util-linux's mount command. Does the umount.nfs command also
suffer from this problem? If it does, you should include a hunk to fix
that as well.
To submit a patch for inclusion in nfs-utils, add a patch description
(parts of the above paragraph will work) and a Signed-off-by: line, and
send all of this with your diff in a text e-mail to neilb@suse.de, cc:
nfs@lists.sourceforge.net.
> *** utils/mount/mount.c.sav Sat Oct 6 01:52:21 2007
> --- utils/mount/mount.c Sat Oct 6 01:55:25 2007
> ***************
> *** 181,188 ****
> --- 181,191 ----
> update_mtab(ment.mnt_dir, &ment);
> return 0;
> }
>
> + if (mtab_does_not_exist() || !mtab_is_writable())
> + return 0;
> +
> lock_mtab();
>
> if ((mtab = setmntent(MOUNTED, "a+")) == NULL) {
> fprintf(stderr, "Can't open " MOUNTED);
[-- Attachment #2: chuck.lever.vcf --]
[-- Type: text/x-vcard, Size: 259 bytes --]
begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture: Linux Projects Group
adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA
title:Principal Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
version:2.1
end:vcard
[-- Attachment #3: Type: text/plain, Size: 314 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
[-- Attachment #4: Type: text/plain, Size: 140 bytes --]
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-10-08 17:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-06 4:49 Autofs problem while using new nfs-utils package Michael Rayment
2007-10-08 15:58 ` Chuck Lever
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.