OSDN Git Service

Merge tag 'v4.4.214' into 10
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / fs / btrfs / extent_io.c
index 7a5e263..9ab5056 100644 (file)
@@ -4153,6 +4153,14 @@ retry:
                 */
                scanned = 1;
                index = 0;
+
+               /*
+                * If we're looping we could run into a page that is locked by a
+                * writer and that writer could be waiting on writeback for a
+                * page in our current bio, and thus deadlock, so flush the
+                * write bio here.
+                */
+               flush_write_bio(data);
                goto retry;
        }
        btrfs_add_delayed_iput(inode);