kernel-ark/fs/nfs
Andy Adamson d1f456b0b9 NFSv4.1: Fix an NFSv4.1 state renewal regression
Commit 2f60ea6b8c ("NFSv4: The NFSv4.0 client must send RENEW calls if it holds a delegation") set the NFS4_RENEW_TIMEOUT flag in nfs4_renew_state, and does
not put an nfs41_proc_async_sequence call, the NFSv4.1 lease renewal heartbeat
call, on the wire to renew the NFSv4.1 state if the flag was not set.

The NFS4_RENEW_TIMEOUT flag is set when "now" is after the last renewal
(cl_last_renewal) plus the lease time divided by 3. This is arbitrary and
sometimes does the following:

In normal operation, the only way a future state renewal call is put on the
wire is via a call to nfs4_schedule_state_renewal, which schedules a
nfs4_renew_state workqueue task. nfs4_renew_state determines if the
NFS4_RENEW_TIMEOUT should be set, and the calls nfs41_proc_async_sequence,
which only gets sent if the NFS4_RENEW_TIMEOUT flag is set.
Then the nfs41_proc_async_sequence rpc_release function schedules
another state remewal via nfs4_schedule_state_renewal.

Without this change we can get into a state where an application stops
accessing the NFSv4.1 share, state renewal calls stop due to the
NFS4_RENEW_TIMEOUT flag _not_ being set. The only way to recover
from this situation is with a clientid re-establishment, once the application
resumes and the server has timed out the lease and so returns
NFS4ERR_BAD_SESSION on the subsequent SEQUENCE operation.

An example application:
open, lock, write a file.

sleep for 6 * lease (could be less)

ulock, close.

In the above example with NFSv4.1 delegations enabled, without this change,
there are no OP_SEQUENCE state renewal calls during the sleep, and the
clientid is recovered due to lease expiration on the close.

This issue does not occur with NFSv4.1 delegations disabled, nor with
NFSv4.0, with or without delegations enabled.

Signed-off-by: Andy Adamson <andros@netapp.com>
Link: http://lkml.kernel.org/r/1411486536-23401-1-git-send-email-andros@netapp.com
Fixes: 2f60ea6b8c (NFSv4: The NFSv4.0 client must send RENEW calls...)
Cc: stable@vger.kernel.org # 3.2.x
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2014-09-30 17:18:42 -04:00
..
blocklayout FS/NFS: replace count*size kzalloc by kcalloc 2014-06-25 19:02:14 -04:00
filelayout pnfs: fix filelayout_retry_commit when idx > 0 2014-09-10 12:43:45 -07:00
objlayout nfs: remove unused writeverf code 2014-06-24 18:47:00 -04:00
cache_lib.c
cache_lib.h
callback_proc.c
callback_xdr.c
callback.c nfs4: copy acceptor name from context to nfs_client 2014-07-12 18:41:25 -04:00
callback.h
client.c nfs: fix duplicate proc entries 2014-09-24 23:00:18 -04:00
delegation.c nfs4: add nfs4_check_delegation 2014-07-12 18:22:58 -04:00
delegation.h nfs4: add nfs4_check_delegation 2014-07-12 18:22:58 -04:00
dir.c NFS: fix two problems in lookup_revalidate in RCU-walk 2014-08-04 09:22:08 -04:00
direct.c Merge branch 'bugfixes' into linux-next 2014-07-13 15:22:02 -04:00
dns_resolve.c
dns_resolve.h
file.c sched: Remove proliferation of wait_on_bit() action functions 2014-07-16 15:10:39 +02:00
fscache-index.c NFS: Fabricate fscache server index key correctly 2014-09-25 21:25:18 -04:00
fscache.c
fscache.h
getroot.c dcache: d_obtain_alias callers don't all want DISCONNECTED 2014-08-07 14:40:10 -04:00
idmap.c Merge branch 'keys-fixes' into keys-next 2014-07-22 21:55:45 +01:00
inode.c NFS client updates for Linux 3.17 2014-08-13 18:13:19 -06:00
internal.h NFS client updates for Linux 3.17 2014-08-13 18:13:19 -06:00
iostat.h
Kconfig
Makefile Push the file layout driver into a subdirectory 2014-05-29 20:21:56 -04:00
mount_clnt.c
namespace.c
netns.h NFS: Fix /proc/fs/nfsfs/servers and /proc/fs/nfsfs/volumes 2014-08-04 09:28:32 -07:00
nfs2super.c
nfs2xdr.c
nfs3acl.c NFSv3: Fix another acl regression 2014-08-26 16:17:48 -04:00
nfs3client.c
nfs3proc.c Merge branch 'bugfixes' into linux-next 2014-07-13 15:22:02 -04:00
nfs3super.c
nfs3xdr.c
nfs4_fs.h nfs: revert "nfs4: queue free_lock_state job submission to nfsiod" 2014-09-08 17:00:32 -07:00
nfs4client.c NFSv4: nfs4_state_manager() vs. nfs_server_remove_lists() 2014-09-18 13:04:21 -04:00
nfs4file.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2014-06-12 10:30:18 -07:00
nfs4getroot.c
nfs4namespace.c NFSv4: test SECINFO RPC_AUTH_GSS pseudoflavors for support 2014-06-24 18:46:58 -04:00
nfs4proc.c NFSv4.1: Fix an NFSv4.1 state renewal regression 2014-09-30 17:18:42 -04:00
nfs4renewd.c NFSv4.1: Fix an NFSv4.1 state renewal regression 2014-09-30 17:18:42 -04:00
nfs4session.c
nfs4session.h
nfs4state.c NFSv4: fix open/lock state recovery error handling 2014-09-28 16:03:04 -04:00
nfs4super.c
nfs4sysctl.c nfs: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:16 -07:00
nfs4trace.c
nfs4trace.h nfs: merge nfs_pgio_data into _header 2014-06-24 18:47:00 -04:00
nfs4xdr.c NFSv4: Drop cast 2014-07-12 18:43:47 -04:00
nfs.h
nfsroot.c
nfstrace.c
nfstrace.h
pagelist.c nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait 2014-08-22 18:04:44 -04:00
pnfs_dev.c
pnfs.c NFS client updates for Linux 3.17 2014-08-13 18:13:19 -06:00
pnfs.h pnfs: add pnfs_put_lseg_async 2014-08-03 17:05:25 -04:00
proc.c nfs: merge nfs_pgio_data into _header 2014-06-24 18:47:00 -04:00
read.c nfs: get rid of duplicate dprintk 2014-06-25 19:01:27 -04:00
super.c nfs: reject changes to resvport and sharecache during remount 2014-08-04 17:41:52 -04:00
symlink.c
sysctl.c nfs: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:16 -07:00
unlink.c
write.c nfs: don't sleep with inode lock in lock_and_join_requests 2014-08-22 18:04:43 -04:00