]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: clear defrag status of a root if starting transaction fails
authorDavid Sterba <dsterba@suse.com>
Tue, 7 Jul 2020 16:30:06 +0000 (18:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:15:40 +0000 (16:15 +0200)
commite00c01b74add2dfa6947c1cefc74760e560dbf55
tree7f7910d3b8aeb8ea6944110d614065859e393545
parentce3986380a1084e78f0831610b8d587d57642e43
btrfs: clear defrag status of a root if starting transaction fails

commit 6819703f5a365c95488b07066a8744841bf14231 upstream.

The defrag loop processes leaves in batches and starting transaction for
each. The whole defragmentation on a given root is protected by a bit
but in case the transaction fails, the bit is not cleared

In case the transaction fails the bit would prevent starting
defragmentation again, so make sure it's cleared.

CC: stable@vger.kernel.org # 4.4+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/transaction.c