Skip to content

Commit 34d1eb0

Browse files
josefbacikkdave
authored andcommitted
btrfs: don't clear ret in btrfs_start_dirty_block_groups
If we fail to update a block group item in the loop we'll break, however we'll do btrfs_run_delayed_refs and lose our error value in ret, and thus not clean up properly. Fix this by only running the delayed refs if there was no failure. CC: stable@vger.kernel.org # 4.4+ Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent fb28610 commit 34d1eb0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/btrfs/block-group.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2669,7 +2669,8 @@ int btrfs_start_dirty_block_groups(struct btrfs_trans_handle *trans)
26692669
* Go through delayed refs for all the stuff we've just kicked off
26702670
* and then loop back (just once)
26712671
*/
2672-
ret = btrfs_run_delayed_refs(trans, 0);
2672+
if (!ret)
2673+
ret = btrfs_run_delayed_refs(trans, 0);
26732674
if (!ret && loops == 0) {
26742675
loops++;
26752676
spin_lock(&cur_trans->dirty_bgs_lock);

0 commit comments

Comments
 (0)