SUNRPC: NFS kernel APIs shouldn't return ENOENT for "transport not found"
authorChuck Lever <chuck.lever@oracle.com>
Tue, 26 Jan 2010 19:04:13 +0000 (14:04 -0500)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Tue, 26 Jan 2010 22:59:21 +0000 (17:59 -0500)
commit68717908155a9dcd4161f4d730fea478712d9794
tree4553be47ed74cad18791ca6977f55f38d332fa37
parentd6783b2b6c4050df0ba0a84c6842cf5bc2212ef9
SUNRPC: NFS kernel APIs shouldn't return ENOENT for "transport not found"

write_ports() converts svc_create_xprt()'s ENOENT error return to
EPROTONOSUPPORT so that rpc.nfsd (in user space) can report an error
message that makes sense.

It turns out that several of the other kernel APIs rpc.nfsd use can
also return ENOENT from svc_create_xprt(), by way of lockd_up().

On the client side, an NFSv2 or NFSv3 mount request can also return
the result of lockd_up().  This error may also be returned during an
NFSv4 mount request, since the NFSv4 callback service uses
svc_create_xprt() to create the callback listener.  An ENOENT error
return results in a confusing error message from the mount command.

Let's have svc_create_xprt() return EPROTONOSUPPORT instead of ENOENT.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfsctl.c
net/sunrpc/svc_xprt.c