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
This commit is contained in:
@@ -400,15 +400,42 @@ out:
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ROOT_NFS
|
||||
|
||||
#define NFSROOT_TIMEOUT_MIN 5
|
||||
#define NFSROOT_TIMEOUT_MAX 30
|
||||
#define NFSROOT_RETRY_MAX 5
|
||||
|
||||
static int __init mount_nfs_root(void)
|
||||
{
|
||||
char *root_dev, *root_data;
|
||||
unsigned int timeout;
|
||||
int try, err;
|
||||
|
||||
if (nfs_root_data(&root_dev, &root_data) != 0)
|
||||
err = nfs_root_data(&root_dev, &root_data);
|
||||
if (err != 0)
|
||||
return 0;
|
||||
if (do_mount_root(root_dev, "nfs", root_mountflags, root_data) != 0)
|
||||
return 0;
|
||||
return 1;
|
||||
|
||||
/*
|
||||
* The server or network may not be ready, so try several
|
||||
* times. Stop after a few tries in case the client wants
|
||||
* to fall back to other boot methods.
|
||||
*/
|
||||
timeout = NFSROOT_TIMEOUT_MIN;
|
||||
for (try = 1; ; try++) {
|
||||
err = do_mount_root(root_dev, "nfs",
|
||||
root_mountflags, root_data);
|
||||
if (err == 0)
|
||||
return 1;
|
||||
if (try > NFSROOT_RETRY_MAX)
|
||||
break;
|
||||
|
||||
/* Wait, in case the server refused us immediately */
|
||||
ssleep(timeout);
|
||||
timeout <<= 1;
|
||||
if (timeout > NFSROOT_TIMEOUT_MAX)
|
||||
timeout = NFSROOT_TIMEOUT_MAX;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user