linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 7/7] btrfs: fix a wrong error check in add_ra_bio_pages()
@ 2010-07-29  8:32 Miao Xie
  2010-07-29 10:38 ` Yan, Zheng
  0 siblings, 1 reply; 3+ messages in thread
From: Miao Xie @ 2010-07-29  8:32 UTC (permalink / raw)
  To: Chris Mason, Yan Zheng; +Cc: Linux Btrfs, Linux Kernel

From: Liu Bo <liubo2009@cn.fujitsu.com>

Only when a page is not found by page_index, we'll go to the error check.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
 fs/btrfs/compression.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index cb3877c..8458840 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -467,7 +467,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
 		rcu_read_lock();
 		page = radix_tree_lookup(&mapping->page_tree, page_index);
 		rcu_read_unlock();
-		if (page) {
+		if (!page) {
 check_misses:
 			misses++;
 			if (misses > 4)
-- 
1.7.0.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 7/7] btrfs: fix a wrong error check in add_ra_bio_pages()
  2010-07-29  8:32 [PATCH 7/7] btrfs: fix a wrong error check in add_ra_bio_pages() Miao Xie
@ 2010-07-29 10:38 ` Yan, Zheng
  2010-07-29 10:47   ` Miao Xie
  0 siblings, 1 reply; 3+ messages in thread
From: Yan, Zheng @ 2010-07-29 10:38 UTC (permalink / raw)
  To: miaox; +Cc: Chris Mason, Linux Btrfs, Linux Kernel

2010/7/29 Miao Xie <miaox@cn.fujitsu.com>:
> From: Liu Bo <liubo2009@cn.fujitsu.com>
>
> Only when a page is not found by page_index, we'll go to the error ch=
eck.
>
> Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
> ---
> =A0fs/btrfs/compression.c | =A0 =A02 +-
> =A01 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
> index cb3877c..8458840 100644
> --- a/fs/btrfs/compression.c
> +++ b/fs/btrfs/compression.c
> @@ -467,7 +467,7 @@ static noinline int add_ra_bio_pages(struct inode=
 *inode,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rcu_read_lock();
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0page =3D radix_tree_lookup(&mapping->p=
age_tree, page_index);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rcu_read_unlock();
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (page) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!page) {
> =A0check_misses:
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0misses++;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (misses > 4)

This patch is wrong. The word "miss" here means "miss for read-ahead be=
cause
the page is already in the page cache"

Yan, Zheng

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 7/7] btrfs: fix a wrong error check in add_ra_bio_pages()
  2010-07-29 10:38 ` Yan, Zheng
@ 2010-07-29 10:47   ` Miao Xie
  0 siblings, 0 replies; 3+ messages in thread
From: Miao Xie @ 2010-07-29 10:47 UTC (permalink / raw)
  To: Yan, Zheng; +Cc: Chris Mason, Linux Btrfs, Linux Kernel

On Thu, 29 Jul 2010 18:38:39 +0800, Yan, Zheng wrote:
> 2010/7/29 Miao Xie<miaox@cn.fujitsu.com>:
>> From: Liu Bo<liubo2009@cn.fujitsu.com>
>>
>> Only when a page is not found by page_index, we'll go to the error check.
>>
>> Signed-off-by: Liu Bo<liubo2009@cn.fujitsu.com>
>> Signed-off-by: Miao Xie<miaox@cn.fujitsu.com>
>> ---
>>   fs/btrfs/compression.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
>> index cb3877c..8458840 100644
>> --- a/fs/btrfs/compression.c
>> +++ b/fs/btrfs/compression.c
>> @@ -467,7 +467,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
>>                 rcu_read_lock();
>>                 page = radix_tree_lookup(&mapping->page_tree, page_index);
>>                 rcu_read_unlock();
>> -               if (page) {
>> +               if (!page) {
>>   check_misses:
>>                         misses++;
>>                         if (misses>  4)
>
> This patch is wrong. The word "miss" here means "miss for read-ahead because
> the page is already in the page cache"

Oh, my mistake. Sorry!
Please ignore this patch.

Thanks for your review! How about the others?
Miao

>
> Yan, Zheng
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-29 10:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29  8:32 [PATCH 7/7] btrfs: fix a wrong error check in add_ra_bio_pages() Miao Xie
2010-07-29 10:38 ` Yan, Zheng
2010-07-29 10:47   ` 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).