aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2014-09-16 17:37:32 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-09-17 16:33:19 -0400
commit70b2823535d2d884eef2d3dab0dfd0ec3da8a019 (patch)
tree5d6bbdc25fc653a81b828abcbe7220801b70469f /fs/nfsd
parentbea57fe45ba23995dcf954e66d29625944a1d039 (diff)
nfsd4: clarify how grace period ends
The grace period is ended in two steps--first userland is notified that the grace period is now long enough that any clients who have not yet reclaimed can be safely forgotten, then we flip the switch that forbids reclaims and allows new opens. I had to think a bit to convince myself that the ordering was right here. Document it. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4state.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index a298c3d62ba6..ec24272529a0 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4122,8 +4122,28 @@ nfsd4_end_grace(struct nfsd_net *nn)
4122 4122
4123 dprintk("NFSD: end of grace period\n"); 4123 dprintk("NFSD: end of grace period\n");
4124 nn->grace_ended = true; 4124 nn->grace_ended = true;
4125 /*
4126 * If the server goes down again right now, an NFSv4
4127 * client will still be allowed to reclaim after it comes back up,
4128 * even if it hasn't yet had a chance to reclaim state this time.
4129 *
4130 */
4125 nfsd4_record_grace_done(nn); 4131 nfsd4_record_grace_done(nn);
4132 /*
4133 * At this point, NFSv4 clients can still reclaim. But if the
4134 * server crashes, any that have not yet reclaimed will be out
4135 * of luck on the next boot.
4136 *
4137 * (NFSv4.1+ clients are considered to have reclaimed once they
4138 * call RECLAIM_COMPLETE. NFSv4.0 clients are considered to
4139 * have reclaimed after their first OPEN.)
4140 */
4126 locks_end_grace(&nn->nfsd4_manager); 4141 locks_end_grace(&nn->nfsd4_manager);
4142 /*
4143 * At this point, and once lockd and/or any other containers
4144 * exit their grace period, further reclaims will fail and
4145 * regular locking can resume.
4146 */
4127} 4147}
4128 4148
4129static time_t 4149static time_t