Skip to content

Commit

Permalink
block: Avoid that sparse complains about context imbalance in __wbt_w…
Browse files Browse the repository at this point in the history
…ait()

This patch does not change any functionality.

Fixes: e34cbd3 ("blk-wbt: add general throttling mechanism")
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Bart Van Assche authored and axboe committed Jan 2, 2017
1 parent f2e0a0b commit 9eca535
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions block/blk-wbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,8 @@ static inline bool may_queue(struct rq_wb *rwb, struct rq_wait *rqw,
* the timer to kick off queuing again.
*/
static void __wbt_wait(struct rq_wb *rwb, unsigned long rw, spinlock_t *lock)
__releases(lock)
__acquires(lock)
{
struct rq_wait *rqw = get_rq_wait(rwb, current_is_kswapd());
DEFINE_WAIT(wait);
Expand All @@ -558,13 +560,12 @@ static void __wbt_wait(struct rq_wb *rwb, unsigned long rw, spinlock_t *lock)
if (may_queue(rwb, rqw, &wait, rw))
break;

if (lock)
if (lock) {
spin_unlock_irq(lock);

io_schedule();

if (lock)
io_schedule();
spin_lock_irq(lock);
} else
io_schedule();
} while (1);

finish_wait(&rqw->wait, &wait);
Expand Down

0 comments on commit 9eca535

Please sign in to comment.