search for: btrfs_alloc_chunk

Displaying 8 results from an estimated 8 matches for "btrfs_alloc_chunk".

2013 Sep 05
3
[PATCH v2 0/3] btrfs-progs: prevent mkfs from aborting with small volume
Here are 3 patches to avoid undesired aborts of mkfs.btrfs. These are based on top of Chris''s btrfs-progs.git: git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git Thanks, H.Seto Hidetoshi Seto (3): btrfs-progs: error if device for mkfs is too small btrfs-progs: error if device have no space to make primary chunks btrfs-progs: calculate available
2013 Jun 08
0
[PATCH] Btrfs-progs: elaborate error handling of mkfs
$./mkfs.btrfs -f /dev/sdd -b 2M [...] mkfs.btrfs: volumes.c:845: btrfs_alloc_chunk: Assertion `!(ret)'' failed. Aborted (core dumped). We should return error to userspace instead of the above. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> --- mkfs.c | 23 +++++++++++++++-------- volumes.c | 16 +++++++++++----- 2 files changed, 26 insertions(+), 13 deletion...
2012 Mar 15
0
[PATCH] Btrfs: fix deadlock during allocating chunks
...p;& btrfs_test_opt(root, ENOSPC_DEBUG)) { + printk(KERN_INFO "left=%llu, need=%llu, flags=%llu\n", + left, thresh, type); + dump_space_info(info, 0, 0); + } + + if (left < thresh) { + u64 flags; + + flags = btrfs_get_alloc_profile(root->fs_info->chunk_root, 0); + btrfs_alloc_chunk(trans, root, flags); + } +} + static int do_chunk_alloc(struct btrfs_trans_handle *trans, struct btrfs_root *extent_root, u64 alloc_bytes, u64 flags, int force) @@ -3468,6 +3512,12 @@ again: force_metadata_allocation(fs_info); } + /* + * Check if we have enough space in SYSTEM...
2011 Nov 30
0
mkfs.btrfs failure on ARM
...sing mkfs.btrfs: volumes.c:1575: btrfs_read_chunk_tree: Assertion `!(ret)'' failed. A fresh clone gives me: ford:~/btrfs-progs# ./mkfs.btrfs /dev/vgroot/home WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL WARNING! - see http://btrfs.wiki.kernel.org before using mkfs.btrfs: volumes.c:846: btrfs_alloc_chunk: Assertion `!(ret)'' failed. Aborted Tested with gcc 4.4 and 4.6. I did a git bisect and ended up here: ford:~/btrfs-progs# git bisect bad 4e64e05c6b8d9a1ed30bb6eda30ef8e93c6af260 is the first bad commit commit 4e64e05c6b8d9a1ed30bb6eda30ef8e93c6af260 Author: Donggeun Kim <dg77.kim@sa...
2012 Jan 17
8
[RFC][PATCH 1/2] Btrfs: try to allocate new chunks with degenerated profile
...else if (flags & BTRFS_BLOCK_GROUP_RAID0) { + flags &= ~BTRFS_BLOCK_GROUP_RAID0; + } else + flags = ULLONG_MAX; + + return flags; +} + static u64 get_alloc_profile(struct btrfs_root *root, u64 flags) { if (flags & BTRFS_BLOCK_GROUP_DATA) @@ -3356,8 +3380,23 @@ again: } ret = btrfs_alloc_chunk(trans, extent_root, flags); - if (ret < 0 && ret != -ENOSPC) - goto out; + if (ret < 0) { + if (ret != -ENOSPC) + goto out; + + /* + * Degenerate the alloc profile: + * RAID10 -> RAID1 -> DUP + * RAID0 -> SINGLE + * then we will try to allocate new chunks aga...
2009 Nov 14
2
[PATCH] btrfs-progs: Check mount status of multidevice filesystems
...tree *map_tree, u64 chunk_start, u64 physical, u64 devid, u64 **logical, int *naddrs, int *stripe_len); int btrfs_read_sys_array(struct btrfs_root *root); -int btrfs_read_chunk_tree(struct btrfs_root *root); +int btrfs_read_chunk_tree(struct btrfs_root *root, int check_mount); int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, struct btrfs_root *extent_root, u64 *start, u64 *num_bytes, u64 type); -int btrfs_read_super_device(struct btrfs_root *root, struct extent_buffer *buf); +int btrfs_read_super_device(struct btrfs_root *root, struct extent_buffer *buf, int check_mou...
2012 Dec 13
22
[PATCH] Btrfs: fix a deadlock on chunk mutex
An user reported that he has hit an annoying deadlock while playing with ceph based on btrfs. Current updating device tree requires space from METADATA chunk, so we -may- need to do a recursive chunk allocation when adding/updating dev extent, that is where the deadlock comes from. If we use SYSTEM metadata to update device tree, we can avoid the recursive stuff. Reported-by: Jim Schutt
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...ize); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); if (map->type & BTRFS_BLOCK_GROUP_SYSTEM) { ret = btrfs_add_system_chunk(trans, chunk_root, &key, chunk, item_size); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); } kfree(chunk); return 0; @@ -2471,7 +2471,7 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, ret = __finish_chunk_alloc(trans, extent_root, map, chunk_offset, chunk_size, stripe_size); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); return 0; } @@ -2494,7 +2494,7 @@ static noinline int init_first_rw_device(struct btrfs_trans_handle *trans,...