linux-sg2042/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
..
Kbuild [HEADERS] One line per header in Kbuild files to reduce conflicts 2006-09-19 12:43:58 +01:00
auth.h [PATCH] knfsd: Prepare knfsd for support of rsize/wsize of up to 1MB, over TCP 2006-10-04 07:55:16 -07:00
auth_gss.h rpc: gss: eliminate print_hexl()'s 2006-12-06 10:46:43 -05:00
cache.h [PATCH] knfsd: knfsd: cache ipmap per TCP socket 2006-10-04 07:55:16 -07:00
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 fix file specification in comments 2006-10-03 23:01:26 +02:00
gss_asn1.h
gss_err.h
gss_krb5.h rpcgss: krb5: ignore seed 2006-12-06 10:46:47 -05:00
gss_spkm3.h rpc: spkm3 update 2006-12-06 10:46:44 -05:00
metrics.h NFS: fix PROC_FS=n compile error 2006-04-19 12:43:46 -04:00
msg_prot.h SUNRPC: remove old portmapper 2007-04-30 22:17:15 -07:00
rpc_pipe_fs.h WorkStruct: Separate delayable and non-delayable events. 2006-11-22 14:54:01 +00:00
sched.h SUNRPC: Eliminate side effects from rpc_malloc 2007-04-30 22:17:11 -07:00
stats.h Don't include linux/config.h from anywhere else in include/ 2006-04-26 12:56:16 +01:00
svc.h RPC: add wrapper for svc_reserve to account for checksum 2007-05-09 12:30:54 -07:00
svcauth.h [PATCH] knfsd: knfsd: cache ipmap per TCP socket 2006-10-04 07:55:16 -07:00
svcauth_gss.h fix file specification in comments 2006-10-03 23:01:26 +02:00
svcsock.h knfsd: rename sk_defer_lock to sk_lock 2007-05-09 12:30:54 -07:00
timer.h
types.h
xdr.h SUNRPC: Rename skb_reader_t and friends 2006-12-06 10:46:52 -05:00
xprt.h SUNRPC: introduce rpcbind: replacement for in-kernel portmapper 2007-04-30 22:17:12 -07:00