* [PATCH] Btrfs: reset ret in record_one_backref
@ 2013-07-22 16:52 Josef Bacik
2013-07-23 1:53 ` Miao Xie
0 siblings, 1 reply; 2+ messages in thread
From: Josef Bacik @ 2013-07-22 16:52 UTC (permalink / raw)
To: linux-btrfs
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>
---
fs/btrfs/inode.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index dd05238..a3a6155 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -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;
}
--
1.7.7.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Btrfs: reset ret in record_one_backref
2013-07-22 16:52 [PATCH] Btrfs: reset ret in record_one_backref Josef Bacik
@ 2013-07-23 1:53 ` Miao Xie
0 siblings, 0 replies; 2+ messages in thread
From: Miao Xie @ 2013-07-23 1:53 UTC (permalink / raw)
To: Josef Bacik; +Cc: linux-btrfs
On mon, 22 Jul 2013 12:52:35 -0400, Josef Bacik wrote:
> 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>
Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>
> ---
> fs/btrfs/inode.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index dd05238..a3a6155 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -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;
> }
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-07-23 1:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-22 16:52 [PATCH] Btrfs: reset ret in record_one_backref Josef Bacik
2013-07-23 1:53 ` Miao Xie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).