aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4client.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 6ee9bf69a7a6..b1024bcc65c8 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -453,6 +453,14 @@ static void nfs4_swap_callback_idents(struct nfs_client *keep,
453 spin_unlock(&nn->nfs_client_lock); 453 spin_unlock(&nn->nfs_client_lock);
454} 454}
455 455
456static bool nfs4_match_client_owner_id(const struct nfs_client *clp1,
457 const struct nfs_client *clp2)
458{
459 if (clp1->cl_owner_id == NULL || clp2->cl_owner_id == NULL)
460 return true;
461 return strcmp(clp1->cl_owner_id, clp2->cl_owner_id) == 0;
462}
463
456/** 464/**
457 * nfs40_walk_client_list - Find server that recognizes a client ID 465 * nfs40_walk_client_list - Find server that recognizes a client ID
458 * 466 *
@@ -511,6 +519,9 @@ int nfs40_walk_client_list(struct nfs_client *new,
511 if (pos->cl_clientid != new->cl_clientid) 519 if (pos->cl_clientid != new->cl_clientid)
512 continue; 520 continue;
513 521
522 if (!nfs4_match_client_owner_id(pos, new))
523 continue;
524
514 atomic_inc(&pos->cl_count); 525 atomic_inc(&pos->cl_count);
515 spin_unlock(&nn->nfs_client_lock); 526 spin_unlock(&nn->nfs_client_lock);
516 527
@@ -657,6 +668,13 @@ int nfs41_walk_client_list(struct nfs_client *new,
657 if (!nfs4_check_clientid_trunking(pos, new)) 668 if (!nfs4_check_clientid_trunking(pos, new))
658 continue; 669 continue;
659 670
671 /* Unlike NFSv4.0, we know that NFSv4.1 always uses the
672 * uniform string, however someone might switch the
673 * uniquifier string on us.
674 */
675 if (!nfs4_match_client_owner_id(pos, new))
676 continue;
677
660 atomic_inc(&pos->cl_count); 678 atomic_inc(&pos->cl_count);
661 *result = pos; 679 *result = pos;
662 status = 0; 680 status = 0;