f2fs: checking for IS_ERR() instead of NULL
Subsystems (2)
PATCH 1/1 f2fs: checking for IS_ERR() instead of NULL
grab_cache_page_write_begin() returns NULL on error, it doesn't return error pointers.
Fixes e18c65b2ac91 ('f2fs: key functions to handle inline data')
Signed-off-by Dan Carpenter <[email protected]>
fs/f2fs/inline.c +2 -2
@@ -131,8 +131,8 @@ int f2fs_convert_inline_data(struct inode *inode, pgoff_t to_size)return 0 ; page =grab_cache_page_write_begin (inode->i_mapping,0 ,AOP_FLAG_NOFS ); -if (IS_ERR (page)) -return PTR_ERR (page); +if (!page) +return -ENOMEM ; err =__f2fs_convert_inline_data (inode, page);f2fs_put_page (page,1 );
Thank you for the patch.
This was already fixed in the original patch with an issue trigger by Chao Yu before.
I rebased it before, so that it seems you need to pull the f2fs again. Thanks,
2014-01-09 (목), 08:28 +0300, Dan Carpenter:
Quoted 21 lines
grab_cache_page_write_begin()returns NULL on error, it doesn't return error pointers.Fixes e18c65b2ac91 ('f2fs: key functions to handle inline data')Signed-off-by Dan Carpenter <[email protected]>fs/f2fs/inline.c +2
-2@@ -131,8 +131,8 @@ int f2fs_convert_inline_data(struct inode *inode, pgoff_t to_size)return 0 ; page =grab_cache_page_write_begin (inode->i_mapping,0 ,AOP_FLAG_NOFS ); -if (IS_ERR (page)) -return PTR_ERR (page); +if (!page) +return -ENOMEM ; err =__f2fs_convert_inline_data (inode, page);f2fs_put_page (page,1 );
Signature · 7 lines
Jaegeuk Kim Samsung -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html