OSDN Git Service

nfsd: allow forced expiration of NFSv4 clients
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 19 Jun 2019 16:43:11 +0000 (12:43 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 3 Jul 2019 21:52:50 +0000 (17:52 -0400)
commit89c905beccbbafa88490c8c4c35eaec5ce4c1329
treee335b0c13b5527adcf17459bde3d0fd36aa3d68e
parenta204f25e372d942245dc0fdccd12f5c16483bbc1
nfsd: allow forced expiration of NFSv4 clients

NFSv4 clients are automatically expired and all their locks removed if
they don't contact the server for a certain amount of time (the lease
period, 90 seconds by default).

There can still be situations where that's not enough, so allow
userspace to force expiry by writing "expire\n" to the new
nfsd/client/#/ctl file.

(The generic "ctl" name is because I expect we may want to allow other
operations on clients in the future.)

The write will not return until the client is expired and all of its
locks and other state removed.

The fault injection code also provides a way of expiring clients, but it
fails if there are any in-progress RPC's referencing the client.  Also,
its method of selecting a client to expire is a little more
primitive--it uses an IP address, which can't always uniquely specify an
NFSv4 client.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c