Skip to content

Commit 99aa784

Browse files
Shaohua Litytso
authored andcommitted
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: Shaohua Li <shli@fusionio.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz> Cc: stable@vger.kernel.org
1 parent 57f73c2 commit 99aa784

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
@@ -723,7 +723,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
723723
if (commit_transaction->t_need_data_flush &&
724724
(journal->j_fs_dev != journal->j_dev) &&
725725
(journal->j_flags & JBD2_BARRIER))
726-
blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL);
726+
blkdev_issue_flush(journal->j_fs_dev, GFP_NOFS, NULL);
727727

728728
/* Done it all: now write the commit record asynchronously. */
729729
if (JBD2_HAS_INCOMPAT_FEATURE(journal,
@@ -859,7 +859,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
859859
if (JBD2_HAS_INCOMPAT_FEATURE(journal,
860860
JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT) &&
861861
journal->j_flags & JBD2_BARRIER) {
862-
blkdev_issue_flush(journal->j_dev, GFP_KERNEL, NULL);
862+
blkdev_issue_flush(journal->j_dev, GFP_NOFS, NULL);
863863
}
864864

865865
if (err)

0 commit comments

Comments
 (0)