Btrfs: Only do async bio submission for pdflush
Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 9e41ea9..76ee7a4 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -381,6 +381,13 @@
{
struct async_submit_bio *async;
+ /*
+ * inline writerback should stay inline, only hop to the async
+ * queue if we're pdflush
+ */
+ if (!current_is_pdflush())
+ return submit_bio_hook(inode, rw, bio, mirror_num);
+
async = kmalloc(sizeof(*async), GFP_NOFS);
if (!async)
return -ENOMEM;