android_kernel_xiaomi_sm8350/include/linux/sunrpc
Jeff Layton cd123012d9 RPC: add wrapper for svc_reserve to account for checksum
When the kernel calls svc_reserve to downsize the expected size of an RPC
reply, it fails to account for the possibility of a checksum at the end of
the packet.  If a client mounts a NFSv2/3 with sec=krb5i/p, and does I/O
then you'll generally see messages similar to this in the server's ring
buffer:

RPC request reserved 164 but used 208

While I was never able to verify it, I suspect that this problem is also
the root cause of some oopses I've seen under these conditions:

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=227726

This is probably also a problem for other sec= types and for NFSv4.  The
large reserved size for NFSv4 compound packets seems to generally paper
over the problem, however.

This patch adds a wrapper for svc_reserve that accounts for the possibility
of a checksum.  It also fixes up the appropriate callers of svc_reserve to
call the wrapper.  For now, it just uses a hardcoded value that I
determined via testing.  That value may need to be revised upward as things
change, or we may want to eventually add a new auth_op that attempts to
calculate this somehow.

Unfortunately, there doesn't seem to be a good way to reliably determine
the expected checksum length prior to actually calculating it, particularly
with schemes like spkm3.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Neil Brown <neilb@suse.de>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Acked-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-09 12:30:54 -07:00
..
auth_gss.h
auth.h
cache.h
clnt.h SUNRPC: remove old portmapper 2007-04-30 22:17:15 -07:00
debug.h SUNRPC: remove old portmapper 2007-04-30 22:17:15 -07:00
gss_api.h
gss_asn1.h
gss_err.h
gss_krb5.h
gss_spkm3.h
Kbuild
metrics.h
msg_prot.h SUNRPC: remove old portmapper 2007-04-30 22:17:15 -07:00
rpc_pipe_fs.h
sched.h SUNRPC: Eliminate side effects from rpc_malloc 2007-04-30 22:17:11 -07:00
stats.h
svc.h RPC: add wrapper for svc_reserve to account for checksum 2007-05-09 12:30:54 -07:00
svcauth_gss.h
svcauth.h
svcsock.h knfsd: rename sk_defer_lock to sk_lock 2007-05-09 12:30:54 -07:00
timer.h
types.h
xdr.h
xprt.h SUNRPC: introduce rpcbind: replacement for in-kernel portmapper 2007-04-30 22:17:12 -07:00