lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 2 Aug 2017 12:54:25 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Ross Zwisler <ross.zwisler@...ux.intel.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Dan Williams <dan.j.williams@...el.com>,
        Christoph Hellwig <hch@...radead.org>,
        Vishal Verma <vishal.l.verma@...el.com>,
        Toshi Kani <toshi.kani@....com>,
        Johannes Thumshirn <jthumshirn@...e.de>,
        linux-nvdimm@...ts.01.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] nvdimm: avoid bogus -Wmaybe-uninitialized warning

On Wed, Aug 2, 2017 at 12:23 AM, Ross Zwisler
<ross.zwisler@...ux.intel.com> wrote:
> On Tue, Aug 01, 2017 at 02:45:34PM -0700, Andrew Morton wrote:
>> On Tue,  1 Aug 2017 13:48:48 +0200 Arnd Bergmann <arnd@...db.de> wrote:
>> > --- a/drivers/nvdimm/nd.h
>> > +++ b/drivers/nvdimm/nd.h
>> > @@ -392,8 +392,10 @@ static inline bool nd_iostat_start(struct bio *bio, unsigned long *start)
>> >  {
>> >     struct gendisk *disk = bio->bi_bdev->bd_disk;
>> >
>> > -   if (!blk_queue_io_stat(disk->queue))
>> > +   if (!blk_queue_io_stat(disk->queue)) {
>> > +           *start = 0;
>> >             return false;
>> > +   }
>> >
>> >     *start = jiffies;
>> >     generic_start_io_acct(bio_data_dir(bio),
>>
>> Well that's sad.
>>
>> The future of btt-remove-btt_rw_page.patch and friends is shrouded in
>> mystery, but if we proceed that way then yes, I guess we'll need to
>> work around such gcc glitches.
>>
>> But let's not leave apparently-unneeded code in place without telling
>> people why it is in fact needed?
>
> Maybe it's just cleaner to initialize 'start' in all the callers, so we don't
> have a mysterious line and have to remember why it's there / comment it?

I considered that but decided that would be worse, since it shuts up more
potential warnings about actual uninitialized use of the variable, and is
slightly harder for the compiler to optimize away. You also end up having
to add a comment in multiple places. Note that Andrew already added
a comment when he applied my patch to his mmotm tree.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