diff options
-rw-r--r-- | fs/btrfs/free-space-cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index f1d9b6bc23ba..96241f01fa0a 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c | |||
@@ -90,8 +90,8 @@ static struct btrfs_free_space *tree_search_offset(struct rb_root *root, | |||
90 | ret = entry; | 90 | ret = entry; |
91 | n = n->rb_left; | 91 | n = n->rb_left; |
92 | } else if (offset > entry->offset) { | 92 | } else if (offset > entry->offset) { |
93 | if (contains && | 93 | if ((entry->offset + entry->bytes - 1) >= offset && |
94 | (entry->offset + entry->bytes - 1) >= offset) { | 94 | bytes <= entry->bytes) { |
95 | ret = entry; | 95 | ret = entry; |
96 | break; | 96 | break; |
97 | } | 97 | } |