2019-07-07 19:39:36

by Donald Buczek

[permalink] [raw]
Subject: [PATCH V2 0/4] nfs4.0: Refetch lease_time after clientID reset

V2: Make sure, code doesn't depend on CONFIG_NFS_V4_1. I've scattered
#endifs and #ifdefs into the source instead of moving code into other
areas to be more friendly to git. Tell me if you prefer otherwise.

Currently, nfs mounts with vers=4.0 do not pick up a updated
lease_time after a restart of the nfs server. This was discussed in
the thread "4.0 client and server restart with decreased lease time" on
linux-nfs [1].

This patch set fixes the issue for nsf4.0 clients so that hey behave as
nfs4.1 and nfs4.2 clients do. After a new clientID is established, the
lease_time is re-fetched and used.

Tested with

CONFIG_NFS_V4=m CONFIG_NFS_V4_1=y CONFIG_NFS_V4_2=y : mount
CONFIG_NFS_V4=m CONFIG_NFS_V4_1=y CONFIG_NFS_V4_2=y : mount vers=4.0
CONFIG_NFS_V4=m CONFIG_NFS_V4_1=y CONFIG_NFS_V4_2=n : mount
CONFIG_NFS_V4=m CONFIG_NFS_V4_1=y CONFIG_NFS_V4_2=n : mount vers=4.0
CONFIG_NFS_V4=m CONFIG_NFS_V4_1=n CONFIG_NFS_V4_2=n : mount

and several restarts of the nfs server with changed leases times, which
were picked up by the client.

[1] https://marc.info/?t=154954022700002&r=1&w=2

Donald Buczek (4):
nfs: Fix copy-and-paste error in debug message
nfs4: Make nfs4_proc_get_lease_time available for nfs4.0
nfs4: Rename nfs41_setup_state_renewal
nfs4.0: Refetch lease_time after clientid update

fs/nfs/nfs4_fs.h | 4 ++--
fs/nfs/nfs4proc.c | 6 +++++-
fs/nfs/nfs4state.c | 46 +++++++++++++++++++++++-----------------------
fs/nfs/nfs4xdr.c | 14 ++++++++++++--
4 files changed, 42 insertions(+), 28 deletions(-)

--
2.22.0


2019-07-07 19:39:36

by Donald Buczek

[permalink] [raw]
Subject: [PATCH V2 1/4] nfs: Fix copy-and-paste error in debug message

The debug message of decode_attr_lease_time incorrectly
says "file size". Fix it to "lease time".

Signed-off-by: Donald Buczek <[email protected]>
---
fs/nfs/nfs4xdr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 602446158bfb..6d51877cd383 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -3427,7 +3427,7 @@ static int decode_attr_lease_time(struct xdr_stream *xdr, uint32_t *bitmap, uint
*res = be32_to_cpup(p);
bitmap[0] &= ~FATTR4_WORD0_LEASE_TIME;
}
- dprintk("%s: file size=%u\n", __func__, (unsigned int)*res);
+ dprintk("%s: lease time=%u\n", __func__, (unsigned int)*res);
return 0;
}

--
2.22.0