All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESENT PATCH] logfs: Check for the return value after calling find_or_create_page()
@ 2013-07-16  9:33 Younger Liu
  2013-07-17  4:23 ` Prasad Joshi
  0 siblings, 1 reply; 6+ messages in thread
From: Younger Liu @ 2013-07-16  9:33 UTC (permalink / raw)
  To: Andrew Morton; +Cc: joern, prasadjoshi.linux, logfs, linux-fsdevel

In get_mapping_page(), after calling find_or_create_page(),
the return value should be checked. 
 
Signed-off-by: Younger Liu <younger.liu@huawei.com>
---
 fs/logfs/segment.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/logfs/segment.c b/fs/logfs/segment.c
index 038da09..2641e94 100644
--- a/fs/logfs/segment.c
+++ b/fs/logfs/segment.c
@@ -62,7 +62,8 @@ static struct page *get_mapping_page(struct super_block *sb, pgoff_t index,
 		page = read_cache_page(mapping, index, filler, sb);
 	else {
 		page = find_or_create_page(mapping, index, GFP_NOFS);
-		unlock_page(page);
+		if(page)
+			unlock_page(page);
 	}
 	return page;
 }
-- 1.7.9.7 


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

* Re: [RESENT PATCH] logfs: Check for the return value after calling find_or_create_page()
  2013-07-16  9:33 [RESENT PATCH] logfs: Check for the return value after calling find_or_create_page() Younger Liu
@ 2013-07-17  4:23 ` Prasad Joshi
  2013-07-18 12:02   ` Vyacheslav Dubeyko
  2013-09-18  3:48   ` Younger Liu
  0 siblings, 2 replies; 6+ messages in thread
From: Prasad Joshi @ 2013-07-17  4:23 UTC (permalink / raw)
  To: Younger Liu; +Cc: Andrew Morton, joern, logfs, linux-fsdevel

On Tue, Jul 16, 2013 at 3:03 PM, Younger Liu <younger.liu@huawei.com> wrote:
>
> In get_mapping_page(), after calling find_or_create_page(),
> the return value should be checked.
>
> Signed-off-by: Younger Liu <younger.liu@huawei.com>

Thanks applied.

Regards,
Prasad

> ---
>  fs/logfs/segment.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/logfs/segment.c b/fs/logfs/segment.c
> index 038da09..2641e94 100644
> --- a/fs/logfs/segment.c
> +++ b/fs/logfs/segment.c
> @@ -62,7 +62,8 @@ static struct page *get_mapping_page(struct super_block
> *sb, pgoff_t index,
>                 page = read_cache_page(mapping, index, filler, sb);
>         else {
>                 page = find_or_create_page(mapping, index, GFP_NOFS);
> -               unlock_page(page);
> +               if(page)
> +                       unlock_page(page);
>         }
>         return page;
>  }
> -- 1.7.9.7
>

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

* Re: [RESENT PATCH] logfs: Check for the return value after calling find_or_create_page()
  2013-07-17  4:23 ` Prasad Joshi
@ 2013-07-18 12:02   ` Vyacheslav Dubeyko
  2013-07-23  9:11     ` Younger Liu
  2013-09-18  3:48   ` Younger Liu
  1 sibling, 1 reply; 6+ messages in thread
From: Vyacheslav Dubeyko @ 2013-07-18 12:02 UTC (permalink / raw)
  To: Prasad Joshi; +Cc: Younger Liu, Andrew Morton, joern, logfs, linux-fsdevel


On Jul 17, 2013, at 8:23 AM, Prasad Joshi wrote:

> On Tue, Jul 16, 2013 at 3:03 PM, Younger Liu <younger.liu@huawei.com> wrote:
>> 
>> In get_mapping_page(), after calling find_or_create_page(),
>> the return value should be checked.
>> 
>> Signed-off-by: Younger Liu <younger.liu@huawei.com>
> 
> Thanks applied.
> 
> Regards,
> Prasad
> 
>> ---
>> fs/logfs/segment.c |    3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/fs/logfs/segment.c b/fs/logfs/segment.c
>> index 038da09..2641e94 100644
>> --- a/fs/logfs/segment.c
>> +++ b/fs/logfs/segment.c
>> @@ -62,7 +62,8 @@ static struct page *get_mapping_page(struct super_block
>> *sb, pgoff_t index,
>>                page = read_cache_page(mapping, index, filler, sb);
>>        else {
>>                page = find_or_create_page(mapping, index, GFP_NOFS);
>> -               unlock_page(page);
>> +               if(page)

Sorry, but as I understand, this code breaks kernel coding style.

With the best regards,
Vyacheslav Dubeyko.

>> +                       unlock_page(page);
>>        }
>>        return page;
>> }
>> -- 1.7.9.7
>> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: [RESENT PATCH] logfs: Check for the return value after calling find_or_create_page()
  2013-07-18 12:02   ` Vyacheslav Dubeyko
@ 2013-07-23  9:11     ` Younger Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Younger Liu @ 2013-07-23  9:11 UTC (permalink / raw)
  To: Vyacheslav Dubeyko, Prasad Joshi
  Cc: Andrew Morton, joern, logfs, linux-fsdevel

