summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-05-08 16:31:21 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:02 -0400
commitbbaf549e0c3d28399fc5abd68020d4025ae5c3a7 (patch)
tree19443b7e2a18fd04556ab9c5d914de3d29034a0d /fs/btrfs/inode.c
parentc1c4d91c38e6e5b29543b02d4a4fb7f007e44f70 (diff)
downloadop-kernel-dev-bbaf549e0c3d28399fc5abd68020d4025ae5c3a7.zip
op-kernel-dev-bbaf549e0c3d28399fc5abd68020d4025ae5c3a7.tar.gz
Btrfs: A number of nodatacow fixes
Once part of a delalloc request fails the cow checks, just cow the entire range It is possible for the back references to all be from the same root, but still have snapshots against an extent. The checks are now more strict, forcing cow any time there are multiple refs against the data extent. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 1bf37d1..a492fd2 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -207,9 +207,8 @@ again:
btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
found_type = btrfs_key_type(&found_key);
if (found_key.objectid != inode->i_ino ||
- found_type != BTRFS_EXTENT_DATA_KEY) {
+ found_type != BTRFS_EXTENT_DATA_KEY)
goto not_found;
- }
found_type = btrfs_file_extent_type(leaf, item);
extent_start = found_key.offset;
@@ -245,7 +244,6 @@ again:
if (!block_group || block_group->ro)
goto not_found;
-
start = extent_end;
} else {
goto not_found;
@@ -260,8 +258,8 @@ loop:
goto again;
not_found:
- cow_file_range(inode, start, cow_end);
- start = cow_end + 1;
+ cow_file_range(inode, start, end);
+ start = end + 1;
goto loop;
}
OpenPOWER on IntegriCloud