Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
__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);