OpenCloudOS-Kernel/net
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
..
802 [NET]: cleanup extra semicolons 2007-04-25 22:29:24 -07:00
8021q [NET]: Rework dev_base via list_head (v3) 2007-05-03 15:13:45 -07:00
appletalk header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
atm [NET]: SPIN_LOCK_UNLOCKED cleanup in drivers/atm, net 2007-04-26 01:37:44 -07:00
ax25 header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
bluetooth header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
bridge header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
core header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
dccp [NET]: SPIN_LOCK_UNLOCKED cleanup in drivers/atm, net 2007-04-26 01:37:44 -07:00
decnet [NET]: Rework dev_base via list_head (v3) 2007-05-03 15:13:45 -07:00
econet [SK_BUFF]: Convert skb->tail to sk_buff_data_t 2007-04-25 22:26:28 -07:00
ethernet [SK_BUFF]: Introduce skb_reset_mac_header(skb) 2007-04-25 22:24:32 -07:00
ieee80211 [PATCH] ieee80211: add missing global needed by IEEE80211_DEBUG_XXXX 2007-04-28 11:01:05 -04:00
ipv4 unify flush_work/flush_work_keventd and rename it to cancel_work_sync 2007-05-09 12:30:53 -07:00
ipv6 header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
ipx header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
irda header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
iucv [AF_IUCV]: Compile fix - adopt to skbuff changes. 2007-05-05 11:41:18 -07:00
key [NET]: cleanup extra semicolons 2007-04-25 22:29:24 -07:00
lapb [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
llc [NET]: Rework dev_base via list_head (v3) 2007-05-03 15:13:45 -07:00
mac80211 [MAC80211]: Add debugfs attributes. 2007-05-05 11:46:38 -07:00
netfilter kconfig: fix path to modules.txt in Kconfig help 2007-05-02 20:58:11 +02:00
netlabel SELinux: extract the NetLabel SELinux support from the security server 2007-04-26 01:35:48 -04:00
netlink header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
netrom [NET]: Rework dev_base via list_head (v3) 2007-05-03 15:13:45 -07:00
packet [AF_PACKET]: Add option to return orig_dev to userspace. 2007-04-25 22:29:14 -07:00
rfkill [NET]: rfkill: add support for input key to control wireless radio 2007-05-07 00:34:20 -07:00
rose [NET]: Rework dev_base via list_head (v3) 2007-05-03 15:13:45 -07:00
rxrpc [AF_RXRPC]: Sort out MTU handling. 2007-05-04 12:41:11 -07:00
sched [NET]: Rework dev_base via list_head (v3) 2007-05-03 15:13:45 -07:00
sctp [SCTP]: Set assoc_id correctly during INIT collision. 2007-05-04 13:55:27 -07:00
sunrpc RPC: add wrapper for svc_reserve to account for checksum 2007-05-09 12:30:54 -07:00
tipc Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild 2007-05-06 13:21:57 -07:00
unix header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
wanrouter [SK_BUFF]: Introduce skb_copy_to_linear_data{_offset} 2007-04-25 22:28:29 -07:00
wireless [WIRELESS] cfg80211: Clarify locking comment. 2007-04-26 20:51:12 -07:00
x25 header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
xfrm [XFRM] SPD info TLV aggregation 2007-05-04 12:55:39 -07:00
Kconfig [NET]: rfkill: add support for input key to control wireless radio 2007-05-07 00:34:20 -07:00
Makefile [NET]: rfkill: add support for input key to control wireless radio 2007-05-07 00:34:20 -07:00
TUNABLE Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
compat.c [NET]: Adding SO_TIMESTAMPNS / SCM_TIMESTAMPNS support 2007-04-25 22:24:21 -07:00
nonet.c [PATCH] Make most file operations structs in fs/ const 2006-03-28 09:16:06 -08:00
socket.c VFS: delay the dentry name generation on sockets and pipes 2007-05-08 11:15:03 -07:00
sysctl_net.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00