Skip to content

Commit 54cc6ce

Browse files
Fabian Fredericktorvalds
authored andcommitted
fs/reiserfs/journal.c: fix sparse context imbalance warning
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 <fabf@skynet.be> Cc: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 35c0b38 commit 54cc6ce

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎fs/reiserfs/journal.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,13 @@ static int add_to_chunk(struct buffer_chunk *chunk, struct buffer_head *bh,
699699
chunk->bh[chunk->nr++] = bh;
700700
if (chunk->nr >= CHUNK_SIZE) {
701701
ret = 1;
702-
if (lock)
702+
if (lock) {
703703
spin_unlock(lock);
704-
fn(chunk);
705-
if (lock)
704+
fn(chunk);
706705
spin_lock(lock);
706+
} else {
707+
fn(chunk);
708+
}
707709
}
708710
return ret;
709711
}

0 commit comments

Comments
 (0)