[PATCH 3/3] nfsd4: end grace only once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With the newly coordinated v4 and lockd grace period code, it's possible
nfsd4 could end its grace period while lockd is still holding onto its
own--which would mean we could call end_grace() here twice.

That's not really a huge deal, but I'd rather not.  Also, the grace
period is eventually going to become more of a per-filesystem notion, at
which point in_grace() calls that aren't associated with a filesystem
will become awkward.

Signed-off-by: J. Bruce Fields <bfields@xxxxxxxxxxxxxx>
---
 fs/nfsd/nfs4state.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 7ef42f4..43c83be 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1836,12 +1836,15 @@ nfs4_laundromat(void)
 	time_t cutoff = get_seconds() - NFSD_LEASE_TIME;
 	time_t t, clientid_val = NFSD_LEASE_TIME;
 	time_t u, test_val = NFSD_LEASE_TIME;
+	static int grace_ended = 0;
 
 	nfs4_lock_state();
 
 	dprintk("NFSD: laundromat service - starting\n");
-	if (locks_in_grace())
+	if (!grace_ended) {
+		grace_ended = 1;
 		nfsd4_end_grace();
+	}
 	list_for_each_safe(pos, next, &client_lru) {
 		clp = list_entry(pos, struct nfs4_client, cl_lru);
 		if (time_after((unsigned long)clp->cl_time, (unsigned long)cutoff)) {
-- 
1.5.5.rc1

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux