From: David Sterba <dave@jikos•cz>
To: Stephen Rothwell <sfr@canb•auug.org.au>
Cc: Chris Mason <chris.mason@oracle•com>,
linux-next@vger•kernel.org, linux-kernel@vger•kernel.org,
Miao Xie <miaox@cn•fujitsu.com>, David Sterba <dave@jikos•cz>,
Tsutomu Itoh <t-itoh@jp•fujitsu.com>,
Itaru Kitayama <kitayama@cl•bb4u.ne.jp>,
linux-btrfs@vger•kernel.org
Subject: [PATCH] btrfs: fix uninitialized variable warning
Date: Fri, 3 Jun 2011 16:50:14 +0200 [thread overview]
Message-ID: <20110603145014.GU12709@twin.jikos.cz> (raw)
In-Reply-To: <20110603110011.77121203.sfr@canb.auug.org.au>
From: David Sterba <dsterba@suse•cz>
With Linus' tree, today's linux-next build (powercp ppc64_defconfig)
produced this warning:
fs/btrfs/delayed-inode.c: In function 'btrfs_delayed_update_inode':
fs/btrfs/delayed-inode.c:1598:6: warning: 'ret' may be used
uninitialized in this function
Introduced by commit 16cdcec736cd ("btrfs: implement delayed inode items
operation").
This fixes a bug in btrfs_update_inode(): if the returned value from
btrfs_delayed_update_inode is a nonzero garbage, inode stat data are not
updated and several call paths may hit a BUG_ON or fail with strange
code.
Reported-by: Stephen Rothwell <sfr@canb•auug.org.au>
Signed-off-by: David Sterba <dsterba@suse•cz>
---
patch pushed to git://repo.or.cz/linux-2.6/btrfs-unstable.git #fixes
fs/btrfs/delayed-inode.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index 01e2950..8cb012f 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -1595,7 +1595,7 @@ int btrfs_delayed_update_inode(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct inode *inode)
{
struct btrfs_delayed_node *delayed_node;
- int ret;
+ int ret = 0;
delayed_node = btrfs_get_or_create_delayed_node(inode);
if (IS_ERR(delayed_node))
--
1.7.5.2.353.g5df3e
next prev parent reply other threads:[~2011-06-03 14:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-03 1:00 linux-next: build warning from Linus' tree Stephen Rothwell
2011-06-03 14:50 ` David Sterba [this message]
2011-06-03 14:56 ` [PATCH] btrfs: fix uninitialized variable warning Chris Mason
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=20110603145014.GU12709@twin.jikos.cz \
--to=dave@jikos$(echo .)cz \
--cc=chris.mason@oracle$(echo .)com \
--cc=kitayama@cl$(echo .)bb4u.ne.jp \
--cc=linux-btrfs@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=miaox@cn$(echo .)fujitsu.com \
--cc=sfr@canb$(echo .)auug.org.au \
--cc=t-itoh@jp$(echo .)fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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