diff options
author | Chao Yu <yuchao0@huawei.com> | 2020-08-10 18:38:45 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2020-09-10 14:03:30 -0700 |
commit | 17d7648d9ce0c7d7e732252f0d976756c84d46aa (patch) | |
tree | d123dce26a16c5edd56628b5aabe595b16784bd8 /fs/f2fs | |
parent | 2e9b2bb250d5d1493eaf36215fbfe2cd76ce4f7c (diff) |
f2fs: fix compile warning
This patch fixes below compile warning reported by LKP
(kernel test robot)
cppcheck warnings: (new ones prefixed by >>)
>> fs/f2fs/file.c:761:9: warning: Identical condition 'err', second condition is always false [identicalConditionAfterEarlyExit]
return err;
^
fs/f2fs/file.c:753:6: note: first condition
if (err)
^
fs/f2fs/file.c:761:9: note: second condition
return err;
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/file.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index cb7427bf2783..b7888a4c354f 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -753,11 +753,14 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock) return err; #ifdef CONFIG_F2FS_FS_COMPRESSION - if (from != free_from) + if (from != free_from) { err = f2fs_truncate_partial_cluster(inode, from, lock); + if (err) + return err; + } #endif - return err; + return 0; } int f2fs_truncate(struct inode *inode) |