All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Steinar H. Gunderson" <sgunderson@bigfoot.com>
To: autofs@linux.kernel.org
Cc: daniel@vision.ime.usp.br, 304245@bugs.debian.org
Subject: [daniel@vision.ime.usp.br: Bug#304245: patch - NFS mounts occasionally fail]
Date: Sun, 17 Apr 2005 17:42:40 +0200	[thread overview]
Message-ID: <20050417154240.GA17232@uio.no> (raw)

[-- Attachment #1: Type: text/plain, Size: 111 bytes --]

Hi,

Thanks for the patch; sending upstream for evaluation.

/* Steinar */
-- 
Homepage: http://www.sesse.net/

[-- Attachment #2: Type: message/rfc822, Size: 5749 bytes --]

From: Daniel Andre Vaquero <daniel@vision.ime.usp.br>
To: 304245@bugs.debian.org
Subject: Bug#304245: patch - NFS mounts occasionally fail
Date: Sat, 16 Apr 2005 23:38:26 -0300
Message-ID: <20050417023826.GA4527@vision.ime.usp.br>

Hi,

After some days of testing with upstream version 4.1.4, I noticed that it
is also broken (although mount failures occur less frequently). My scenario
consists of a single server, with no replicated mounts. Debugging the code,
I found that the problem happens in the function get_best_mount()
of mount_nfs.c. If the server don't respond to rpc_ping() within 0.1 seconds,
winner remains NULL and the function is not called again with the longer
timeout (10 sec), leading to a mount failure because no winner is elected.
Another thing I noticed is that the behavior when there are replicated hosts
is not the described in README.replicated-server. If all pings fail, winner
should be set to the first host in the list, but the current code will return
winner = NULL.

I have made a patch that should solve these problems, and included it below
(maybe this fixes the problem of #297359 too).
It must be applied over upstream version 4.1.4. I'll be testing it for the 
single server scenario in the next few days.

$ diff -upr autofs-4.1.4.orig/modules/mount_nfs.c autofs-4.1.4/modules/mount_nfs.c

--- autofs-4.1.4.orig/modules/mount_nfs.c 2005-04-05 09:42:42.000000000 -0300
+++ autofs-4.1.4/modules/mount_nfs.c   2005-04-16 22:59:05.000000000 -0300
@@ -251,33 +251,28 @@ int get_best_mount(char *what, const cha
 
   debug(MODPREFIX "winner = %s local = %d", winner, local);
 
-  /*
-   * We didn't find a weighted winner or local
-   */
-  if (!local && winner_weight == INT_MAX) {
-     /* We had more than one contender and none responded in time */
-     if (winner_time != 0 && winner_time > 500) {
-        /* We've already tried a longer timeout */
-        if (!longtimeout) {
-           /* Reset string and try again */
-           strcpy(what, original);
-
-           debug(MODPREFIX 
-                 "all hosts timed out for '%s', "
-                 "retrying with longer timeout",
-                 original);
-
-           return get_best_mount(what, original, 1, 1);
-        }
+  /* No winner found */
+  if (!local && !winner) {
+     
+     /* Retry with a longer timeout */
+     if (!longtimeout) {
+        /* Reset string and try again */
+        strcpy(what, original);
+      
+        debug(MODPREFIX 
+              "all hosts timed out for '%s', "
+              "retrying with longer timeout",
+              original);
+        
+        return get_best_mount(what, original, 1, 1);
+     }
+     else {
+        /* No hosts responded, winner = first host */
+        winner = what;
      }
+     
   }
-
-  /* No winner found so bail */
-  if (!winner) {
-     *what = '\0';
-     return 0;
-  }
-
+  
   /*
    * We now have our winner, copy it to the front of the string,
    * followed by the next :string<delim>



[-- Attachment #3: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

             reply	other threads:[~2005-04-17 15:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-17 15:42 Steinar H. Gunderson [this message]
2005-04-17 18:18 ` [daniel@vision.ime.usp.br: Bug#304245: patch - NFS mounts occasionally fail] Daniel Andre Vaquero
2005-04-18 13:42   ` raven
2005-04-18 19:46     ` Chris Feist
2005-04-24  9:01       ` raven
2005-04-24  9:32         ` raven
2005-04-24 12:04           ` raven
2005-04-24 16:18           ` Bug#304245: patch - NFS mounts occasionally fail Daniel Andre Vaquero
2005-04-24 18:10             ` raven
2005-04-25  0:22               ` Daniel Andre Vaquero
2005-04-25  1:27                 ` raven
2005-04-25  4:12                   ` raven
2005-04-25 14:03                     ` Daniel Andre Vaquero
2005-04-18 19:44 ` [daniel@vision.ime.usp.br: Bug#304245: patch - NFS mounts occasionally fail] Chris Feist
2005-04-19 17:00 ` raven
2005-04-19 21:06   ` Bug#304245: patch - NFS mounts occasionally fail Daniel Andre Vaquero
2005-04-20  1:02     ` Ian Kent
2005-04-20  1:32       ` Daniel Andre Vaquero
2005-04-20 11:27         ` raven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050417154240.GA17232@uio.no \
    --to=sgunderson@bigfoot.com \
    --cc=304245@bugs.debian.org \
    --cc=autofs@linux.kernel.org \
    --cc=daniel@vision.ime.usp.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.