提交 34d1eb0e 编写于 作者: J Josef Bacik 提交者: David Sterba

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: NQu Wenruo <wqu@suse.com>
Reviewed-by: NJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: NJosef Bacik <josef@toxicpanda.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 fb286100
...@@ -2669,7 +2669,8 @@ int btrfs_start_dirty_block_groups(struct btrfs_trans_handle *trans) ...@@ -2669,7 +2669,8 @@ int btrfs_start_dirty_block_groups(struct btrfs_trans_handle *trans)
* Go through delayed refs for all the stuff we've just kicked off * Go through delayed refs for all the stuff we've just kicked off
* and then loop back (just once) * and then loop back (just once)
*/ */
ret = btrfs_run_delayed_refs(trans, 0); if (!ret)
ret = btrfs_run_delayed_refs(trans, 0);
if (!ret && loops == 0) { if (!ret && loops == 0) {
loops++; loops++;
spin_lock(&cur_trans->dirty_bgs_lock); spin_lock(&cur_trans->dirty_bgs_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册