Skip to contentSkip to conversation

f2fs: checking for IS_ERR() instead of NULL

PATCH In review Dan Carpenter 2 participants 2 messages Jan 9, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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')
fs/f2fs/inline.c +2 -2
index 69a923e38f0c..e0d800a1d79f 100644
@@ -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);
#1 lore raw

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')
fs/f2fs/inline.c +2 -2
index 69a923e38f0c..e0d800a1d79f 100644
@@ -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