Zach Brown e31e828aff scoutfs: don't livelock conflicting waiters
If there are two tasks waiting for conflicting modes, say a writer
waiting for a CW index lock and a index walker waiting for a PR index
lock, they can livelock.

In the ast one of their modes will be granted.  We'll wake them under
the lock now that they can see that their mode is ready.  But then while
still under the lock we see a conflicting waiter, and no users, so we
immediately start converting the lock away to the other waiting
conflicting mode.  The woken waiter is scheduled but now sees that the
lock isn't granted anymore because it's converting.  This bounces back
and forth forever.

The fix is to refuse to start conversion while there are still waiters
for the currently granted mode.  Once they finish it'll be able to
convert.

Signed-off-by: Zach Brown <zab@versity.com>
2018-02-21 15:14:29 -08:00
Description
No description provided
8 MiB
Languages
C 87%
Shell 9.3%
Roff 2.5%
TeX 0.8%
Makefile 0.4%