>From Frank Filz <ffilz...@mindspring.com>:
Frank Filz has uploaded this change for review. (
https://review.gerrithub.io/379421
Change subject: Use state_lock to prevent race between FREE_STATEID and
LOCK/new lock owner
......................................................................
Use state_lock to prevent race between FREE_STATEID and LOCK/new lock owner
A client may have released all locks on a stateid and sent a FREE_STATEID
request. Almost immediately, it needs to make a new lock request, so it
sends a LOCK request with new lock owner. If the server ends up with a race
between the two requests, problems occur.
The old code always created a new stateid for 4.1 for a LOCK with new
lock owner request to avoid the race, however, that may result in a period
of time with multiple stateids present.
This resolves the race by holding the state_lock for a longer period of
time and performing all the LOCK stateid processing with the state_lock
held, and making the checking of the stateid for locks and the destruction
if it atomic for FREE_STATEID.
Now, either the FREE_STATEID will proceed first, and the stateid will
be gone before the LOCK request attempts to find the stateid and thus
it will properly create a new stateid, or the reverse will happen and
the FREE_STATEID will fail with NFS4ERR_LOCKS_HELD.
Change-Id: I9678b1be26fe74fee84022df587846aaeba56672
Signed-off-by: Frank S. Filz <ffilz...@mindspring.com>
---
M src/Protocols/NFS/nfs4_op_free_stateid.c
M src/Protocols/NFS/nfs4_op_lock.c
M src/Protocols/NLM/nlm_Lock.c
M src/SAL/nfs4_state_id.c
M src/SAL/state_lock.c
M src/include/sal_functions.h
6 files changed, 87 insertions(+), 87 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha
refs/changes/21/379421/1
--
To view, visit https://review.gerrithub.io/379421
To unsubscribe, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9678b1be26fe74fee84022df587846aaeba56672
Gerrit-Change-Number: 379421
Gerrit-PatchSet: 1
Gerrit-Owner: Frank Filz <ffilz...@mindspring.com>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel