All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
To: dsterba@suse.cz
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: image: fix compiler warning
Date: Fri, 7 Oct 2016 11:40:45 +0900	[thread overview]
Message-ID: <07aaf0c2-4130-c92a-c17d-29214d56cb31@jp.fujitsu.com> (raw)
In-Reply-To: <20161006160045.GK6576@twin.jikos.cz>

On 2016/10/07 1:00, David Sterba wrote:
> On Wed, Oct 05, 2016 at 05:07:48PM +0900, Tsutomu Itoh wrote:
>> In v4.8-rc1, gcc 5.3.1 gives following warning. Fixed it.
>>
>>     [CC]     btrfs-image.o
>> btrfs-image.c: In function 'flush_pending':
>> btrfs-image.c:708:17: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized]
>>   header->bytenr = cpu_to_le64(start);
>>                  ^
>> btrfs-image.c:927:6: note: 'start' was declared here
>>   u64 start;
>>       ^
> 
> So the patch makes the compiler warning go away, but is the code
> correct? AFAICS, the warning points to the case where flush_pending is
> called with done=1 (from create_metadump) and there's zero
> md->pending_size . Are you sure this is an expected state and that the
> function can proceed with state = 0 ?
> 

I think that this is a case where some errors occurred before calling
flush_pending.
Therefore, create_metadump returns the error to the caller. (creating
the image fails, I think.)

Thanks,
Tsutomu


      reply	other threads:[~2016-10-07  2:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-05  8:07 [PATCH] btrfs-progs: image: fix compiler warning Tsutomu Itoh
2016-10-06 16:00 ` David Sterba
2016-10-07  2:40   ` Tsutomu Itoh [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=07aaf0c2-4130-c92a-c17d-29214d56cb31@jp.fujitsu.com \
    --to=t-itoh@jp.fujitsu.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.