On Tue, Jan 8, 2019 at 4:14 PM David Sterba <dste...@suse.cz> wrote: > > On Tue, Jan 08, 2019 at 11:44:41AM +0000, fdman...@kernel.org wrote: > > From: Filipe Manana <fdman...@suse.com> > > > > When modifying the free space tree we can end up COWing one of its extent > > buffers which in turn might result in allocating a new chunk, which in > > turn can result in flushing (finish creation) of pending block groups. If > > that happens we can deadlock because creating a pending block group needs > > to update the free space tree, and if any of the updates tries to modify > > the same extent buffer that we are COWing, we end up in a deadlock since > > we try to write lock twice the same extent buffer. > > > > So fix this by skipping pending block group creation if we are COWing an > > extent buffer from the free space tree. This is a case missed by commit > > 5ce555578e091 ("Btrfs: fix deadlock when writing out free space caches"). > > > > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202173 > > Fixes: 5ce555578e091 ("Btrfs: fix deadlock when writing out free space > > caches > > Signed-off-by: Filipe Manana <fdman...@suse.com> > > Lighweight Reviewed-by, as the bug is in 4.19.x I'm going to push the > fix to 5.0. Thanks.
The bug is in any kernel with free space tree support. In order to fix it (apply this patch), the commit mentioned in the Fixes tag is a dependency (it's not regression from that commit, it simply didn't fix that case).