summaryrefslogtreecommitdiffstats
path: root/fs/logfs
diff options
context:
space:
mode:
authorYounger Liu <liuyiyang@hisense.com>2014-01-23 15:53:47 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 16:36:54 -0800
commit2252b62a56601c9e31396da230b4ce792f167fb4 (patch)
tree02a0cf2f7ba9a1367d8c13752b67d3819149b921 /fs/logfs
parenta3b25d9b774fbda2e6add28cf792941fd98fa999 (diff)
downloadop-kernel-dev-2252b62a56601c9e31396da230b4ce792f167fb4.zip
op-kernel-dev-2252b62a56601c9e31396da230b4ce792f167fb4.tar.gz
logfs: check for the return value after calling find_or_create_page()
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> Cc: Jörn Engel <joern@logfs.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/logfs')
-rw-r--r--fs/logfs/segment.c3
1 files changed, 2 insertions, 1 deletions
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;
}
OpenPOWER on IntegriCloud