1
0
Fork 0
alistair23-linux/fs/btrfs
Mark Fasheh 0678b61851 btrfs: Don't BUG_ON kzalloc error in btrfs_lookup_csums_range()
Unfortunately it isn't enough to just exit here - the kzalloc() happens in a
loop and the allocated items are added to a linked list whose head is passed
in from the caller.

To fix the BUG_ON() and also provide the semantic that the list passed in is
only modified on success, I create function-local temporary list that we add
items too. If no error is met, that list is spliced to the callers at the
end of the function. Otherwise the list will be walked and all items freed
before the error value is returned.

I did a simple test on this patch by forcing an error at the kzalloc() point
and verifying that when this hits (git clone seemed to exercise this), the
function throws the proper error. Unfortunately but predictably, we later
hit a BUG_ON(ret) type line that still hasn't been fixed up ;)

Signed-off-by: Mark Fasheh <mfasheh@suse.com>
2012-03-22 01:45:37 +01:00
..
Kconfig Btrfs: add config option to enable btrfs integrity check 2011-12-21 19:14:16 +01:00
Makefile Merge branch 'integrity-check-patch-v2' of git://btrfs.giantdisaster.de/git/btrfs into integration 2012-01-16 15:27:58 -05:00
acl.c Btrfs: fix return value of btrfs_get_acl() 2011-10-20 18:10:47 +02:00
async-thread.c btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
async-thread.h btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
backref.c btrfs: fix locking issues in find_parent_nodes() 2012-03-03 07:41:15 -05:00
backref.h Btrfs: added btrfs_find_all_roots() 2012-01-04 16:26:38 +01:00
btrfs_inode.h Btrfs: add a delalloc mutex to inodes for delalloc reservations 2012-01-16 15:29:43 -05:00
check-integrity.c Btrfs: fix compiler warnings on 32 bit systems 2012-02-24 10:39:05 -05:00
check-integrity.h Btrfs: add optional integrity check code 2011-12-21 19:14:09 +01:00
compat.h Btrfs: drop remaining LINUX_KERNEL_VERSION checks and compat code 2009-01-06 09:38:55 -05:00
compression.c btrfs: drop gfp_t from lock_extent 2012-03-22 01:45:35 +01:00
compression.h btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
ctree.c btrfs: Don't BUG_ON() errors in update_ref_for_cow() 2012-03-22 01:45:36 +01:00
ctree.h btrfs: btrfs_drop_snapshot should return int 2012-03-22 01:45:36 +01:00
delayed-inode.c btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
delayed-inode.h atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
delayed-ref.c btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
delayed-ref.h Btrfs: add waitqueue instead of doing busy waiting for more delayed refs 2012-01-04 16:12:48 +01:00
dir-item.c btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
disk-io.c btrfs: drop gfp_t from lock_extent 2012-03-22 01:45:35 +01:00
disk-io.h btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
export.c btrfs: let ->s_fs_info point to fs_info, not root... 2012-01-08 19:35:37 -05:00
export.h NFS support for btrfs - v3 2008-09-25 11:04:06 -04:00
extent-tree.c btrfs: btrfs_drop_snapshot should return int 2012-03-22 01:45:36 +01:00
extent_io.c btrfs: split extent_state ops 2012-03-22 01:45:35 +01:00
extent_io.h btrfs: split extent_state ops 2012-03-22 01:45:35 +01:00
extent_map.c Btrfs: clean up code for merging extent maps 2011-08-01 14:30:50 -04:00
extent_map.h btrfs: fix structs where bitfields and spinlock/atomic share 8B word 2012-02-15 16:40:25 +01:00
file-item.c btrfs: Don't BUG_ON kzalloc error in btrfs_lookup_csums_range() 2012-03-22 01:45:37 +01:00
file.c btrfs: drop gfp_t from lock_extent 2012-03-22 01:45:35 +01:00
free-space-cache.c btrfs: drop gfp_t from lock_extent 2012-03-22 01:45:35 +01:00
free-space-cache.h btrfs: remove all unused functions 2011-05-06 12:34:03 +02:00
hash.h Btrfs: remove crc32c.h and use libcrc32c directly. 2009-06-10 11:29:53 -04:00
inode-item.c btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
inode-map.c Btrfs: fix compiler warnings on 32 bit systems 2012-02-24 10:39:05 -05:00
inode-map.h Btrfs: Support reading/writing on disk free ino cache 2011-04-25 16:46:11 +08:00
inode.c btrfs: Don't BUG_ON errors from btrfs_create_subvol_root() 2012-03-22 01:45:36 +01:00
ioctl.c btrfs: Don't BUG_ON errors from btrfs_create_subvol_root() 2012-03-22 01:45:36 +01:00
ioctl.h Btrfs: add balance progress reporting 2012-01-16 22:04:49 +02:00
locking.c btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
locking.h btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
lzo.c Btrfs: Avoid accessing unmapped kernel address 2011-02-16 15:37:58 -05:00
ordered-data.c btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
ordered-data.h btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
orphan.c Btrfs: fixup return code for btrfs_del_orphan_item 2010-12-09 13:57:15 -05:00
print-tree.c btrfs: fix oops on failure path 2011-10-20 18:10:50 +02:00
print-tree.h Btrfs: Create extent_buffer interface for large blocksizes 2008-09-25 11:03:56 -04:00
reada.c Btrfs: fix casting error in scrub reada code 2012-03-03 07:42:35 -05:00
relocation.c btrfs: btrfs_drop_snapshot should return int 2012-03-22 01:45:36 +01:00
root-tree.c btrfs: btrfs_update_root error push-up 2012-03-22 01:45:33 +01:00
scrub.c btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
struct-funcs.c Btrfs: stop using highmem for extent_buffers 2011-07-27 12:46:45 -04:00
super.c btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
sysfs.c btrfs: Remove unused sysfs code 2011-06-17 14:54:18 -04:00
transaction.c btrfs: btrfs_drop_snapshot should return int 2012-03-22 01:45:36 +01:00
transaction.h Merge branch 'for-chris' of 2011-05-28 07:00:39 -04:00
tree-defrag.c btrfs: drop unused parameter from btrfs_release_path 2011-05-02 13:57:22 +02:00
tree-log.c btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
tree-log.h btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
ulist.c Btrfs: generic data structure to build unique lists 2011-12-22 16:22:24 +01:00
ulist.h Btrfs: generic data structure to build unique lists 2011-12-22 16:22:24 +01:00
version.h Update Btrfs files for in-kernel usage 2008-09-25 15:41:59 -04:00
volumes.c btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
volumes.h btrfs: return void in functions without error conditions 2012-03-22 01:45:34 +01:00
xattr.c Btrfs: do not use btrfs_end_transaction_throttle everywhere 2012-01-16 15:28:54 -05:00
xattr.h fs/vfs/security: pass last path component to LSM on inode creation 2011-02-01 11:12:29 -05:00
zlib.c zlib: slim down zlib_deflate() workspace when possible 2011-03-22 17:44:17 -07:00