All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <dsterba@suse.cz>, David Sterba <dsterba@suse.com>,
	<linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: use proper type for failrec in extent_state
Date: Tue, 23 Feb 2016 10:06:59 +0800	[thread overview]
Message-ID: <56CBBEC3.8040106@cn.fujitsu.com> (raw)
In-Reply-To: <20160222175837.GH4374@twin.jikos.cz>



David Sterba wrote on 2016/02/22 18:58 +0100:
> On Thu, Feb 11, 2016 at 01:24:13PM +0100, David Sterba wrote:
>> We use the private member of extent_state to store the failrec and play
>> pointless pointer games.
>>
>> Signed-off-by: David Sterba <dsterba@suse.com>
>
> I'm not sure why, but my gcc 5.3.1 think's that a member of failrec can
> be used uninitialized:
>
>    CC [M]  fs/btrfs/extent_io.o
> fs/btrfs/extent_io.c: In function ‘clean_io_failure’:
> fs/btrfs/extent_io.c:2133:4: warning: ‘failrec’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>      repair_io_failure(inode, start, failrec->len,
>      ^
>
After applying your patch on integration-4.6, and compiling, my gcc 
5.3.0 didn't give such warning though.

And I didn't see an official 5.3.1, but only 5.3 so I assume maybe it's 
related to the .1 from your distribution?
(As my gcc is from Archlinux, I assume minimally patched)

Thanks,
Qu

> which points to:
>
> 2126         if (state && state->start <= failrec->start &&
> 2127             state->end >= failrec->start + failrec->len - 1) {
> 2128                 num_copies = btrfs_num_copies(fs_info, failrec->logical,
> 2129                                               failrec->len);
> 2130                 if (num_copies > 1)  {
> 2131                         repair_io_failure(inode, start, failrec->len,
> 2132                                           failrec->logical, page,
> 2133                                           pg_offset, failrec->failed_mirror);
> 2134                 }
> 2135         }
>
> After separating all members to local varaibles, it points to ->len. Which is
> used several times in code above.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>



  reply	other threads:[~2016-02-23  2:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-11 12:24 [PATCH] btrfs: use proper type for failrec in extent_state David Sterba
2016-02-22 17:58 ` David Sterba
2016-02-23  2:06   ` Qu Wenruo [this message]
2016-02-23 11:34     ` David Sterba

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=56CBBEC3.8040106@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.