lkml.org 
[lkml]   [2021]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.4 09/86] btrfs: dont clear ret in btrfs_start_dirty_block_groups
    Date
    From: Josef Bacik <josef@toxicpanda.com>

    commit 34d1eb0e599875064955a74712f08ff14c8e3d5f upstream.

    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>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/btrfs/block-group.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    --- a/fs/btrfs/block-group.c
    +++ b/fs/btrfs/block-group.c
    @@ -2497,7 +2497,8 @@ again:
    * Go through delayed refs for all the stuff we've just kicked off
    * 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) {
    loops++;
    spin_lock(&cur_trans->dirty_bgs_lock);

    \
     
     \ /
      Last update: 2021-01-25 19:56    [W:4.124 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site