Skip to contentSkip to conversation

f2fs: check return value of f2fs_readpage in find_data_page

PATCH In review Chao Yu 1 participant 1 message Nov 28, 2013

Subsystems (2)
lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 4/5 f2fs: check return value of f2fs_readpage in find_data_page

We should return error if we do not get an updated page in find_date_page when f2fs_readpage failed.

---
 fs/f2fs/data.c |    3 +++
 1 file changed, 3 insertions(+)
fs/f2fs/data.c +3 -0
index 2d02cf3..85071d6 100644
@@ -240,6 +240,9 @@ struct page *find_data_page(struct inode *inode, pgoff_t index, bool sync)
 
 	err = f2fs_readpage(sbi, page, dn.data_blkaddr,
 					sync ? READ_SYNC : READA);
+	if (err)
+		return ERR_PTR(err);
+
 	if (sync) {
 		wait_on_page_locked(page);
 		if (!PageUptodate(page)) {
Signature · 1 line
1.7.9.5