Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFS: Check return value from rpc_queue_upcall()

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>

authored by

Bryan Schumaker and committed by
Trond Myklebust
11588f49 4b7c8dd2

+7 -2
+7 -2
fs/nfs/idmap.c
··· 656 656 657 657 idmap->idmap_key_cons = cons; 658 658 659 - return rpc_queue_upcall(idmap->idmap_pipe, msg); 659 + ret = rpc_queue_upcall(idmap->idmap_pipe, msg); 660 + if (ret < 0) 661 + goto out2; 662 + 663 + return ret; 660 664 661 665 out2: 662 666 kfree(im); 663 667 out1: 664 668 kfree(msg); 665 669 out0: 666 - complete_request_key(cons, ret); 670 + key_revoke(cons->key); 671 + key_revoke(cons->authkey); 667 672 return ret; 668 673 } 669 674