diff options
author | David Sterba <dsterba@suse.cz> | 2011-06-03 10:29:08 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-06-04 08:11:38 -0400 |
commit | aa0467d8d2a00e75b2bb6a56a4ee6d70c5d1928f (patch) | |
tree | 0139c403353d9e1ab771fc7c9049e5c334329d17 /fs/btrfs | |
parent | 7841cb2898f66a73062c64d0ef5733dde7279e46 (diff) |
btrfs: fix uninitialized variable warning
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | 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 c61c32cf0f71..6462c29d2d37 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, | |||
1595 | struct btrfs_root *root, struct inode *inode) | 1595 | struct btrfs_root *root, struct inode *inode) |
1596 | { | 1596 | { |
1597 | struct btrfs_delayed_node *delayed_node; | 1597 | struct btrfs_delayed_node *delayed_node; |
1598 | int ret; | 1598 | int ret = 0; |
1599 | 1599 | ||
1600 | delayed_node = btrfs_get_or_create_delayed_node(inode); | 1600 | delayed_node = btrfs_get_or_create_delayed_node(inode); |
1601 | if (IS_ERR(delayed_node)) | 1601 | if (IS_ERR(delayed_node)) |