]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Btrfs: reset ret in record_one_backref
authorJosef Bacik <jbacik@fusionio.com>
Mon, 22 Jul 2013 16:50:37 +0000 (12:50 -0400)
committerChris Mason <chris.mason@fusionio.com>
Sun, 1 Sep 2013 12:04:23 +0000 (08:04 -0400)
I was getting warnings when running find ./ -type f -exec btrfs fi defrag -f {}
\; from record_one_backref because ret was set.  Turns out it was because it was
set to 1 because the search slot didn't come out exact and we never reset it.
So reset it to 0 right after the search so we don't leak this and get
uneccessary warnings.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/inode.c

index 021694c081814828272ff03a8b9e1f64732a46cc..d3280b2b759221a3dd82a21408455ebb3b74779c 100644 (file)
@@ -2132,6 +2132,7 @@ static noinline int record_one_backref(u64 inum, u64 offset, u64 root_id,
                WARN_ON(1);
                return ret;
        }
+       ret = 0;
 
        while (1) {
                cond_resched();
@@ -2181,8 +2182,6 @@ static noinline int record_one_backref(u64 inum, u64 offset, u64 root_id,
                    old->len || extent_offset + num_bytes <=
                    old->extent_offset + old->offset)
                        continue;
-
-               ret = 0;
                break;
        }