Skip to content

Commit

Permalink
fs/reiserfs/journal.c: fix sparse context imbalance warning
Browse files Browse the repository at this point in the history
Merge conditional unlock/lock in the same condition to avoid sparse
warning:

  fs/reiserfs/journal.c:703:36: warning: context imbalance in 'add_to_chunk' - unexpected unlock

Signed-off-by: Fabian Frederick <[email protected]>
Cc: Jeff Mahoney <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Fabian Frederick authored and torvalds committed Oct 14, 2014
1 parent 35c0b38 commit 54cc6ce
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fs/reiserfs/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,13 @@ static int add_to_chunk(struct buffer_chunk *chunk, struct buffer_head *bh,
chunk->bh[chunk->nr++] = bh;
if (chunk->nr >= CHUNK_SIZE) {
ret = 1;
if (lock)
if (lock) {
spin_unlock(lock);
fn(chunk);
if (lock)
fn(chunk);
spin_lock(lock);
} else {
fn(chunk);
}
}
return ret;
}
Expand Down

0 comments on commit 54cc6ce

Please sign in to comment.