Whamcloud - gitweb
1. When one thread enqueues and another thread matches, the matching
authorphil <phil>
Sun, 22 Feb 2004 04:19:28 +0000 (04:19 +0000)
committerphil <phil>
Sun, 22 Feb 2004 04:19:28 +0000 (04:19 +0000)
commit63fb505732f39170e326b662899260c1f9d7a3b3
tree6f924a3c7752367bd499b126ec4c32b177a19b2d
parenta470360547ab7862fd36945133e6eef95032812f
1. When one thread enqueues and another thread matches, the matching
thread can get the lock before the enqueueing thread updates the lock
value block.  The correct fix is to do the granting inside of the
completion AST -- which can then be wrapped as appropriate to handle
the LVB mechanics -- but that's higher risk than I want right now.

Instead, I added a temporary LDLM_FL_CAN_MATCH flag, which gets set
only after the enqueueing thread is finished.  Threads trying to match
will wait for this flag to be set after the lock is granted.

2. Fixes a fencepost error in the KMS calculation; a lock on [x, y]
actually protects a file of y + 1 bytes, not y bytes.

3. I spotted that ldlm_completion_ast might not call wake_up in
certain cases, but I think that's a theoretical concern.  Fixed by
checking a different set of flags.
lustre/mdc/mdc_locks.c