btrfsprogs/0119-mkfs.btrfs-return-some-defined-value-instead-of-garb.patch
Dirk Mueller a0e284e535 - add support for currently available kernel features:
- add scrub subcommand
  - scan /proc/partitions by default (or use --all-devices for all)
  - mkfs fixes and improvements
  - documentation fixes

- update from git:
  - add btrfs-select-super utility
  - add btrfs-label utility
  - allow mixed data+metadata (option --mixed)
  - allow populating new filesystem with files (option --rootdir)
  - allow discard support in mkfs
  - lzo support
  - deprecate 'btrfsctl' 'btrfs-vol' 'btrfs-show'
  - other bugfixes and documentation improvements

OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=104
2011-07-13 14:48:36 +00:00

50 lines
1.6 KiB
Diff

From e97ed92c902fdfb456d7e21e05692354804f2113 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sat, 4 Jun 2011 11:19:19 +0300
Subject: [PATCH 19/28] mkfs.btrfs: return some defined value instead of
garbage when lookup checksum
==31873== Command: ./mkfs.btrfs -r /some/root/
==31873== Parent PID: 31872
==31873==
==31873== Conditional jump or move depends on uninitialised value(s)
==31873== at 0x42C3D0: add_file_items (mkfs.c:792)
==31873== by 0x42CAB3: traverse_directory (mkfs.c:948)
==31873== by 0x42CF11: make_image (mkfs.c:1047)
==31873== by 0x42DE53: main (mkfs.c:1401)
==31873== Uninitialised value was created by a stack allocation
==31873== at 0x41B1B1: btrfs_csum_file_block (file-item.c:195)
'ret' value was not initialized for 'found' branch.
The same fix sits in kernel:
> commit 639cb58675ce9b507eed9c3d6b3335488079b21a
> Author: Chris Mason <chris.mason@oracle.com>
> Date: Thu Aug 28 06:15:25 2008 -0400
>
> Btrfs: Fix variable init during csum creation
>
> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
---
file-item.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/file-item.c b/file-item.c
index 9732282..47f6ad2 100644
--- a/file-item.c
+++ b/file-item.c
@@ -218,6 +218,7 @@ int btrfs_csum_file_block(struct btrfs_trans_handle *trans,
item = btrfs_lookup_csum(trans, root, path, bytenr, 1);
if (!IS_ERR(item)) {
leaf = path->nodes[0];
+ ret = 0;
goto found;
}
ret = PTR_ERR(item);
--
1.7.5.2.353.g5df3e