linux/net/sunrpc
NeilBrown 200724a707 SUNRPC/cache: fix reporting of expired cache entries in 'content' file.
Entries that are in a sunrpc cache but are not valid should be reported
with a leading '#' so they look like a comment.
Commit  d202cce896 (sunrpc: never return expired entries in sunrpc_cache_lookup)
broke this for expired entries.

This particularly applies to entries that have been replaced by newer entries.
sunrpc_cache_update sets the expiry of the replaced entry to '0', but it
remains in the cache until the next 'cache_clean'.
The result is that if you

  echo 0 2000000000 1 0 > /proc/net/rpc/auth.unix.gid/channel

several times, then

  cat /proc/net/rpc/auth.unix.gid/content

It will display multiple entries for the one uid, which is at least confusing:

  #uid cnt: gids...
  0 1: 0
  0 1: 0
  0 1: 0

With this patch, expired entries are marked as comments so you get

  #uid cnt: gids...
  0 1: 0
  # 0 1: 0
  # 0 1: 0

These expired entries will never be seen by cache_check() as they are always
*after* a non-expired entry with the same key - so the extra check is only
needed in c_show()

Signed-off-by:  NeilBrown <neilb@suse.de>

--
It's not a big problem, but it had me confused for a while, so it could
well confuse others.
Thanks,
NeilBrown
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2012-07-12 11:20:28 -04:00
..
auth_gss Merge branch 'for-3.5' of git://linux-nfs.org/~bfields/linux 2012-06-01 08:32:58 -07:00
xprtrdma
addr.c
auth.c
auth_generic.c userns: Convert group_info values from gid_t to kgid_t. 2012-05-03 03:27:21 -07:00
auth_null.c
auth_unix.c userns: Convert group_info values from gid_t to kgid_t. 2012-05-03 03:27:21 -07:00
backchannel_rqst.c
bc_svc.c
cache.c SUNRPC/cache: fix reporting of expired cache entries in 'content' file. 2012-07-12 11:20:28 -04:00
clnt.c NFS client updates for Linux 3.5 2012-05-29 10:43:51 -07:00
Kconfig
Makefile
netns.h
rpc_pipe.c rpc_pipefs: allow rpc_purge_list to take a NULL waitq pointer 2012-06-11 17:27:07 -04:00
rpcb_clnt.c Merge branch 'for-3.5' of git://linux-nfs.org/~bfields/linux 2012-06-01 08:32:58 -07:00
sched.c
socklib.c
stats.c
sunrpc.h
sunrpc_syms.c SUNRPC: register PipeFS file system after pernet sybsystem 2012-04-18 11:05:48 -04:00
svc.c NFS client bugfixes for Linux 3.5 2012-06-15 17:37:23 -07:00
svc_xprt.c Merge branch 'for-3.5' of git://linux-nfs.org/~bfields/linux 2012-06-01 08:32:58 -07:00
svcauth.c
svcauth_unix.c Merge branch 'for-3.5' of git://linux-nfs.org/~bfields/linux 2012-06-01 08:32:58 -07:00
svcsock.c net: Convert net_ratelimit uses to net_<level>_ratelimited 2012-05-15 13:45:03 -04:00
sysctl.c
timer.c net: cleanup unsigned to unsigned int 2012-04-15 12:44:40 -04:00
xdr.c net: cleanup unsigned to unsigned int 2012-04-15 12:44:40 -04:00
xprt.c NFS client updates for Linux 3.5 2012-05-29 10:43:51 -07:00
xprtsock.c