Commit 99aa7846 authored by Shaohua Li's avatar Shaohua Li Committed by Theodore Ts'o

jbd2: use GFP_NOFS for blkdev_issue_flush

flush request is issued in transaction commit code path, so looks using
GFP_KERNEL to allocate memory for flush request bio falls into the classic
deadlock issue.  I saw btrfs and dm get it right, but ext4, xfs and md are
using GFP.
Signed-off-by: default avatarShaohua Li <>
Signed-off-by: default avatarTheodore Ts'o <>
Reviewed-by: default avatarJan Kara <>
parent 57f73c2c
......@@ -723,7 +723,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
if (commit_transaction->t_need_data_flush &&
(journal->j_fs_dev != journal->j_dev) &&
(journal->j_flags & JBD2_BARRIER))
blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL);
blkdev_issue_flush(journal->j_fs_dev, GFP_NOFS, NULL);
/* Done it all: now write the commit record asynchronously. */
......@@ -859,7 +859,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
journal->j_flags & JBD2_BARRIER) {
blkdev_issue_flush(journal->j_dev, GFP_KERNEL, NULL);
blkdev_issue_flush(journal->j_dev, GFP_NOFS, NULL);
if (err)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment