Displaying 20 results from an estimated 49 matches for "block_group".
2009 Mar 20
1
[PATCH 2/4] Btrfs: clean up find_free_extent
The whole loop=0,1,2 thing was kind of odd and not very self explanatory. I''ve
replaced it with a list_for_each_entry on space_info->block_groups. If we have
a hint we just jump into the loop with the block group and start looking for
space. If we don''t find anything we start at the beginning and start looking.
We never come out of the loop with a ref on the block_group _unless_ we found
space to use, then we drop it after we set...
2008 Oct 10
1
[PATCH] fix enospc when there is plenty of space
...data writes, and happens _very_ infrequently. What has to
happen is we have to allocate have allocated out of the first logical byte on
the disk, which would set last_alloc to first_logical_byte(root, 0), so
search_start == orig_search_start. We then need to allocate for normal
metadata, so BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_DUP. We will do a
block lookup for the given search_start, block_group_bits() won''t match and
we''ll go to choose another block group. However because search_start matches
orig_search_start we go to see if we can allocate a chunk. If we are in the
si...
2007 Jun 16
1
4 GB USB flash disk with FAT ok, with ext3 corrupted files
I recently bought 2 different USB flash disks. These are some cheap no-name
devices. Their parameters:
bytes C/H/S ID
4194304512 509/255/63 Vendor: Generic Model: USB Flash Drive Rev: 1.00 ANSI SCSI revision: 02
4288676352 1023/132/62 Vendor: USB Model: USB 2.0 Rev: 1.00 ANSI SCSI revision: 02
When I put a FAT32 filesystem on them,
2009 Jul 31
1
[PATCH] Btrfs: make sure we find a bitmap entry
...----
1 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index af99b78..691ea95 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -414,11 +414,20 @@ static noinline int remove_from_bitmap(struct btrfs_block_group_cache *block_gro
u64 *offset, u64 *bytes)
{
u64 end;
+ u64 search_start, search_bytes;
+ int ret;
again:
end = bitmap_info->offset +
(u64)(BITS_PER_BITMAP * block_group->sectorsize) - 1;
+ search_start = *offset;
+ search_bytes = *bytes;
+
+ ret = search_bitmap(block_gr...
2011 Mar 31
4
[PATCH] Btrfs: fix free space cache when there are pinned extents and clusters
...ot;disk-io.h"
+#include "extent_io.h"
#define BITS_PER_BITMAP (PAGE_CACHE_SIZE * 8)
#define MAX_CACHE_BYTES_PER_GIG (32 * 1024)
@@ -222,6 +223,7 @@ int load_free_space_cache(struct btrfs_fs_info *fs_info,
u64 num_entries;
u64 num_bitmaps;
u64 generation;
+ u64 used = btrfs_block_group_used(&block_group->item);
u32 cur_crc = ~(u32)0;
pgoff_t index = 0;
unsigned long first_page_offset;
@@ -467,6 +469,17 @@ next:
index++;
}
+ spin_lock(&block_group->tree_lock);
+ if (btrfs_block_group_free_space(block_group) !=
+ (block_group->key.offset - used - b...
2011 May 25
0
[PATCH] Btrfs: cache bitmaps when searching for a cluster
...iles changed, 49 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index d634a7e..0bfea7b 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -2062,6 +2062,7 @@ again:
*/
static int setup_cluster_no_bitmap(struct btrfs_block_group_cache *block_group,
struct btrfs_free_cluster *cluster,
+ struct list_head *bitmaps,
u64 offset, u64 bytes, u64 min_bytes)
{
struct btrfs_free_space *first = NULL;
@@ -2083,6 +2084,8 @@ static int setup_cluster_no_bitmap(struct btrfs_block_group_cache *block_group,
* ext...
2012 Jan 11
12
[PATCH 00/11] Btrfs: some patches for 3.3
...flags()
Btrfs: reserve metadata space in btrfs_ioctl_setflags()
Btrfs: don''t pass a trans handle unnecessarily in volumes.c
Btrfs: don''t pre-allocate btrfs bio
Btrfs: simplfy calculation of stripe length for discard operation
Btrfs: rewrite btrfs_trim_block_group()
Btrfs: update global block_rsv when creating a new block group
Btrfs: fix possible deadlock when opening a seed device
fs/btrfs/disk-io.c | 2 -
fs/btrfs/extent-tree.c | 3 +-
fs/btrfs/free-space-cache.c | 293 +++++++++++++++++++++++++++++--------------
fs/btrf...
2010 May 11
0
[PATCH 4/5] btrfs: don't cache empty block groups during mount
...extent-tree.c 8/fs/btrfs/extent-tree.c
--- 4/fs/btrfs/extent-tree.c 2010-05-11 14:15:29.174108554 +0800
+++ 8/fs/btrfs/extent-tree.c 2010-05-11 13:26:38.036107000 +0800
@@ -316,11 +329,6 @@ static int caching_kthread(void *data)
if (!path)
return -ENOMEM;
- exclude_super_stripes(extent_root, block_group);
- spin_lock(&block_group->space_info->lock);
- block_group->space_info->bytes_super += block_group->bytes_super;
- spin_unlock(&block_group->space_info->lock);
-
last = max_t(u64, block_group->key.objectid, BTRFS_SUPER_INFO_OFFSET);
/*
@@ -7499,6 +7541,7 @@ i...
2002 Mar 09
1
another quota related ext3fs crash...
...always seems to be the cause...
here are the lines of the last crashes (can't resolve call trace because
the old kernels are gone and i didn't resolve the traces when they
occured)
---
Dec 9 19:55:30 srck@trottelkunde Kernel panic: EXT3-fs panic (device ide1(22,66)): load_block_bitmap: block_group >= groups_count - block_group = 131071, groups_count = 94
Dec 9 19:55:30 srck@trottelkunde Assertion failure in journal_start() at transaction.c:227: "handle->h_transaction->t_journal == journal"
---
Jan 4 11:29:42 srck@trottelkunde Kernel panic: EXT3-fs panic (device ide1(22...
2011 May 11
8
[PATCH 1/4] Btrfs: map the node block when looking for readahead targets
If we have particularly full nodes, we could call btrfs_node_blockptr up to 32
times, which is 32 pairs of kmap/kunmap, which _sucks_. So go ahead and map the
extent buffer while we look for readahead targets. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
---
fs/btrfs/ctree.c | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git
2011 Jul 26
0
[PATCH] Btrfs: use bytes_may_use for all ENOSPC reservations
...- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2198,8 +2198,6 @@ int btrfs_free_extent(struct btrfs_trans_handle *trans,
u64 root_objectid, u64 owner, u64 offset);
int btrfs_free_reserved_extent(struct btrfs_root *root, u64 start, u64 len);
-int btrfs_update_reserved_bytes(struct btrfs_block_group_cache *cache,
- u64 num_bytes, int reserve, int sinfo);
int btrfs_prepare_extent_commit(struct btrfs_trans_handle *trans,
struct btrfs_root *root);
int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans,
@@ -2269,8 +2267,11 @@ void btrfs_put_block_group_cache(struct btrfs_fs_info...
2011 Jul 27
0
[PATCH] Btrfs: use bytes_may_use for all ENOSPC reservations V2
...- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2198,8 +2198,6 @@ int btrfs_free_extent(struct btrfs_trans_handle *trans,
u64 root_objectid, u64 owner, u64 offset);
int btrfs_free_reserved_extent(struct btrfs_root *root, u64 start, u64 len);
-int btrfs_update_reserved_bytes(struct btrfs_block_group_cache *cache,
- u64 num_bytes, int reserve, int sinfo);
int btrfs_prepare_extent_commit(struct btrfs_trans_handle *trans,
struct btrfs_root *root);
int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans,
@@ -2269,8 +2267,11 @@ void btrfs_put_block_group_cache(struct btrfs_fs_info...
2008 Sep 30
0
[PATCH] fix seekiness due to finding the wrong block group
Hello,
This patch fixes a problem where we end up seeking too much when *last_ptr is
valid. This happens because btrfs_lookup_first_block_group only returns a block
group that starts on or after the given search start, so if the search_start is
in the middle of a block group it will return the block group after the given
search_start, which is suboptimal. This patch fixes that by doing a
btrfs_lookup_block_group, which will return the blo...
2010 Apr 19
0
Memory barrier not required in cached_block_group
Hi all,
It seems like memory barrier is not required in cached_block_group.I
am looking at kernel 2.6.34-rc2.
cache_block_group(struct btrfs_block_group_cache *cache)
{
smp_mb();
if (cache->cached != BTRFS_CACHE_NO)
return 0;
....
}
This function is called from btrfs_alloc_logged_file_extent and
find_free_extent.
In btrfs_alloc_logged_file_extent the code snippet...
2008 Oct 27
0
[PATCH 3/4] update nodatacow code
...-10-27 21:26:31.000000000 +0800
@@ -201,108 +201,144 @@ out:
*/
static int run_delalloc_nocow(struct inode *inode, u64 start, u64 end)
{
- u64 extent_start;
- u64 extent_end;
- u64 bytenr;
- u64 loops = 0;
- u64 total_fs_bytes;
struct btrfs_root *root = BTRFS_I(inode)->root;
- struct btrfs_block_group_cache *block_group;
struct btrfs_trans_handle *trans;
struct extent_buffer *leaf;
- int found_type;
struct btrfs_path *path;
- struct btrfs_file_extent_item *item;
- int ret;
- int err = 0;
+ struct btrfs_file_extent_item *fi;
+ struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent...
2013 Apr 03
0
[PATCH] Btrfs-progs: add a free space cache checker to fsck
..."commands.h"
+#include "free-space-cache.h"
static u64 bytes_used = 0;
static u64 total_csum_bytes = 0;
@@ -2787,6 +2788,209 @@ static int check_csums(struct btrfs_root *root)
return errors;
}
+static int check_cache_range(struct btrfs_root *root,
+ struct btrfs_block_group_cache *cache,
+ u64 offset, u64 bytes)
+{
+ struct btrfs_free_space *entry;
+ u64 *logical;
+ u64 bytenr;
+ int stripe_len;
+ int i, nr, ret;
+
+ for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
+ bytenr = btrfs_sb_offset(i);
+ ret = btrfs_rmap_block(&root->fs_info->mapping_tree...
2002 Aug 13
0
[EXT3-fs error with RH7.2 and RH7.3]
...atazone - block = 439611, count
= 1
Aug 13 10:55:41 web kernel: EXT3-fs error (device sd(8,1)):
ext3_free_blocks: Freeing blocks not in datazone - block = 401302, count
= 1
Aug 13 10:55:41 web kernel: EXT3-fs error (device sd(8,1)):
ext3_new_block: block(1852807394) >= blocks count(1651339086) -
block_group = 0, es == f78b6400
Aug 13 10:55:41 web kernel: EXT3-fs error (device sd(8,1)):
ext3_new_block: block(1852807395) >= blocks count(1651339086) -
block_group = 0, es == f78b6400
Aug 13 10:55:41 web kernel: EXT3-fs error (device sd(8,1)):
ext3_new_block: block(1852807396) >= blocks count(165133...
2009 Sep 22
2
rescan usb hd
...evice
scsi 6:0:0:0: rejecting I/O to dead device
scsi 6:0:0:0: rejecting I/O to dead device
scsi 6:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sdc1, logical block 0
lost page write due to I/O error on sdc1
EXT2-fs error (device sdc1): read_inode_bitmap: Cannot read inode
bitmap - block_group = 129, inode_bitmap = 4227073
scsi 6:0:0:0: rejecting I/O to dead device
scsi 6:0:0:0: rejecting I/O to dead device
scsi 6:0:0:0: rejecting I/O to dead device
Buffer I/O error on device sdc1, logical block 0
lost page write due to I/O error on sdc1
EXT2-fs error (device sdc1): ext2_readdir: bad pag...
2009 Aug 24
0
[PATCH] Btrfs: proper metadata -ENOSPC handling
...reserved for
current allocations */
u64 bytes_readonly; /* total bytes that are read only */
+ u64 bytes_super; /* total bytes reserved for the super blocks */
/* delalloc accounting */
u64 bytes_delalloc; /* number of bytes reserved for allocation,
@@ -744,6 +745,7 @@ struct btrfs_block_group_cache {
spinlock_t lock;
u64 pinned;
u64 reserved;
+ u64 bytes_super;
u64 flags;
u64 sectorsize;
int extents_thresh;
@@ -2012,7 +2014,7 @@ u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags);
void btrfs_set_inode_space_info(struct btrfs_root *root, struct inode *ionde);...
2007 Nov 12
0
[PATCH]Minor fix for find_search_start
Hello,
This patch adds a new parameter 'full_scan' to 'find_search_start',
thereby 'find_search_start' can know whether 'find_free_extent' is in
full scan phrase. I feel that 'find_search_start' should skip calling
'btrfs_find_block_group' when 'find_free_extent' is in full scan
phrase. In my test on a 2GB volume, Oops occurs when space usage is
about 76%. After apply the patch, Oops occurs when space usage is
near 100%.
Regards
YZ
----
diff -r 433cf4043126 extent-tree.c
--- a/extent-tree.c Sun Nov 11 08:22:00 2007 -05...