summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2012-09-04 10:44:49 +0200
committerMyungJoo Ham <myungjoo.ham@samsung.com>2013-11-15 13:50:23 +0900
commit429ab036e5b0de2292a4b2c207acde3bd436092a (patch)
treea92a494055103ff31d3e223731d77d62ade3e1f0
parentfd0079387c13066ea0ef1f9d6f7f863fd16cc69f (diff)
downloadlinux-3.10-429ab036e5b0de2292a4b2c207acde3bd436092a.tar.gz
linux-3.10-429ab036e5b0de2292a4b2c207acde3bd436092a.tar.bz2
linux-3.10-429ab036e5b0de2292a4b2c207acde3bd436092a.zip
fs: jbd2: force commit to free jbd2's cma/isolated page
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
-rw-r--r--fs/jbd2/transaction.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index e0c0bc27592..ca188f536c3 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -1776,8 +1776,22 @@ int jbd2_journal_try_to_free_buffers(journal_t *journal,
__journal_try_to_free_buffer(journal, bh);
jbd2_journal_put_journal_head(jh);
jbd_unlock_bh_state(bh);
+
+#ifndef CONFIG_CMA
if (buffer_jbd(bh))
goto busy;
+#else
+ if (buffer_jbd(bh)) {
+ unsigned mt = get_pageblock_migratetype(page);
+ /*
+ * Workaround: In case of CMA page, just commit journal.
+ */
+ if (mt == MIGRATE_ISOLATE || mt == MIGRATE_CMA)
+ jbd2_journal_force_commit(journal);
+ else
+ goto busy;
+ }
+#endif
} while ((bh = bh->b_this_page) != head);
ret = try_to_free_buffers(page);