diff options
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r-- | fs/nfs/client.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 25dde0745cfa..d35664287e14 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -507,6 +507,17 @@ static struct nfs_client *nfs_match_client(const struct nfs_client_initdata *dat | |||
507 | return NULL; | 507 | return NULL; |
508 | } | 508 | } |
509 | 509 | ||
510 | static bool nfs_client_init_is_complete(const struct nfs_client *clp) | ||
511 | { | ||
512 | return clp->cl_cons_state != NFS_CS_INITING; | ||
513 | } | ||
514 | |||
515 | int nfs_wait_client_init_complete(const struct nfs_client *clp) | ||
516 | { | ||
517 | return wait_event_killable(nfs_client_active_wq, | ||
518 | nfs_client_init_is_complete(clp)); | ||
519 | } | ||
520 | |||
510 | /* | 521 | /* |
511 | * Found an existing client. Make sure it's ready before returning. | 522 | * Found an existing client. Make sure it's ready before returning. |
512 | */ | 523 | */ |
@@ -516,8 +527,7 @@ nfs_found_client(const struct nfs_client_initdata *cl_init, | |||
516 | { | 527 | { |
517 | int error; | 528 | int error; |
518 | 529 | ||
519 | error = wait_event_killable(nfs_client_active_wq, | 530 | error = nfs_wait_client_init_complete(clp); |
520 | clp->cl_cons_state < NFS_CS_INITING); | ||
521 | if (error < 0) { | 531 | if (error < 0) { |
522 | nfs_put_client(clp); | 532 | nfs_put_client(clp); |
523 | return ERR_PTR(-ERESTARTSYS); | 533 | return ERR_PTR(-ERESTARTSYS); |
@@ -1333,7 +1343,7 @@ static int nfs4_init_client_minor_version(struct nfs_client *clp) | |||
1333 | * so that the client back channel can find the | 1343 | * so that the client back channel can find the |
1334 | * nfs_client struct | 1344 | * nfs_client struct |
1335 | */ | 1345 | */ |
1336 | clp->cl_cons_state = NFS_CS_SESSION_INITING; | 1346 | nfs_mark_client_ready(clp, NFS_CS_SESSION_INITING); |
1337 | } | 1347 | } |
1338 | #endif /* CONFIG_NFS_V4_1 */ | 1348 | #endif /* CONFIG_NFS_V4_1 */ |
1339 | 1349 | ||