diff options
Diffstat (limited to 'fs/nfs/idmap.c')
-rw-r--r-- | fs/nfs/idmap.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c index a850079467d8..79f6424aa081 100644 --- a/fs/nfs/idmap.c +++ b/fs/nfs/idmap.c | |||
@@ -465,8 +465,6 @@ nfs_idmap_new(struct nfs_client *clp) | |||
465 | struct rpc_pipe *pipe; | 465 | struct rpc_pipe *pipe; |
466 | int error; | 466 | int error; |
467 | 467 | ||
468 | BUG_ON(clp->cl_idmap != NULL); | ||
469 | |||
470 | idmap = kzalloc(sizeof(*idmap), GFP_KERNEL); | 468 | idmap = kzalloc(sizeof(*idmap), GFP_KERNEL); |
471 | if (idmap == NULL) | 469 | if (idmap == NULL) |
472 | return -ENOMEM; | 470 | return -ENOMEM; |
@@ -510,7 +508,6 @@ static int __rpc_pipefs_event(struct nfs_client *clp, unsigned long event, | |||
510 | 508 | ||
511 | switch (event) { | 509 | switch (event) { |
512 | case RPC_PIPEFS_MOUNT: | 510 | case RPC_PIPEFS_MOUNT: |
513 | BUG_ON(clp->cl_rpcclient->cl_dentry == NULL); | ||
514 | err = __nfs_idmap_register(clp->cl_rpcclient->cl_dentry, | 511 | err = __nfs_idmap_register(clp->cl_rpcclient->cl_dentry, |
515 | clp->cl_idmap, | 512 | clp->cl_idmap, |
516 | clp->cl_idmap->idmap_pipe); | 513 | clp->cl_idmap->idmap_pipe); |
@@ -689,7 +686,11 @@ static int nfs_idmap_legacy_upcall(struct key_construction *cons, | |||
689 | if (ret < 0) | 686 | if (ret < 0) |
690 | goto out2; | 687 | goto out2; |
691 | 688 | ||
692 | BUG_ON(idmap->idmap_key_cons != NULL); | 689 | if (idmap->idmap_key_cons != NULL) { |
690 | WARN_ON_ONCE(1); | ||
691 | ret = -EAGAIN; | ||
692 | goto out2; | ||
693 | } | ||
693 | idmap->idmap_key_cons = cons; | 694 | idmap->idmap_key_cons = cons; |
694 | 695 | ||
695 | ret = rpc_queue_upcall(idmap->idmap_pipe, msg); | 696 | ret = rpc_queue_upcall(idmap->idmap_pipe, msg); |
@@ -746,7 +747,7 @@ idmap_pipe_downcall(struct file *filp, const char __user *src, size_t mlen) | |||
746 | * will have been woken up and someone else may now have used | 747 | * will have been woken up and someone else may now have used |
747 | * idmap_key_cons - so after this point we may no longer touch it. | 748 | * idmap_key_cons - so after this point we may no longer touch it. |
748 | */ | 749 | */ |
749 | cons = ACCESS_ONCE(idmap->idmap_key_cons); | 750 | cons = idmap->idmap_key_cons; |
750 | idmap->idmap_key_cons = NULL; | 751 | idmap->idmap_key_cons = NULL; |
751 | 752 | ||
752 | if (mlen != sizeof(im)) { | 753 | if (mlen != sizeof(im)) { |
@@ -790,7 +791,7 @@ idmap_pipe_destroy_msg(struct rpc_pipe_msg *msg) | |||
790 | struct idmap *idmap = data->idmap; | 791 | struct idmap *idmap = data->idmap; |
791 | struct key_construction *cons; | 792 | struct key_construction *cons; |
792 | if (msg->errno) { | 793 | if (msg->errno) { |
793 | cons = ACCESS_ONCE(idmap->idmap_key_cons); | 794 | cons = idmap->idmap_key_cons; |
794 | idmap->idmap_key_cons = NULL; | 795 | idmap->idmap_key_cons = NULL; |
795 | complete_request_key(cons, msg->errno); | 796 | complete_request_key(cons, msg->errno); |
796 | } | 797 | } |