linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Younger Liu <younger.liucn@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: joern@logfs.org, prasadjoshi.linux@gmail.com, logfs@logfs.org,
	kernel <linux-kernel@vger.kernel.org>,
	fs-devel <linux-fsdevel@vger.kernel.org>,
	liuyiyang@hisense.com
Subject: [RESENT PATCH] logfs: Check for the return value after calling find_or_create_page()
Date: Wed, 11 Dec 2013 19:29:18 +0800	[thread overview]
Message-ID: <52A84C8E.5090209@gmail.com> (raw)

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


             reply	other threads:[~2013-12-11 11:29 UTC|newest]

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

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=52A84C8E.5090209@gmail.com \
    --to=younger.liucn@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=joern@logfs.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyiyang@hisense.com \
    --cc=logfs@logfs.org \
    --cc=prasadjoshi.linux@gmail.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).