linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Younger Liu <younger.liu@huawei.com>
To: Vyacheslav Dubeyko <slava@dubeyko.com>,
	Prasad Joshi <prasadjoshi.linux@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, <joern@logfs.org>,
	<logfs@logfs.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [RESENT PATCH] logfs: Check for the return value after calling find_or_create_page()
Date: Tue, 23 Jul 2013 17:11:26 +0800	[thread overview]
Message-ID: <51EE48BE.2020209@huawei.com> (raw)
In-Reply-To: <C4B822A5-B48C-451C-A4B3-F467695697ED@dubeyko.com>

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




  reply	other threads:[~2013-07-23  9:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2013-09-18  3:48   ` Younger Liu
  -- strict thread matches above, loose matches on Subject: below --
2013-12-11 11:29 Younger Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51EE48BE.2020209@huawei.com \
    --to=younger.liu@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=joern@logfs.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=logfs@logfs.org \
    --cc=prasadjoshi.linux@gmail.com \
    --cc=slava@dubeyko.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).