From: Linus Torvalds Date: Mon, 7 Feb 2011 22:06:18 +0000 (-0800) Subject: Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable X-Git-Tag: v2.6.38-rc4~2 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=cb5520f02c010e3cb974b9ac06f30aafa2eebc38 Merge git://git./linux/kernel/git/mason/btrfs-unstable * git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (33 commits) Btrfs: Fix page count calculation btrfs: Drop __exit attribute on btrfs_exit_compress btrfs: cleanup error handling in btrfs_unlink_inode() Btrfs: exclude super blocks when we read in block groups Btrfs: make sure search_bitmap finds something in remove_from_bitmap btrfs: fix return value check of btrfs_start_transaction() btrfs: checking NULL or not in some functions Btrfs: avoid uninit variable warnings in ordered-data.c Btrfs: catch errors from btrfs_sync_log Btrfs: make shrink_delalloc a little friendlier Btrfs: handle no memory properly in prepare_pages Btrfs: do error checking in btrfs_del_csums Btrfs: use the global block reserve if we cannot reserve space Btrfs: do not release more reserved bytes to the global_block_rsv than we need Btrfs: fix check_path_shared so it returns the right value btrfs: check return value of btrfs_start_ioctl_transaction() properly btrfs: fix return value check of btrfs_join_transaction() fs/btrfs/inode.c: Add missing IS_ERR test btrfs: fix missing break in switch phrase btrfs: fix several uncheck memory allocations ... --- cb5520f02c010e3cb974b9ac06f30aafa2eebc38 diff --cc fs/btrfs/volumes.c index d158530233b7,7cad59353b09..2636a051e4b2 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@@ -1606,8 -1608,15 +1610,14 @@@ int btrfs_init_new_device(struct btrfs_ } trans = btrfs_start_transaction(root, 0); + if (IS_ERR(trans)) { + kfree(device); + ret = PTR_ERR(trans); + goto error; + } + lock_chunks(root); - device->barriers = 1; device->writeable = 1; device->work.func = pending_bios_fn; generate_random_uuid(device->uuid);