From 81b829655d418316f0707b3656b45cff7a1dbf12 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Tue, 23 Aug 2011 11:03:29 -0400 Subject: nfsd4: simplify stateid generation code, fix wraparound Follow the recommendation from rfc3530bis for stateid generation number wraparound, simplify some code, and fix or remove incorrect comments. Signed-off-by: J. Bruce Fields --- fs/nfsd/state.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fs/nfsd/state.h') diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index a06f55bd38b6..c425717715f6 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h @@ -293,6 +293,9 @@ static inline void update_stateid(stateid_t *stateid) { stateid->si_generation++; + /* Wraparound recommendation from 3530bis-13 9.1.3.2: */ + if (stateid->si_generation == 0) + stateid->si_generation = 1; } /* A reasonable value for REPLAY_ISIZE was estimated as follows: -- cgit v1.2.3