diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-10-31 12:46:39 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-10-31 12:46:39 -0400 |
commit | 70b99e6959a4c28ae1b314985eca731f3db72f1d (patch) | |
tree | 81578759fe422f7b17a734b8bf16b042aa02a046 /fs/btrfs/extent_io.c | |
parent | d899e05215178fed903ad0e7fc1cb4d8e0cc0a88 (diff) |
Btrfs: Compression corner fixes
Make sure we keep page->mapping NULL on the pages we're getting
via alloc_page. It gets set so a few of the callbacks can do the right
thing, but in general these pages don't have a mapping.
Don't try to truncate compressed inline items in btrfs_drop_extents.
The whole compressed item must be preserved.
Don't try to create multipage inline compressed items. When we try to
overwrite just the first page of the file, we would have to read in and recow
all the pages after it in the same compressed inline items. For now, only
create single page inline items.
Make sure we lock pages in the correct order during delalloc. The
search into the state tree for delalloc bytes can return bytes before
the page we already have locked.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index eb3c12e7beaf..9b37ce6e5168 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -1242,13 +1242,22 @@ again: | |||
1242 | delalloc_end = 0; | 1242 | delalloc_end = 0; |
1243 | found = find_delalloc_range(tree, &delalloc_start, &delalloc_end, | 1243 | found = find_delalloc_range(tree, &delalloc_start, &delalloc_end, |
1244 | max_bytes); | 1244 | max_bytes); |
1245 | if (!found) { | 1245 | if (!found || delalloc_end <= *start) { |
1246 | *start = delalloc_start; | 1246 | *start = delalloc_start; |
1247 | *end = delalloc_end; | 1247 | *end = delalloc_end; |
1248 | return found; | 1248 | return found; |
1249 | } | 1249 | } |
1250 | 1250 | ||
1251 | /* | 1251 | /* |
1252 | * start comes from the offset of locked_page. We have to lock | ||
1253 | * pages in order, so we can't process delalloc bytes before | ||
1254 | * locked_page | ||
1255 | */ | ||
1256 | if (delalloc_start < *start) { | ||
1257 | delalloc_start = *start; | ||
1258 | } | ||
1259 | |||
1260 | /* | ||
1252 | * make sure to limit the number of pages we try to lock down | 1261 | * make sure to limit the number of pages we try to lock down |
1253 | * if we're looping. | 1262 | * if we're looping. |
1254 | */ | 1263 | */ |