OSDN Git Service

jbd2: fix checkpoint list cleanup
authorJan Kara <jack@suse.com>
Sun, 18 Oct 2015 02:35:09 +0000 (22:35 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 18 Oct 2015 02:35:09 +0000 (22:35 -0400)
commit33d14975e5ac469963d5d63856b61698ad0bff07
treefaa2e7fab1cc1284ab2bc8537464707d5a61c4c1
parent9c02ac97989d544c89f049e8add7149aaea01671
jbd2: fix checkpoint list cleanup

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>
Cc: stable@vger.kernel.org
fs/jbd2/checkpoint.c