* [f2fs-dev] [PATCH] f2fs: fix to return correct error number in f2fs_sync_node_pages()
@ 2025-05-07 8:08 Chao Yu via Linux-f2fs-devel
2025-05-08 16:30 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
0 siblings, 1 reply; 2+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2025-05-07 8:08 UTC (permalink / raw)
To: jaegeuk; +Cc: Christoph Hellwig, linux-kernel, stable, linux-f2fs-devel
If __write_node_folio() failed, it will return AOP_WRITEPAGE_ACTIVATE,
the incorrect return value may be passed to userspace in below path,
fix it.
- sync_filesystem
- sync_fs
- f2fs_issue_checkpoint
- block_operations
- f2fs_sync_node_pages
- __write_node_folio
: return AOP_WRITEPAGE_ACTIVATE
Cc: stable@vger.kernel.org
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chao Yu <chao@kernel.org>
---
fs/f2fs/node.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index ec74eb9982a5..69308523c34e 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -2092,10 +2092,14 @@ int f2fs_sync_node_pages(struct f2fs_sb_info *sbi,
ret = __write_node_folio(folio, false, &submitted,
wbc, do_balance, io_type, NULL);
- if (ret)
+ if (ret) {
folio_unlock(folio);
- else if (submitted)
+ folio_batch_release(&fbatch);
+ ret = -EIO;
+ goto out;
+ } else if (submitted) {
nwritten++;
+ }
if (--wbc->nr_to_write == 0)
break;
--
2.49.0
_______________________________________________
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] 2+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: fix to return correct error number in f2fs_sync_node_pages()
2025-05-07 8:08 [f2fs-dev] [PATCH] f2fs: fix to return correct error number in f2fs_sync_node_pages() Chao Yu via Linux-f2fs-devel
@ 2025-05-08 16:30 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+f2fs--- via Linux-f2fs-devel @ 2025-05-08 16:30 UTC (permalink / raw)
To: Chao Yu; +Cc: jaegeuk, linux-f2fs-devel, hch, stable, linux-kernel
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:
On Wed, 7 May 2025 16:08:38 +0800 you wrote:
> If __write_node_folio() failed, it will return AOP_WRITEPAGE_ACTIVATE,
> the incorrect return value may be passed to userspace in below path,
> fix it.
>
> - sync_filesystem
> - sync_fs
> - f2fs_issue_checkpoint
> - block_operations
> - f2fs_sync_node_pages
> - __write_node_folio
> : return AOP_WRITEPAGE_ACTIVATE
>
> [...]
Here is the summary with links:
- [f2fs-dev] f2fs: fix to return correct error number in f2fs_sync_node_pages()
https://git.kernel.org/jaegeuk/f2fs/c/43ba56a043b1
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] 2+ messages in thread
end of thread, other threads:[~2025-05-08 16:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-07 8:08 [f2fs-dev] [PATCH] f2fs: fix to return correct error number in f2fs_sync_node_pages() Chao Yu via Linux-f2fs-devel
2025-05-08 16:30 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
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).