diff options
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index b5c2ad8fe2ca..9d39d08a1555 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -5982,7 +5982,14 @@ again: | |||
5982 | found_type = btrfs_key_type(&found_key); | 5982 | found_type = btrfs_key_type(&found_key); |
5983 | if (found_key.objectid != objectid || | 5983 | if (found_key.objectid != objectid || |
5984 | found_type != BTRFS_EXTENT_DATA_KEY) { | 5984 | found_type != BTRFS_EXTENT_DATA_KEY) { |
5985 | goto not_found; | 5985 | /* |
5986 | * If we backup past the first extent we want to move forward | ||
5987 | * and see if there is an extent in front of us, otherwise we'll | ||
5988 | * say there is a hole for our whole search range which can | ||
5989 | * cause problems. | ||
5990 | */ | ||
5991 | extent_end = start; | ||
5992 | goto next; | ||
5986 | } | 5993 | } |
5987 | 5994 | ||
5988 | found_type = btrfs_file_extent_type(leaf, item); | 5995 | found_type = btrfs_file_extent_type(leaf, item); |
@@ -5997,7 +6004,7 @@ again: | |||
5997 | size = btrfs_file_extent_inline_len(leaf, item); | 6004 | size = btrfs_file_extent_inline_len(leaf, item); |
5998 | extent_end = ALIGN(extent_start + size, root->sectorsize); | 6005 | extent_end = ALIGN(extent_start + size, root->sectorsize); |
5999 | } | 6006 | } |
6000 | 6007 | next: | |
6001 | if (start >= extent_end) { | 6008 | if (start >= extent_end) { |
6002 | path->slots[0]++; | 6009 | path->slots[0]++; |
6003 | if (path->slots[0] >= btrfs_header_nritems(leaf)) { | 6010 | if (path->slots[0] >= btrfs_header_nritems(leaf)) { |