Skip to content

Commit

Permalink
jbd2: use GFP_NOFS for blkdev_issue_flush
Browse files Browse the repository at this point in the history
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: Shaohua Li <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Cc: [email protected]
  • Loading branch information
Shaohua Li authored and tytso committed Apr 24, 2012
1 parent 57f73c2 commit 99aa784
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/jbd2/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
if (JBD2_HAS_INCOMPAT_FEATURE(journal,
Expand Down Expand Up @@ -859,7 +859,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
if (JBD2_HAS_INCOMPAT_FEATURE(journal,
JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT) &&
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)
Expand Down

0 comments on commit 99aa784

Please sign in to comment.