public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: fdmanana@kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix uninitialized return value from btrfs_reclaim_sweep()
Date: Tue, 27 Aug 2024 06:57:14 -0400	[thread overview]
Message-ID: <20240827105714.GA2466167@perftesting> (raw)
In-Reply-To: <e6fea9cb64a7c98b4f83e2fd75de31a1475fce28.1724755223.git.fdmanana@suse.com>

On Tue, Aug 27, 2024 at 11:41:19AM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> The return variable 'ret' at btrfs_reclaim_sweep() is never assigned if
> none of the space infos is reclaimable (for example if periodic reclaim
> is disabled, which is the default), so we return an undefined value.
> 
> This can be fixed my making btrfs_reclaim_sweep() not return any value
> as well as do_reclaim_sweep() because:
> 
> 1) do_reclaim_sweep() always returns 0, so we can make it return void;
> 
> 2) The only caller of btrfs_reclaim_sweep() (btrfs_reclaim_bgs()) doesn't
>    care about its return value, and in its context there's nothing to do
>    about any errors anyway.
> 
> Therefore return the return value from btrfs_reclaim_sweep() and
> do_reclaim_sweep().
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef

      parent reply	other threads:[~2024-08-27 10:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 10:41 [PATCH] btrfs: fix uninitialized return value from btrfs_reclaim_sweep() fdmanana
2024-08-27 10:43 ` Filipe Manana
2024-08-27 10:57 ` Josef Bacik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240827105714.GA2466167@perftesting \
    --to=josef@toxicpanda.com \
    --cc=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox