FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

LinkBack Thread Tools
Old 10-10-2012, 09:31 PM
Wolfram Gloger
Default Bug#690181: Backgrounding mount broken with NFS versions <4

Package: nfs-common
Version: 1:1.2.2-4squeeze2
Tags: patch

Assume the following:

An NFS server supports only NFS version <4.
This server is unreachable at a certain time.
A Debian client boots and tries to mount a directory on the server with
the 'bg' option, but without the 'nfsvers' option.
Later, the NFS server comes up.

Result: The client does _not_ mount the directory and the background
mount is silently terminated. This typically breaks cross-mounted
server scenarios.

[Note that specifying 'nfsvers=3' is NOT a workaround, because then
failing to connect the portmapper already terminates the mount.nfs
process and no backgrounding happens at all. This is a separate
bug IMHO.]

Analysis: When first trying an NFSv4 mount, 'vers=4' is appended
to the extra_options string in the mount options. Then, the next
(background) attempt also happens with vers=4 and consequently,
nfs_try_mount_v3v2() is never called. The mount fails, even though
the V3 server would now be reachable.

Fix appended. It looks like this bug is also present in current
Debian nfs-utils git.


--- nfs-utils-1.2.2/utils/mount/stropts.c 2012-10-10 23:12:14.000000000 +0200
+++ nfs-utils-1.2.2wg/utils/mount/stropts.c 2012-10-10 23:12:26.000000000 +0200
@@ -659,6 +659,7 @@
struct mount_options *options = po_dup(mi->options);
int result = 0;
+ char *extra_opts = NULL;

if (!options) {
errno = ENOMEM;
@@ -694,20 +695,26 @@
goto out_fail;

- /*
- * Update option string to be recorded in /etc/mtab.
- */
- if (po_join(options, mi->extra_opts) == PO_FAILED) {
+ if (po_join(options, &extra_opts) == PO_FAILED) {
errno = ENOMEM;
goto out_fail;

if (verbose)
printf(_("%s: trying text-based options '%s'
- progname, *mi->extra_opts);
+ progname, extra_opts);

result = nfs_sys_mount(mi, options);

+ /*
+ * If success, update option string to be recorded in /etc/mtab.
+ */
+ if (result) {
+ free(*mi->extra_opts);
+ *mi->extra_opts = extra_opts;
+ } else
+ free(extra_opts);
return result;

To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: u4bogahv55.fsf@mail.malloc.de">http://lists.debian.org/u4bogahv55.fsf@mail.malloc.de

Thread Tools

All times are GMT. The time now is 02:37 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org