aboutsummaryrefslogtreecommitdiffstats
path: root/init/do_mounts.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 17:57:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 17:57:40 -0500
commit57eccf1c2acae2fcb748730881ba75643fc31c81 (patch)
treebe47ac42ef0b2e3e7157ce196ad2ed1224739c6c /init/do_mounts.c
parent5c395ae7033099fc657114ea997858aa622f08b2 (diff)
parent074b1d12fe2500d7d453902f9266e6674b30d84c (diff)
Merge branch 'nfs-for-3.3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
* 'nfs-for-3.3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: NFSv4: Change the default setting of the nfs4_disable_idmapping parameter NFSv4: Save the owner/group name string when doing open NFS: Remove pNFS bloat from the generic write path pnfs-obj: Must return layout on IO error pnfs-obj: pNFS errors are communicated on iodata->pnfs_error NFS: Cache state owners after files are closed NFS: Clean up nfs4_find_state_owners_locked() NFSv4: include bitmap in nfsv4 get acl data nfs: fix a minor do_div portability issue NFSv4.1: cleanup comment and debug printk NFSv4.1: change nfs4_free_slot parameters for dynamic slots NFSv4.1: cleanup init and reset of session slot tables NFSv4.1: fix backchannel slotid off-by-one bug nfs: fix regression in handling of context= option in NFSv4 NFS - fix recent breakage to NFS error handling. NFS: Retry mounting NFSROOT SUNRPC: Clean up the RPCSEC_GSS service ticket requests
Diffstat (limited to 'init/do_mounts.c')
-rw-r--r--init/do_mounts.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c
index b2eee02e0f83..2974c8b3b351 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -400,15 +400,42 @@ out:
400} 400}
401 401
402#ifdef CONFIG_ROOT_NFS 402#ifdef CONFIG_ROOT_NFS
403
404#define NFSROOT_TIMEOUT_MIN 5
405#define NFSROOT_TIMEOUT_MAX 30
406#define NFSROOT_RETRY_MAX 5
407
403static int __init mount_nfs_root(void) 408static int __init mount_nfs_root(void)
404{ 409{
405 char *root_dev, *root_data; 410 char *root_dev, *root_data;
411 unsigned int timeout;
412 int try, err;
406 413
407 if (nfs_root_data(&root_dev, &root_data) != 0) 414 err = nfs_root_data(&root_dev, &root_data);
408 return 0; 415 if (err != 0)
409 if (do_mount_root(root_dev, "nfs", root_mountflags, root_data) != 0)
410 return 0; 416 return 0;
411 return 1; 417
418 /*
419 * The server or network may not be ready, so try several
420 * times. Stop after a few tries in case the client wants
421 * to fall back to other boot methods.
422 */
423 timeout = NFSROOT_TIMEOUT_MIN;
424 for (try = 1; ; try++) {
425 err = do_mount_root(root_dev, "nfs",
426 root_mountflags, root_data);
427 if (err == 0)
428 return 1;
429 if (try > NFSROOT_RETRY_MAX)
430 break;
431
432 /* Wait, in case the server refused us immediately */
433 ssleep(timeout);
434 timeout <<= 1;
435 if (timeout > NFSROOT_TIMEOUT_MAX)
436 timeout = NFSROOT_TIMEOUT_MAX;
437 }
438 return 0;
412} 439}
413#endif 440#endif
414 441