From: Jan Kara <jack@suse.cz>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Theodore Ts'o <tytso@mit.edu>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] ext4 updates for 3.11
Date: Tue, 2 Jul 2013 20:04:47 +0200 [thread overview]
Message-ID: <20130702180447.GB16282@quack.suse.cz> (raw)
In-Reply-To: <CA+55aFyRLc81s03ULLZ26N0qwRqxS-9+6XpyhxVH62qx2b5o2A@mail.gmail.com>
On Tue 02-07-13 10:18:32, Linus Torvalds wrote:
> Hmm I'm getting this compiler warning:
>
> fs/ext4/inode.c: In function ‘ext4_writepages’:
> fs/ext4/inode.c:2219:6: warning: ‘err’ may be used uninitialized in
> this function [-Wmaybe-uninitialized]
>
> and I think the compiler is right to warn. The 'err' variable is set
> inside a whilte() and an if() statement, and it is not at all obvious
> that those codepaths are always taken.
>
> Maybe that "map->m_len" is always guaranteed to be nonzero, and the
> "while()" statement could be a "do { } while()" one. But if so, make
> it so, don't write code as if it might never be executed, when the
> return value seems to *depend* on it being executed.
That's caused by my patches (only for certain gcc versions). map->m_len
is guaranteed to be > 0 in the first iteration (the function is called from
under if (map->m_len > 0)). I though Ted silenced that warning but
apparently he did not. The cleanest fix is likely to make a do-while loop
from that one. I'll send Ted a patch for that.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-07-02 18:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-01 13:55 [GIT PULL] ext4 updates for 3.11 Theodore Ts'o
2013-07-02 17:18 ` Linus Torvalds
2013-07-02 18:04 ` Jan Kara [this message]
2013-07-02 23:41 ` Stephen Rothwell
2013-07-03 11:35 ` Theodore Ts'o
2013-07-03 16:09 ` Linus Torvalds
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=20130702180447.GB16282@quack.suse.cz \
--to=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
/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