ocfs2/refcounttree: add the missing NULL check of the return value of find_or_create_page()
PATCH 1/1 ocfs2/refcounttree: add the missing NULL check of the return value of find_or_create_page()
Add the missing NULL check of the return value of find_or_create_page() in function ocfs2_duplicate_clusters_by_page().
--- fs/ocfs2/refcounttree.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
fs/ocfs2/refcounttree.c +5 -1
@@ -2965,7 +2965,11 @@ int ocfs2_duplicate_clusters_by_page(handle_t *handle, to = map_end & (PAGE_CACHE_SIZE -1 ); page =find_or_create_page (mapping, page_index,GFP_NOFS ); - +if (!page) { + ret = -ENOMEM ; +mlog_errno (ret); +break ; + }/* * In case PAGE_CACHE_SIZE <= CLUSTER_SIZE, This page * can't be dirtied before we CoW it out.
Signature · 1 line
1.7.7
Quoted 15 lines · Gu Zheng
Add the missing NULL check of the return value of
find_or_create_page()in functionocfs2_duplicate_clusters_by_page().Signed-off-by Gu Zheng <[email protected]>--- fs/ocfs2/refcounttree.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)fs/ocfs2/refcounttree.c +0
-0@@ -2965,7 +2965,11 @@ int ocfs2_duplicate_clusters_by_page(handle_t *handle, to = map_end & (PAGE_CACHE_SIZE -1 );
fs/ocfs2/refcounttree.c int ocfs2_duplicate_clusters_by_page(handle_t *handle, · line 2975
Quoted 10 lines
fs/ocfs2/refcounttree.c +5
-1page =find_or_create_page (mapping, page_index,GFP_NOFS ); - +if (!page) { + ret = -ENOMEM ; +mlog_errno (ret); +break ; + }/* * In case PAGE_CACHE_SIZE <= CLUSTER_SIZE, This page * can't be dirtied before we CoW it out.
Put a blank line between the closing brace and the comment. Otherwise,
Joel
Quoted 8 lines
Signature · 7 lines
1.7.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Signature · 6 lines
Life's Little Instruction Book #99 "Think big thoughts, but relish small pleasures." http://www.jlbec.org/ jlbec at evilplan.org
Quoted 16 lines · Joel Becker
Quoted 15 lines · Gu Zheng
Add the missing NULL check of the return value of
find_or_create_page()in functionocfs2_duplicate_clusters_by_page().Signed-off-by Gu Zheng <[email protected]>--- fs/ocfs2/refcounttree.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)fs/ocfs2/refcounttree.c +0
-0@@ -2965,7 +2965,11 @@ int ocfs2_duplicate_clusters_by_page(handle_t *handle, to = map_end & (PAGE_CACHE_SIZE -1 );
Quoted 12 lines
fs/ocfs2/refcounttree.c int ocfs2_duplicate_clusters_by_page(handle_t *handle, · line 2975
Quoted 10 lines
fs/ocfs2/refcounttree.c +5
-1page =find_or_create_page (mapping, page_index,GFP_NOFS ); - +if (!page) { + ret = -ENOMEM ; +mlog_errno (ret); +break ; + }/* * In case PAGE_CACHE_SIZE <= CLUSTER_SIZE, This page * can't be dirtied before we CoW it out. Put a blank line between the closing brace and the comment. Otherwise,
Got it.:)
Quoted 1 line
Acked-by Joel Becker <[email protected]>
Thanks~
Regards,
Gu
Quoted 11 lines
Joel
Quoted 8 lines
Signature · 7 lines
1.7.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/