Skip to content

Commit

Permalink
writeback: fix bad _bh spinlock nesting
Browse files Browse the repository at this point in the history
Fix a bug where a lock is _bh nested within another _bh lock,
but forgets to use the _bh variant for unlock.

Further more, it's not necessary to test _bh locks, the inner lock
can just use spin_lock(). So fix up the bug by making that change.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
  • Loading branch information
Jens Axboe committed Aug 7, 2010
1 parent e7f52df commit 6bf05d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mm/backing-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@ static int bdi_forker_thread(void *ptr)
break;
}

spin_lock_bh(&bdi->wb_lock);
spin_lock(&bdi->wb_lock);

/*
* If there is no work to do and the bdi thread was
* inactive long enough - kill it. The wb_lock is taken
Expand All @@ -432,7 +433,7 @@ static int bdi_forker_thread(void *ptr)
action = KILL_THREAD;
break;
}
spin_unlock_bh(&bdi->wb_lock);
spin_unlock(&bdi->wb_lock);
}
spin_unlock_bh(&bdi_lock);

Expand Down

0 comments on commit 6bf05d0

Please sign in to comment.