struct rpc_pipe *pipe;
int error;
- BUG_ON(clp->cl_idmap != NULL);
-
idmap = kzalloc(sizeof(*idmap), GFP_KERNEL);
if (idmap == NULL)
return -ENOMEM;
switch (event) {
case RPC_PIPEFS_MOUNT:
- BUG_ON(clp->cl_rpcclient->cl_dentry == NULL);
err = __nfs_idmap_register(clp->cl_rpcclient->cl_dentry,
clp->cl_idmap,
clp->cl_idmap->idmap_pipe);
if (ret < 0)
goto out2;
- BUG_ON(idmap->idmap_key_cons != NULL);
+ if (idmap->idmap_key_cons != NULL) {
+ WARN_ON_ONCE(1);
+ ret = -EAGAIN;
+ goto out2;
+ }
idmap->idmap_key_cons = cons;
ret = rpc_queue_upcall(idmap->idmap_pipe, msg);
* will have been woken up and someone else may now have used
* idmap_key_cons - so after this point we may no longer touch it.
*/
- cons = ACCESS_ONCE(idmap->idmap_key_cons);
+ cons = idmap->idmap_key_cons;
idmap->idmap_key_cons = NULL;
if (mlen != sizeof(im)) {
struct idmap *idmap = data->idmap;
struct key_construction *cons;
if (msg->errno) {
- cons = ACCESS_ONCE(idmap->idmap_key_cons);
+ cons = idmap->idmap_key_cons;
idmap->idmap_key_cons = NULL;
complete_request_key(cons, msg->errno);
}