* [f2fs-dev] [PATCH] f2fs: fix to handle filemap_fdatawrite() error in f2fs_ioc_decompress_file/f2fs_ioc_compress_file
@ 2023-03-02 9:55 Yangtao Li via Linux-f2fs-devel
2023-03-21 16:40 ` patchwork-bot+f2fs
2023-03-23 15:21 ` Chao Yu
0 siblings, 2 replies; 3+ messages in thread
From: Yangtao Li via Linux-f2fs-devel @ 2023-03-02 9:55 UTC (permalink / raw)
To: jaegeuk, chao; +Cc: Yangtao Li, linux-kernel, linux-f2fs-devel
It seems inappropriate that the current logic does not handle
filemap_fdatawrite() errors, so let's fix it.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
fs/f2fs/file.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 15dabeac4690..6de2f27c4eec 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -4062,8 +4062,11 @@ static int f2fs_ioc_decompress_file(struct file *filp)
if (ret < 0)
break;
- if (get_dirty_pages(inode) >= blk_per_seg)
- filemap_fdatawrite(inode->i_mapping);
+ if (get_dirty_pages(inode) >= blk_per_seg) {
+ ret = filemap_fdatawrite(inode->i_mapping);
+ if (ret < 0)
+ break;
+ }
count -= len;
page_idx += len;
@@ -4133,8 +4136,11 @@ static int f2fs_ioc_compress_file(struct file *filp)
if (ret < 0)
break;
- if (get_dirty_pages(inode) >= blk_per_seg)
- filemap_fdatawrite(inode->i_mapping);
+ if (get_dirty_pages(inode) >= blk_per_seg) {
+ ret = filemap_fdatawrite(inode->i_mapping);
+ if (ret < 0)
+ break;
+ }
count -= len;
page_idx += len;
--
2.25.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: fix to handle filemap_fdatawrite() error in f2fs_ioc_decompress_file/f2fs_ioc_compress_file
2023-03-02 9:55 [f2fs-dev] [PATCH] f2fs: fix to handle filemap_fdatawrite() error in f2fs_ioc_decompress_file/f2fs_ioc_compress_file Yangtao Li via Linux-f2fs-devel
@ 2023-03-21 16:40 ` patchwork-bot+f2fs
2023-03-23 15:21 ` Chao Yu
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+f2fs @ 2023-03-21 16:40 UTC (permalink / raw)
To: Yangtao Li; +Cc: jaegeuk, linux-kernel, linux-f2fs-devel
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:
On Thu, 2 Mar 2023 17:55:09 +0800 you wrote:
> It seems inappropriate that the current logic does not handle
> filemap_fdatawrite() errors, so let's fix it.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> fs/f2fs/file.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
Here is the summary with links:
- [f2fs-dev] f2fs: fix to handle filemap_fdatawrite() error in f2fs_ioc_decompress_file/f2fs_ioc_compress_file
https://git.kernel.org/jaegeuk/f2fs/c/d15180a8d1d7
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: fix to handle filemap_fdatawrite() error in f2fs_ioc_decompress_file/f2fs_ioc_compress_file
2023-03-02 9:55 [f2fs-dev] [PATCH] f2fs: fix to handle filemap_fdatawrite() error in f2fs_ioc_decompress_file/f2fs_ioc_compress_file Yangtao Li via Linux-f2fs-devel
2023-03-21 16:40 ` patchwork-bot+f2fs
@ 2023-03-23 15:21 ` Chao Yu
1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu @ 2023-03-23 15:21 UTC (permalink / raw)
To: Yangtao Li, jaegeuk; +Cc: linux-kernel, linux-f2fs-devel
On 2023/3/2 17:55, Yangtao Li wrote:
> It seems inappropriate that the current logic does not handle
> filemap_fdatawrite() errors, so let's fix it.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-23 15:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-02 9:55 [f2fs-dev] [PATCH] f2fs: fix to handle filemap_fdatawrite() error in f2fs_ioc_decompress_file/f2fs_ioc_compress_file Yangtao Li via Linux-f2fs-devel
2023-03-21 16:40 ` patchwork-bot+f2fs
2023-03-23 15:21 ` 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).