]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
SUNRPC/Cache: Always treat the invalid cache as unexpired
authorKinglong Mee <kinglongmee@gmail.com>
Wed, 8 Feb 2017 01:54:42 +0000 (09:54 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 8 Feb 2017 21:49:53 +0000 (16:49 -0500)
commitd6fc8821c2d2aba4cc18447a467f543e46e7367d
treeb27831ab070de9a0c99b4115b475190204d5b1f3
parent471a930ad7d1b868456e835a67169a661ec73f65
SUNRPC/Cache: Always treat the invalid cache as unexpired

When the first time pynfs runs after rpc/nfsd startup, always get the warning,

"Got error: Connection closed"

I found the problem is caused by,
1. A new startup of nfsd, rpc.mountd, etc,
2. A rpc request from client (pynfs test, or normal mounting),
3. An ip_map cache is created but invalid, so upcall to rpc.mountd,
4. rpc.mountd process the ip_map upcall, before write the valid data to nfsd,
   do auth_reload(), and check_useipaddr(),
5. For the first time, old_use_ipaddr = -1, it causes rpc.mountd do write_flush    that doing cache_clean,
6. The ip_map cache will be treat as expired and clean,
7. When rpc.mountd write the valid data to nfsd, a new ip_map is created
   and updated, the cache_check of old ip_map(doing the upcall) will
   return -ETIMEDOUT.
8. RPC layer return SVC_CLOSE and close the xprt after commit 4d712ef1db05
   "svcauth_gss: Close connection when dropping an incoming message"

NeilBrown suggest in another email,

"If CACHE_VALID is not set, then there is no data in the cache item,
 so there is nothing to expire. So it would be nice if cache items that
 don't have CACHE_VALID are never treated as expired."

v3, change the order of the two patches
v2, change the checking of CACHE_PENDING to CACHE_VALID

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
include/linux/sunrpc/cache.h