Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128900
b: refs/heads/master
c: 7c2fe32
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent 54e10de commit 0414a84
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 902b22f341efa00be802418a0a8c57bddcd269a6
refs/heads/master: 7c2fe32a238eb12422beca5cbd5194a594baa559
7 changes: 7 additions & 0 deletions trunk/fs/btrfs/extent_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,14 @@ int add_extent_mapping(struct extent_map_tree *tree,
int ret = 0;
struct extent_map *merge = NULL;
struct rb_node *rb;
struct extent_map *exist;

exist = lookup_extent_mapping(tree, em->start, em->len);
if (exist) {
free_extent_map(exist);
ret = -EEXIST;
goto out;
}
assert_spin_locked(&tree->lock);
rb = tree_insert(&tree->map, em->start, &em->rb_node);
if (rb) {
Expand Down
21 changes: 17 additions & 4 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,9 @@ int btrfs_readpage_io_hook(struct page *page, u64 start, u64 end)
if (ret == -ENOENT || ret == -EFBIG)
ret = 0;
csum = 0;
printk("no csum found for inode %lu start %Lu\n", inode->i_ino,
start);
if (printk_ratelimit())
printk("no csum found for inode %lu start %Lu\n", inode->i_ino,
start);
goto out;
}
read_extent_buffer(path->nodes[0], &csum, (unsigned long)item,
Expand Down Expand Up @@ -1653,8 +1654,20 @@ static int btrfs_setattr(struct dentry *dentry, struct iattr *attr)
btrfs_truncate_page(inode->i_mapping, inode->i_size);

hole_size = block_end - hole_start;
btrfs_wait_ordered_range(inode, hole_start, hole_size);
lock_extent(io_tree, hole_start, block_end - 1, GFP_NOFS);
while(1) {
struct btrfs_ordered_extent *ordered;
btrfs_wait_ordered_range(inode, hole_start, hole_size);

lock_extent(io_tree, hole_start, block_end - 1, GFP_NOFS);
ordered = btrfs_lookup_ordered_extent(inode, hole_start);
if (ordered) {
unlock_extent(io_tree, hole_start,
block_end - 1, GFP_NOFS);
btrfs_put_ordered_extent(ordered);
} else {
break;
}
}

trans = btrfs_start_transaction(root, 1);
btrfs_set_trans_block_group(trans, inode);
Expand Down

0 comments on commit 0414a84

Please sign in to comment.