Skip to contentSkip to conversation

f2fs:Fix error handling for calls to various functions in the function recover_inline_data

PATCH RESEND New Nicholas Krause 1 participant 1 message Sep 21, 2015 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 f2fs:Fix error handling for calls to various functions in the function recover_inline_data

This fixes error handling for calls to various functions in the function recover_inline_data to check if these particular functions either return a error code or the boolean value false to signal their caller they have failed internally and if this arises return false to signal failure immediately to the caller of recover_inline_data as we cannot continue after failures to calling either the function truncate_inline_inode or truncate_blocks.

---
 fs/f2fs/inline.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
fs/f2fs/inline.c +4 -2
index a13ffcc..0ddab9b 100644
@@ -274,12 +274,14 @@ process_inline:
 	if (f2fs_has_inline_data(inode)) {
 		ipage = get_node_page(sbi, inode->i_ino);
 		f2fs_bug_on(sbi, IS_ERR(ipage));
-		truncate_inline_inode(ipage, 0);
+		if (!truncate_inline_inode(ipage, 0))
+			return false;
 		f2fs_clear_inline_inode(inode);
 		update_inode(inode, ipage);
 		f2fs_put_page(ipage, 1);
 	} else if (ri && (ri->i_inline & F2FS_INLINE_DATA)) {
-		truncate_blocks(inode, 0, false);
+		if (truncate_blocks(inode, 0, false))
+			return false;
 		goto process_inline;
 	}
 	return false;
Signature · 4 lines
2.1.4


------------------------------------------------------------------------------