From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: Fix uninitialized ret in btrfsic_process_superblock_dev_mirror
Date: Mon, 24 Feb 2020 14:57:00 +0200 [thread overview]
Message-ID: <e51b2144-a4a1-2c10-3bf8-991a1347dbc9@suse.com> (raw)
In-Reply-To: <20200224125628.27121-1-nborisov@suse.com>
On 24.02.20 г. 14:56 ч., Nikolay Borisov wrote:
> We could return ret uninitlaized in case of success. Before the code was
> returning 0 explicitly in case of success but now it will be a random value from
> the stack. That's due to ret being set only in error conditions.
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
This ideally has to be folded in:
5a03d907a555 ("btrfs: remove buffer_heads form super block mirror
integrity checking")
> ---
> fs/btrfs/check-integrity.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c
> index 23dd65e1c5e3..85b27e9742c8 100644
> --- a/fs/btrfs/check-integrity.c
> +++ b/fs/btrfs/check-integrity.c
> @@ -766,7 +766,7 @@ static int btrfsic_process_superblock_dev_mirror(
> struct block_device *const superblock_bdev = device->bdev;
> struct page *page;
> struct address_space *mapping = superblock_bdev->bd_inode->i_mapping;
> - int ret;
> + int ret = 0;
>
> /* super block bytenr is always the unmapped device bytenr */
> dev_bytenr = btrfs_sb_offset(superblock_mirror_num);
> --
> 2.17.1
>
next prev parent reply other threads:[~2020-02-24 12:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-24 12:56 [PATCH] btrfs: Fix uninitialized ret in btrfsic_process_superblock_dev_mirror Nikolay Borisov
2020-02-24 12:57 ` Nikolay Borisov [this message]
2020-02-24 15:16 ` David Sterba
2020-02-24 13:00 ` Qu Wenruo
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=e51b2144-a4a1-2c10-3bf8-991a1347dbc9@suse.com \
--to=nborisov@suse.com \
--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