summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan Zheng <zheng.yan@oracle.com>2008-12-19 10:59:04 -0500
committerChris Mason <chris.mason@oracle.com>2008-12-19 10:59:04 -0500
commit1f80e4db0fcb3bdc2be51389baf558a9519682f0 (patch)
tree3a47b6fda78aab8a1a4e9e7f021bb9126a298496
parent34bf63c4ddddd92bfba3387d134c37bf4426b2ce (diff)
downloadlinux-stable-1f80e4db0fcb3bdc2be51389baf558a9519682f0.tar.gz
linux-stable-1f80e4db0fcb3bdc2be51389baf558a9519682f0.tar.bz2
linux-stable-1f80e4db0fcb3bdc2be51389baf558a9519682f0.zip
Btrfs: set EXTENT_BOUNDARY bit before marking extent delalloc.
There is a race in relocate_inode_pages, it happens when find_delalloc_range finds the delalloc extent before the boundary bit is set. Thank you, Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
-rw-r--r--fs/btrfs/extent-tree.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 274bb91efa22..fe0e59ab33cc 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3994,10 +3994,10 @@ again:
}
set_page_extent_mapped(page);
- btrfs_set_extent_delalloc(inode, page_start, page_end);
if (i == first_index)
set_extent_bits(io_tree, page_start, page_end,
EXTENT_BOUNDARY, GFP_NOFS);
+ btrfs_set_extent_delalloc(inode, page_start, page_end);
set_page_dirty(page);
total_dirty++;
@@ -4405,7 +4405,7 @@ static int noinline get_new_locations(struct inode *reloc_inode,
path->slots[0]++;
}
- WARN_ON(cur_pos + offset > last_byte);
+ BUG_ON(cur_pos + offset > last_byte);
if (cur_pos + offset < last_byte) {
ret = -ENOENT;
goto out;
@@ -5712,7 +5712,6 @@ next:
if (pass == 0) {
btrfs_wait_ordered_range(reloc_inode, 0, (u64)-1);
invalidate_mapping_pages(reloc_inode->i_mapping, 0, -1);
- WARN_ON(reloc_inode->i_mapping->nrpages);
}
if (total_found > 0) {