On 2013/7/18 20:02, Vyacheslav Dubeyko wrote:
> 
> On Jul 17, 2013, at 8:23 AM, Prasad Joshi wrote:
> 
>> On Tue, Jul 16, 2013 at 3:03 PM, Younger Liu <younger.liu@huawei.com> wrote:
>>>
>>> In get_mapping_page(), after calling find_or_create_page(),
>>> the return value should be checked.
>>>
>>> Signed-off-by: Younger Liu <younger.liu@huawei.com>
>>
>> Thanks applied.
>>
>> Regards,
>> Prasad
>>
>>> ---
>>> fs/logfs/segment.c |    3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/fs/logfs/segment.c b/fs/logfs/segment.c
>>> index 038da09..2641e94 100644
>>> --- a/fs/logfs/segment.c
>>> +++ b/fs/logfs/segment.c
>>> @@ -62,7 +62,8 @@ static struct page *get_mapping_page(struct super_block
>>> *sb, pgoff_t index,
>>>                page = read_cache_page(mapping, index, filler, sb);
>>>        else {
>>>                page = find_or_create_page(mapping, index, GFP_NOFS);
>>> -               unlock_page(page);
>>> +               if(page)
> 
> Sorry, but as I understand, this code breaks kernel coding style.
> 
> With the best regards,
> Vyacheslav Dubeyko.
> 
>>> +                       unlock_page(page);
>>>        }
>>>        return page;
>>> }
>>> -- 1.7.9.7
>>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 
Hi, Prasad and Vyacheslav
I modified the coding style, and resent a new patch.
Please drop the last patch, and apply this new patch.
thanks.

Signed-off-by: Younger Liu <younger.liu@huawei.com>
---
 fs/logfs/segment.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/logfs/segment.c b/fs/logfs/segment.c
index d448a77..7f9b096 100644
--- a/fs/logfs/segment.c
+++ b/fs/logfs/segment.c
@@ -62,7 +62,8 @@ static struct page *get_mapping_page(struct super_block *sb, pgoff_t index,
 		page = read_cache_page(mapping, index, filler, sb);
 	else {
 		page = find_or_create_page(mapping, index, GFP_NOFS);
-		unlock_page(page);
+		if (page)
+			unlock_page(page);
 	}
 	return page;
 }
-- 
1.7.9.7




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

* Re: [RESENT PATCH] logfs: Check for the return value after calling find_or_create_page()
  2013-07-17  4:23 ` Prasad Joshi
  2013-07-18 12:02   ` Vyacheslav Dubeyko
@ 2013-09-18  3:48   ` Younger Liu
  1 sibling, 0 replies; 6+ messages in thread
From: Younger Liu @ 2013-09-18  3:48 UTC (permalink / raw)
  To: Prasad Joshi; +Cc: Andrew Morton, joern, logfs, linux-fsdevel

On 2013/7/17 12:23, Prasad Joshi wrote:
> On Tue, Jul 16, 2013 at 3:03 PM, Younger Liu <younger.liu@huawei.com> wrote:
>>
>> In get_mapping_page(), after calling find_or_create_page(),
>> the return value should be checked.
>>
>> Signed-off-by: Younger Liu <younger.liu@huawei.com>
> 
> Thanks applied.
> 
> Regards,
> Prasad
> 
Hi Prasad,
 This patch is not merged into mainline 3.12-rc1. Should I resend this patch?
  Younger

>> ---
>>  fs/logfs/segment.c |    3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/logfs/segment.c b/fs/logfs/segment.c
>> index 038da09..2641e94 100644
>> --- a/fs/logfs/segment.c
>> +++ b/fs/logfs/segment.c
>> @@ -62,7 +62,8 @@ static struct page *get_mapping_page(struct super_block
>> *sb, pgoff_t index,
>>                 page = read_cache_page(mapping, index, filler, sb);
>>         else {
>>                 page = find_or_create_page(mapping, index, GFP_NOFS);
>> -               unlock_page(page);
>> +               if(page)
>> +                       unlock_page(page);
>>         }
>>         return page;
>>  }
>> -- 1.7.9.7
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 



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

* [RESENT PATCH] logfs: Check for the return value after calling find_or_create_page()
@ 2013-12-11 11:29 Younger Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Younger Liu @ 2013-12-11 11:29 UTC (permalink / raw)
  To: Andrew Morton
  Cc: joern, prasadjoshi.linux, logfs, kernel, fs-devel, liuyiyang

From: Younger Liu <liuyiyang@hisense.com>

  In get_mapping_page(), after calling find_or_create_page(),
the return value should be checked.

  This patch has been provided:
http://www.spinics.net/lists/linux-fsdevel/msg66948.html
but not been applied now.

Signed-off-by: Younger Liu <liuyiyang@hisense.com>
Cc: Younger Liu <younger.liucn@gmail.com>
Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
Reviewed-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
---
 fs/logfs/segment.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/logfs/segment.c b/fs/logfs/segment.c
index d448a77..7f9b096 100644
--- a/fs/logfs/segment.c
+++ b/fs/logfs/segment.c
@@ -62,7 +62,8 @@ static struct page *get_mapping_page(struct
super_block *sb, pgoff_t index,
 		page = read_cache_page(mapping, index, filler, sb);
 	else {
 		page = find_or_create_page(mapping, index, GFP_NOFS);
-		unlock_page(page);
+		if (page)
+			unlock_page(page);
 	}
 	return page;
 }
-- 
1.7.9.5


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

end of thread, other threads:[~2013-12-11 11:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-16  9:33 [RESENT PATCH] logfs: Check for the return value after calling find_or_create_page() Younger Liu
2013-07-17  4:23 ` Prasad Joshi
2013-07-18 12:02   ` Vyacheslav Dubeyko
2013-07-23  9:11     ` Younger Liu
2013-09-18  3:48   ` Younger Liu
2013-12-11 11:29 Younger Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.