Zach Brown fbfbe910aa scoutfs: return error from lock_name_keys
xfstests generic/028 was crashing dereferencing NULL locks.   It'd hit
either rename trying to refresh an inode with a NULL lock or lookup
trying to pass a NULL lock's end to item lookup.

The addition of the lock LRU fixed a bug in lock_name_keys() where it
wouldn't drop a lock when _cluster_lock() returned an error.  But it
always returned 0 instead of returning the error.  Returning 0 without
setting the lock caused the callers to deref their NULL locks.

We also forcefully NULL the lock at the start of the function.  It was
lucky that callers had already NULLed their locks.  If they hadn't they
would have been following random on-stack memory and it might have been
harder to debug.

Signed-off-by: Zach Brown <zab@versity.com>
2017-09-11 09:27:57 -07:00
Description
No description provided
8 MiB
Languages
C 87%
Shell 9.3%
Roff 2.5%
TeX 0.8%
Makefile 0.4%