Commit c4687a4a authored by Kent Overstreet's avatar Kent Overstreet

six locks: Fix an unitialized var

In the conversion to atomic_t, six_lock_slowpath() ended up calling
six_lock_wakeup() in the failure path with a state variable that was
never initialized - whoops.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 96e53e90
...@@ -451,7 +451,6 @@ static int six_lock_slowpath(struct six_lock *lock, enum six_lock_type type, ...@@ -451,7 +451,6 @@ static int six_lock_slowpath(struct six_lock *lock, enum six_lock_type type,
six_lock_should_sleep_fn should_sleep_fn, void *p, six_lock_should_sleep_fn should_sleep_fn, void *p,
unsigned long ip) unsigned long ip)
{ {
u32 old;
int ret = 0; int ret = 0;
if (type == SIX_LOCK_write) { if (type == SIX_LOCK_write) {
...@@ -527,7 +526,7 @@ static int six_lock_slowpath(struct six_lock *lock, enum six_lock_type type, ...@@ -527,7 +526,7 @@ static int six_lock_slowpath(struct six_lock *lock, enum six_lock_type type,
out: out:
if (ret && type == SIX_LOCK_write) { if (ret && type == SIX_LOCK_write) {
six_clear_bitmask(lock, SIX_LOCK_HELD_write); six_clear_bitmask(lock, SIX_LOCK_HELD_write);
six_lock_wakeup(lock, old, SIX_LOCK_read); six_lock_wakeup(lock, atomic_read(&lock->state), SIX_LOCK_read);
} }
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment