Skip to content

Commit

Permalink
NFS: Check return value from rpc_queue_upcall()
Browse files Browse the repository at this point in the history
This function could fail to queue the upcall if rpc.idmapd is not running,
causing a warning message to be printed.  Instead, I want to check the
return value and revoke the key if the upcall can't be run.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Bryan Schumaker authored and Trond Myklebust committed Mar 12, 2012
1 parent 4b7c8dd commit 11588f4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fs/nfs/idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,14 +656,19 @@ static int nfs_idmap_legacy_upcall(struct key_construction *cons,

idmap->idmap_key_cons = cons;

return rpc_queue_upcall(idmap->idmap_pipe, msg);
ret = rpc_queue_upcall(idmap->idmap_pipe, msg);
if (ret < 0)
goto out2;

return ret;

out2:
kfree(im);
out1:
kfree(msg);
out0:
complete_request_key(cons, ret);
key_revoke(cons->key);
key_revoke(cons->authkey);
return ret;
}

Expand Down

0 comments on commit 11588f4

Please sign in to comment.