jbd2: fix checkpoint list cleanup
authorJan Kara <jack@suse.com>
Sun, 18 Oct 2015 02:35:09 +0000 (22:35 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Feb 2016 22:28:27 +0000 (14:28 -0800)
commit95a2d5fb5516a6046962f0457f776e033959da40
tree5cc13c3098d0f46c584c743cdd920f0cfa6b8bf5
parentd8cbd6874edaeef44611425b4f3e8aebc4d7bb6a
jbd2: fix checkpoint list cleanup

commit 33d14975e5ac469963d5d63856b61698ad0bff07 upstream.

Unlike comments and expectation of callers journal_clean_one_cp_list()
returned 1 not only if it freed the transaction but also if it freed
some buffers in the transaction. That could make
__jbd2_journal_clean_checkpoint_list() skip processing
t_checkpoint_io_list and continue with processing the next transaction.
This is mostly a cosmetic issue since the only result is we can
sometimes free less memory than we could. But it's still worth fixing.
Fix journal_clean_one_cp_list() to return 1 only if the transaction was
really freed.

Fixes: 50849db32a9f529235a84bcc84a6b8e631b1d0ec
Signed-off-by: Jan Kara <jack@suse.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/jbd2/checkpoint.c