Btrfs: reset ret in record_one_backref
PATCH 1/1 Btrfs: reset ret in record_one_backref
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 <[email protected]>
--- fs/btrfs/inode.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
fs/btrfs/inode.c +1 -2
@@ -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 ; }
Signature · 1 line
1.7.7.6
Quoted 7 lines · Josef Bacik
I was getting warnings when running find ./ -type f -exec btrfs fi defrag -f {} \; from
record_one_backrefbecause 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 <[email protected]>
Reviewed-by Miao Xie <[email protected]>
Quoted 26 lines
--- fs/btrfs/inode.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)fs/btrfs/inode.c +1
-2@@ -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 ; }