f2fs: fix to check return value in f2fs_insert_range()
Chao Yu
maintainerPATCH 1/1 f2fs: fix to check return value in f2fs_insert_range()
In f2fs_insert_range(), it missed to check return value of filemap_write_and_wait_range(), fix it.
Meanwhile, just return error number once __exchange_data_block() fails.
Signed-off-by Chao Yu <[email protected]>
--- fs/f2fs/file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/f2fs/file.c +3 -1
@@ -1679,10 +1679,12 @@ static int f2fs_insert_range(struct inode *inode, loff_t offset, loff_t len) }filemap_invalidate_unlock (mapping);f2fs_up_write (&F2FS_I (inode)->i_gc_rwsem[WRITE ]); +if (ret) +return ret;/* write out all moved pages, if possible */ filemap_invalidate_lock (mapping); -filemap_write_and_wait_range (mapping, offset,LLONG_MAX ); + ret =filemap_write_and_wait_range (mapping, offset,LLONG_MAX );truncate_pagecache (inode, offset);filemap_invalidate_unlock (mapping);
Signature · 1 line
2.40.1
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:
Quoted 9 lines · On Mon, 26 Feb 2024 11:19:16 +0800 you wrote:
In
f2fs_insert_range(), it missed to check return value offilemap_write_and_wait_range(), fix it.Meanwhile, just return error number once
__exchange_data_block()fails.Signed-off-by Chao Yu <[email protected]>[...]
Here is the summary with links:
- [f2fs-dev] f2fs: fix to check return value in f2fs_insert_range()
https://git.kernel.org/jaegeuk/f2fs/c/2fc2bcc8d399
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html