aboutsummaryrefslogtreecommitdiff
path: root/fs/jbd2/journal.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2016-01-14 22:25:14 +0800
committerAlex Shi <alex.shi@linaro.org>2016-01-14 22:25:14 +0800
commitf90ae1b62bedd8b57966a7be68855f2d43170db6 (patch)
treedc332d18219749a17b163d740b8713be5e8d940b /fs/jbd2/journal.c
parent346a8beb760237fb0fed811045ec92c799f48d54 (diff)
parent60917545df1ffc7f918550512dc4a14758f74784 (diff)
Merge remote-tracking branch 'lts/linux-3.18.y' into linux-linaro-lsk-v3.18lsk-v3.18-16.01
Diffstat (limited to 'fs/jbd2/journal.c')
-rw-r--r--fs/jbd2/journal.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index be6f7178d23a..2540324f084b 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1708,8 +1708,17 @@ int jbd2_journal_destroy(journal_t *journal)
while (journal->j_checkpoint_transactions != NULL) {
spin_unlock(&journal->j_list_lock);
mutex_lock(&journal->j_checkpoint_mutex);
- jbd2_log_do_checkpoint(journal);
+ err = jbd2_log_do_checkpoint(journal);
mutex_unlock(&journal->j_checkpoint_mutex);
+ /*
+ * If checkpointing failed, just free the buffers to avoid
+ * looping forever
+ */
+ if (err) {
+ jbd2_journal_destroy_checkpoint(journal);
+ spin_lock(&journal->j_list_lock);
+ break;
+ }
spin_lock(&journal->j_list_lock);
}