Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0c5da14 authored by Yan's avatar Yan Committed by Chris Mason
Browse files

Btrfs: Fix for test_range_bit



test_range_bit doesn't properly handle the case: there's a hole at the
end of the range and there's no other extent_state after the range.

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent b1785427
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1336,6 +1336,11 @@ int test_range_bit(struct extent_map_tree *tree, u64 start, u64 end,
		if (start > end)
			break;
		node = rb_next(node);
		if (!node) {
			if (filled)
				bitset = 0;
			break;
		}
	}
	read_unlock_irq(&tree->lock);
	return bitset;