linux-stable/include/linux/sunrpc
NeilBrown cf64b9bce9 SUNRPC: return proper error from get_expiry()
The get_expiry() function currently returns a timestamp, and uses the
special return value of 0 to indicate an error.

Unfortunately this causes a problem when 0 is the correct return value.

On a system with no RTC it is possible that the boot time will be seen
to be "3".  When exportfs probes to see if a particular filesystem
supports NFS export it tries to cache information with an expiry time of
"3".  The intention is for this to be "long in the past".  Even with no
RTC it will not be far in the future (at most a second or two) so this
is harmless.
But if the boot time happens to have been calculated to be "3", then
get_expiry will fail incorrectly as it converts the number to "seconds
since bootime" - 0.

To avoid this problem we change get_expiry() to report the error quite
separately from the expiry time.  The error is now the return value.
The expiry time is reported through a by-reference parameter.

Reported-by: Jerry Zhang <jerry@skydio.com>
Tested-by: Jerry Zhang <jerry@skydio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2023-04-26 09:05:00 -04:00
..
addr.h
auth.h
auth_gss.h
bc_xprt.h
cache.h SUNRPC: return proper error from get_expiry() 2023-04-26 09:05:00 -04:00
clnt.h
debug.h
gss_api.h
gss_asn1.h
gss_err.h
gss_krb5.h SUNRPC: Move remaining internal definitions to gss_krb5_internal.h 2023-02-20 09:20:46 -05:00
metrics.h
msg_prot.h SUNRPC: Convert svcauth_unix_accept() to use xdr_stream 2023-02-20 09:20:11 -05:00
rpc_pipe_fs.h SUNRPC: ensure the matching upcall is in-flight upon downcall 2022-12-15 18:13:53 -05:00
rpc_rdma.h
rpc_rdma_cid.h
sched.h NFS Client Updates for Linux 6.1 2022-10-13 09:58:42 -07:00
stats.h
svc.h SUNRPC: Replace pool stats with per-CPU variables 2023-02-20 09:20:32 -05:00
svc_rdma.h
svc_rdma_pcl.h
svc_xprt.h SUNRPC: Remove ->xpo_secure_port() 2023-02-20 09:20:55 -05:00
svcauth.h
svcauth_gss.h
svcsock.h
timer.h
types.h
xdr.h SUNRPC: Push svcxdr_init_encode() into svc_process_common() 2023-02-20 09:20:27 -05:00
xprt.h
xprtmultipath.h
xprtrdma.h
xprtsock.h