]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/btrfs/extent_io.c
btrfs: flush write bio if we loop in extent_write_cache_pages
[mirror_ubuntu-bionic-kernel.git] / fs / btrfs / extent_io.c
index 5faad4873860287eb2db06a8a40d5b36dfdbe33f..08e8dcca49df5c21d6cb7aa1450804ddd02c7e5f 100644 (file)
@@ -4020,6 +4020,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;
        }