1 jbd2: fix checkpoint list cleanup
3 From: Jan Kara <jack@suse.com>
5 Unlike comments and expectation of callers journal_clean_one_cp_list()
6 returned 1 not only if it freed the transaction but also if it freed
7 some buffers in the transaction. That could make
8 __jbd2_journal_clean_checkpoint_list() skip processing
9 t_checkpoint_io_list and continue with processing the next transaction.
10 This is mostly a cosmetic issue since the only result is we can
11 sometimes free less memory than we could. But it's still worth fixing.
12 Fix journal_clean_one_cp_list() to return 1 only if the transaction was
15 Fixes: 50849db32a9f529235a84bcc84a6b8e631b1d0ec
16 Signed-off-by: Jan Kara <jack@suse.com>
17 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
18 Cc: stable@vger.kernel.org
20 fs/jbd2/checkpoint.c | 8 +++-----
21 1 file changed, 3 insertions(+), 5 deletions(-)
23 diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c
24 index 8c44654ce274..684996c8a3a4 100644
25 --- a/fs/jbd2/checkpoint.c
26 +++ b/fs/jbd2/checkpoint.c
27 @@ -427,7 +427,6 @@ static int journal_clean_one_cp_list(struct journal_head *jh, bool destroy)
28 struct journal_head *last_jh;
29 struct journal_head *next_jh = jh;
35 @@ -441,10 +440,9 @@ static int journal_clean_one_cp_list(struct journal_head *jh, bool destroy)
37 ret = __jbd2_journal_remove_checkpoint(jh) + 1;
45 * This function only frees up some memory
46 * if possible so we dont have an obligation
47 @@ -452,10 +450,10 @@ static int journal_clean_one_cp_list(struct journal_head *jh, bool destroy)
53 } while (jh != last_jh);