Skip to content

Commit f255436

Browse files
Shaohua Libwhacks
authored andcommitted
jbd2: use GFP_NOFS for blkdev_issue_flush
commit 99aa784 upstream. 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 <shli@fusionio.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
1 parent 31097a1 commit f255436

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎fs/jbd2/commit.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
683683
if (commit_transaction->t_need_data_flush &&
684684
(journal->j_fs_dev != journal->j_dev) &&
685685
(journal->j_flags & JBD2_BARRIER))
686-
blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL);
686+
blkdev_issue_flush(journal->j_fs_dev, GFP_NOFS, NULL);
687687

688688
/* Done it all: now write the commit record asynchronously. */
689689
if (JBD2_HAS_INCOMPAT_FEATURE(journal,
@@ -819,7 +819,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
819819
if (JBD2_HAS_INCOMPAT_FEATURE(journal,
820820
JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT) &&
821821
journal->j_flags & JBD2_BARRIER) {
822-
blkdev_issue_flush(journal->j_dev, GFP_KERNEL, NULL);
822+
blkdev_issue_flush(journal->j_dev, GFP_NOFS, NULL);
823823
}
824824

825825
if (err)

0 commit comments

Comments
 (0)