logfs: Check for the return value after calling find_or_create_page()
PATCH 1/1 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.
--- fs/logfs/segment.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/logfs/segment.c +2 -1
@@ -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
Prasad Joshi
AppliedQuoted 5 lines · Younger Liu
In
get_mapping_page(), after callingfind_or_create_page(), the return value should be checked.Signed-off-by Younger Liu <[email protected]>
Thanks applied.
Regards,
Prasad
Quoted 21 lines
--- fs/logfs/segment.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)fs/logfs/segment.c +2
-1@@ -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
Quoted 16 lines · Prasad Joshi
Quoted 5 lines · Younger Liu
In
get_mapping_page(), after callingfind_or_create_page(), the return value should be checked.Signed-off-by Younger Liu <[email protected]>Thanks applied.
Regards,
PrasadQuoted 4 lines
---
fs/logfs/segment.c| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 11 lines
fs/logfs/segment.c static struct page *get_mapping_page(struct super_block · line 66
Quoted 11 lines
fs/logfs/segment.c +1
-1@@ -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.
Quoted 10 lines
Quoted 6 lines
fs/logfs/segment.c +1
-0+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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 33 lines · Vyacheslav Dubeyko
Quoted 16 lines · Prasad Joshi
Quoted 5 lines · Younger Liu
In
get_mapping_page(), after callingfind_or_create_page(), the return value should be checked.Signed-off-by Younger Liu <[email protected]>Thanks applied.
Regards,
PrasadQuoted 4 lines
---
fs/logfs/segment.c| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)Quoted 11 lines
fs/logfs/segment.c static struct page *get_mapping_page(struct super_block · line 66
Quoted 11 lines
fs/logfs/segment.c +1
-1@@ -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.
Quoted 16 lines
With the best regards,
Vyacheslav Dubeyko.Quoted 10 lines
Quoted 6 lines
fs/logfs/segment.c +1
-0+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 [email protected]
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.
--- fs/logfs/segment.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/logfs/segment.c +2 -1
@@ -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; }
Signature · 1 line
1.7.9.7
Quoted 5 lines · Prasad Joshi
Quoted 4 lines · Younger Liu
In
get_mapping_page(), after callingfind_or_create_page(), the return value should be checked.
Quoted 7 lines
Quoted 1 line
Signed-off-by Younger Liu <[email protected]>Thanks applied.
Regards,
Prasad
Hi Prasad,
This patch is not merged into mainline 3.12-rc1. Should I resend this patch?
Younger
Quoted 27 lines
Quoted 18 lines
--- fs/logfs/segment.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)fs/logfs/segment.c +2
-1@@ -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;Quoted 3 lines
}
-- 1.7.9.7--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html