linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] f2fs:Fix incorrect return statement in the function f2fs_ioc_release_volatile_write
@ 2015-09-06 12:28 Nicholas Krause
  2015-09-08 11:47 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Krause @ 2015-09-06 12:28 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

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.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 fs/f2fs/file.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index b0f38c3..ec323b4 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -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)
-- 
2.1.4


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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND] f2fs:Fix incorrect return statement in the function f2fs_ioc_release_volatile_write
  2015-09-06 12:28 [PATCH RESEND] f2fs:Fix incorrect return statement in the function f2fs_ioc_release_volatile_write Nicholas Krause
@ 2015-09-08 11:47 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2015-09-08 11:47 UTC (permalink / raw)
  To: 'Nicholas Krause', jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

> -----Original Message-----
> From: Nicholas Krause [mailto:xerofoify@gmail.com]
> Sent: Sunday, September 06, 2015 8:29 PM
> To: jaegeuk@kernel.org
> Cc: cm224.lee@samsung.com; chao2.yu@samsung.com; linux-f2fs-devel@lists.sourceforge.net;
> linux-kernel@vger.kernel.org
> 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.
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>

Reviewed-by: Chao Yu <chao2.yu@samsung.com>


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-08 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-06 12:28 [PATCH RESEND] f2fs:Fix incorrect return statement in the function f2fs_ioc_release_volatile_write Nicholas Krause
2015-09-08 11:47 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).