Skip to contentSkip to conversation

f2fs:Fix incorrect return statement in the function f2fs_ioc_release_volatile_write

PATCH RESEND Superseded Nicholas Krause 2 participants 2 messages Sep 6, 2015 – Sep 8, 2015 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 f2fs:Fix incorrect return statement in the function f2fs_ioc_release_volatile_write

This fixes the incorrect return statement at the end of the function f2fs_ioc_release_volatile_write's body for returning zero as this is incorrect due to the function call before this return statement to the function punch_hole being able to fail and we should return this function's return fail directly in order to signal to callers of the function f2fs_ioc_release_volatile if a failure arises with this call to punch_hole fails.

---
 fs/f2fs/file.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/f2fs/file.c +1 -2
index b0f38c3..ec323b4 100644
@@ -1369,8 +1369,7 @@ static int f2fs_ioc_release_volatile_write(struct file *filp)
 	if (!f2fs_is_first_block_written(inode))
 		return truncate_partial_data_page(inode, 0, true);
 
-	punch_hole(inode, 0, F2FS_BLKSIZE);
-	return 0;
+	return punch_hole(inode, 0, F2FS_BLKSIZE);
 }
 
 static int f2fs_ioc_abort_volatile_write(struct file *filp)
Signature · 4 lines
2.1.4


------------------------------------------------------------------------------
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines

-----Original Message-----
From: Nicholas Krause [mailto:[email protected]]
Sent: Sunday, September 06, 2015 8:29 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH RESEND] f2fs:Fix incorrect return statement in the function f2fs_ioc_release_volatile_write

This fixes the incorrect return statement at the end of the function f2fs_ioc_release_volatile_write's body for returning zero as this is incorrect due to the function call before this return statement to the function punch_hole being able to fail and we should return this function's return fail directly in order to signal to callers of the function f2fs_ioc_release_volatile if a failure arises with this call to punch_hole fails.

Quoted 1 line