diff mbox

Btrfs-progs: fix check in btrfs_lookup_extent_info()

Message ID 1372869173-15043-1-git-send-email-fdmanana@gmail.com (mailing list archive)
State Under Review, archived
Headers show

Commit Message

Filipe Manana July 3, 2013, 4:32 p.m. UTC
We want to test if path->slots[0] is greater than zero.
Testing for path->slots was a logical error, as it corresponds
to a memory address (start of fixed array) and therefore is
always non-zero.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
---
 extent-tree.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/extent-tree.c b/extent-tree.c
index b0cfe0a..f094266 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -1515,7 +1515,7 @@  again:
 	 * to make sure.
 	 */
 	if (ret > 0 && metadata) {
-		if (path->slots) {
+		if (path->slots[0]) {
 			path->slots[0]--;
 			btrfs_item_key_to_cpu(path->nodes[0], &key,
 					      path->slots[0]);