summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0022-NFS-Retry-mounting-NFSROOT.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2012-02-10 15:32:32 +0100
committerDenys Dmytriyenko <denys@ti.com>2012-02-27 09:04:13 -0500
commitc4eefd753012467261cf221babd2e8639b81d3ca (patch)
tree0f6e09a6b51f410455330f046a8e03787d5a126e /recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0022-NFS-Retry-mounting-NFSROOT.patch
parent14f31c3c5a19dde049355ced3edd121c31842460 (diff)
downloadmeta-ti-c4eefd753012467261cf221babd2e8639b81d3ca.tar.gz
linux-ti33x-psp 3.2: update to 3.2.5
Runtime tested on a beaglebone A3 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0022-NFS-Retry-mounting-NFSROOT.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0022-NFS-Retry-mounting-NFSROOT.patch94
1 files changed, 94 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0022-NFS-Retry-mounting-NFSROOT.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0022-NFS-Retry-mounting-NFSROOT.patch
new file mode 100644
index 00000000..8c4acc62
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0022-NFS-Retry-mounting-NFSROOT.patch
@@ -0,0 +1,94 @@
1From 1ef216baa398a27c95a9de67f36805cbeea81fe6 Mon Sep 17 00:00:00 2001
2From: Chuck Lever <chuck.lever@oracle.com>
3Date: Mon, 5 Dec 2011 15:40:30 -0500
4Subject: [PATCH 022/130] NFS: Retry mounting NFSROOT
5
6commit 43717c7daebf10b43f12e68512484b3095bb1ba5 upstream.
7
8Lukas Razik <linux@razik.name> reports that on his SPARC system,
9booting with an NFS root file system stopped working after commit
1056463e50 "NFS: Use super.c for NFSROOT mount option parsing."
11
12We found that the network switch to which Lukas' client was attached
13was delaying access to the LAN after the client's NIC driver reported
14that its link was up. The delay was longer than the timeouts used in
15the NFS client during mounting.
16
17NFSROOT worked for Lukas before commit 56463e50 because in those
18kernels, the client's first operation was an rpcbind request to
19determine which port the NFS server was listening on. When that
20request failed after a long timeout, the client simply selected the
21default NFS port (2049). By that time the switch was allowing access
22to the LAN, and the mount succeeded.
23
24Neither of these client behaviors is desirable, so reverting 56463e50
25is really not a choice. Instead, introduce a mechanism that retries
26the NFSROOT mount request several times. This is the same tactic that
27normal user space NFS mounts employ to overcome server and network
28delays.
29
30Signed-off-by: Lukas Razik <linux@razik.name>
31[ cel: match kernel coding style, add proper patch description ]
32[ cel: add exponential back-off ]
33Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
34Tested-by: Lukas Razik <linux@razik.name>
35Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
36Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
37---
38 init/do_mounts.c | 35 +++++++++++++++++++++++++++++++----
39 1 files changed, 31 insertions(+), 4 deletions(-)
40
41diff --git a/init/do_mounts.c b/init/do_mounts.c
42index 0f6e1d9..db6e5ee 100644
43--- a/init/do_mounts.c
44+++ b/init/do_mounts.c
45@@ -398,15 +398,42 @@ out:
46 }
47
48 #ifdef CONFIG_ROOT_NFS
49+
50+#define NFSROOT_TIMEOUT_MIN 5
51+#define NFSROOT_TIMEOUT_MAX 30
52+#define NFSROOT_RETRY_MAX 5
53+
54 static int __init mount_nfs_root(void)
55 {
56 char *root_dev, *root_data;
57+ unsigned int timeout;
58+ int try, err;
59
60- if (nfs_root_data(&root_dev, &root_data) != 0)
61- return 0;
62- if (do_mount_root(root_dev, "nfs", root_mountflags, root_data) != 0)
63+ err = nfs_root_data(&root_dev, &root_data);
64+ if (err != 0)
65 return 0;
66- return 1;
67+
68+ /*
69+ * The server or network may not be ready, so try several
70+ * times. Stop after a few tries in case the client wants
71+ * to fall back to other boot methods.
72+ */
73+ timeout = NFSROOT_TIMEOUT_MIN;
74+ for (try = 1; ; try++) {
75+ err = do_mount_root(root_dev, "nfs",
76+ root_mountflags, root_data);
77+ if (err == 0)
78+ return 1;
79+ if (try > NFSROOT_RETRY_MAX)
80+ break;
81+
82+ /* Wait, in case the server refused us immediately */
83+ ssleep(timeout);
84+ timeout <<= 1;
85+ if (timeout > NFSROOT_TIMEOUT_MAX)
86+ timeout = NFSROOT_TIMEOUT_MAX;
87+ }
88+ return 0;
89 }
90 #endif
91
92--
931.7.7.4
94