projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2aadac0
)
f2fs: return early when trying to read null nid
author
Jaegeuk Kim
<jaegeuk@kernel.org>
Wed, 23 Dec 2015 22:17:47 +0000
(14:17 -0800)
committer
Jaegeuk Kim
<jaegeuk@kernel.org>
Wed, 30 Dec 2015 18:14:12 +0000
(10:14 -0800)
If get_node_page() gets zero nid, we can return early without getting a wrong
page. For example, get_dnode_of_data() can try to do that.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/node.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/f2fs/node.c
b/fs/f2fs/node.c
index 341de5d2353b3a3fb397d576d1c482d665ee023c..929265d20c3276490cc2a47ddab76873febbffc5 100644
(file)
--- a/
fs/f2fs/node.c
+++ b/
fs/f2fs/node.c
@@
-1059,6
+1059,10
@@
struct page *get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid)
{
struct page *page;
int err;
+
+ if (!nid)
+ return ERR_PTR(-ENOENT);
+ f2fs_bug_on(sbi, check_nid_range(sbi, nid));
repeat:
page = grab_cache_page(NODE_MAPPING(sbi), nid);
if (!page)