]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
f2fs: fix incorrect return statement in the function f2fs_ioc_release_volatile_write
authorNicholas Krause <xerofoify@gmail.com>
Sun, 6 Sep 2015 12:28:46 +0000 (08:28 -0400)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 9 Oct 2015 23:20:49 +0000 (16:20 -0700)
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>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c

index 8120f8685141968f87b6572e17ceaa66e866fd43..b2fab9e2c09b44a3daa760a34adc2c3339960caf 100644 (file)
@@ -1437,8 +1437,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)