* [PATCH] f2fs: fix dentry folio leak in find_in_level
@ 2026-07-13 6:36 ` Guanghui Yang via Linux-f2fs-devel
0 siblings, 0 replies; 8+ messages in thread
From: Guanghui Yang @ 2026-07-13 6:36 UTC (permalink / raw)
To: Jaegeuk Kim; +Cc: Chao Yu, linux-f2fs-devel, linux-kernel, Guanghui Yang
find_in_level() gets a dentry folio with f2fs_find_data_folio() before
calling find_in_block(). If find_in_block() returns an error, the
function stores the error in res_folio and breaks out of the loop without
dropping the dentry folio.
This leaks the folio reference on the find_in_block() error path. Drop
the dentry folio before returning the error to the caller.
Signed-off-by: Guanghui Yang <3497809730@qq.com>
---
fs/f2fs/dir.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index a9563f7fcd88..0562ad211351 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -320,6 +320,7 @@ static struct f2fs_dir_entry *find_in_level(struct inode *dir,
de = find_in_block(dir, dentry_folio, fname, &max_slots, use_hash);
if (IS_ERR(de)) {
+ f2fs_folio_put(dentry_folio, false);
*res_folio = ERR_CAST(de);
de = NULL;
break;
base-commit: a13c140cc289c0b7b3770bce5b3ad42ab35074aa
--
2.52.0.windows.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [f2fs-dev] [PATCH] f2fs: fix dentry folio leak in find_in_level
@ 2026-07-13 6:36 ` Guanghui Yang via Linux-f2fs-devel
0 siblings, 0 replies; 8+ messages in thread
From: Guanghui Yang via Linux-f2fs-devel @ 2026-07-13 6:36 UTC (permalink / raw)
To: Jaegeuk Kim; +Cc: Guanghui Yang, linux-kernel, linux-f2fs-devel
find_in_level() gets a dentry folio with f2fs_find_data_folio() before
calling find_in_block(). If find_in_block() returns an error, the
function stores the error in res_folio and breaks out of the loop without
dropping the dentry folio.
This leaks the folio reference on the find_in_block() error path. Drop
the dentry folio before returning the error to the caller.
Signed-off-by: Guanghui Yang <3497809730@qq.com>
---
fs/f2fs/dir.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index a9563f7fcd88..0562ad211351 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -320,6 +320,7 @@ static struct f2fs_dir_entry *find_in_level(struct inode *dir,
de = find_in_block(dir, dentry_folio, fname, &max_slots, use_hash);
if (IS_ERR(de)) {
+ f2fs_folio_put(dentry_folio, false);
*res_folio = ERR_CAST(de);
de = NULL;
break;
base-commit: a13c140cc289c0b7b3770bce5b3ad42ab35074aa
--
2.52.0.windows.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] 8+ messages in thread* Re: [f2fs-dev] [PATCH] f2fs: fix dentry folio leak in find_in_level
2026-07-13 6:36 ` [f2fs-dev] " Guanghui Yang via Linux-f2fs-devel
@ 2026-07-19 7:17 ` Chao Yu
-1 siblings, 0 replies; 8+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2026-07-19 7:17 UTC (permalink / raw)
To: Guanghui Yang, Jaegeuk Kim; +Cc: linux-kernel, linux-f2fs-devel
On 7/13/26 14:36, Guanghui Yang wrote:
> find_in_level() gets a dentry folio with f2fs_find_data_folio() before
> calling find_in_block(). If find_in_block() returns an error, the
> function stores the error in res_folio and breaks out of the loop without
> dropping the dentry folio.
>
> This leaks the folio reference on the find_in_block() error path. Drop
> the dentry folio before returning the error to the caller.
>
Need fixes and Cc stable lines.
> Signed-off-by: Guanghui Yang <3497809730@qq.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] 8+ messages in thread
* Re: [PATCH] f2fs: fix dentry folio leak in find_in_level
@ 2026-07-19 7:17 ` Chao Yu
0 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2026-07-19 7:17 UTC (permalink / raw)
To: Guanghui Yang, Jaegeuk Kim; +Cc: chao, linux-f2fs-devel, linux-kernel
On 7/13/26 14:36, Guanghui Yang wrote:
> find_in_level() gets a dentry folio with f2fs_find_data_folio() before
> calling find_in_block(). If find_in_block() returns an error, the
> function stores the error in res_folio and breaks out of the loop without
> dropping the dentry folio.
>
> This leaks the folio reference on the find_in_block() error path. Drop
> the dentry folio before returning the error to the caller.
>
Need fixes and Cc stable lines.
> Signed-off-by: Guanghui Yang <3497809730@qq.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2] f2fs: fix dentry folio leak in find_in_level
2026-07-13 6:36 ` [f2fs-dev] " Guanghui Yang via Linux-f2fs-devel
@ 2026-07-19 8:45 ` Guanghui Yang via Linux-f2fs-devel
-1 siblings, 0 replies; 8+ messages in thread
From: Guanghui Yang @ 2026-07-19 8:45 UTC (permalink / raw)
To: jaegeuk; +Cc: chao, linux-f2fs-devel, linux-kernel, Guanghui Yang, stable
find_in_level() gets a dentry folio with f2fs_find_data_folio() before
calling find_in_block(). If find_in_block() returns an error, the
function stores the error in res_folio and breaks out of the loop without
dropping the dentry folio.
This leaks the folio reference on the find_in_block() error path. Drop
the dentry folio before returning the error to the caller.
Fixes: 7ad08a58bf67 ("f2fs: Handle casefolding with Encryption")
Cc: stable@vger.kernel.org
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Guanghui Yang <3497809730@qq.com>
---
fs/f2fs/dir.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index a9563f7fcd88..0562ad211351 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -320,6 +320,7 @@ static struct f2fs_dir_entry *find_in_level(struct inode *dir,
de = find_in_block(dir, dentry_folio, fname, &max_slots, use_hash);
if (IS_ERR(de)) {
+ f2fs_folio_put(dentry_folio, false);
*res_folio = ERR_CAST(de);
de = NULL;
break;
base-commit: a13c140cc289c0b7b3770bce5b3ad42ab35074aa
--
2.52.0.windows.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [f2fs-dev] [PATCH v2] f2fs: fix dentry folio leak in find_in_level
@ 2026-07-19 8:45 ` Guanghui Yang via Linux-f2fs-devel
0 siblings, 0 replies; 8+ messages in thread
From: Guanghui Yang via Linux-f2fs-devel @ 2026-07-19 8:45 UTC (permalink / raw)
To: jaegeuk; +Cc: Guanghui Yang, linux-kernel, stable, linux-f2fs-devel
find_in_level() gets a dentry folio with f2fs_find_data_folio() before
calling find_in_block(). If find_in_block() returns an error, the
function stores the error in res_folio and breaks out of the loop without
dropping the dentry folio.
This leaks the folio reference on the find_in_block() error path. Drop
the dentry folio before returning the error to the caller.
Fixes: 7ad08a58bf67 ("f2fs: Handle casefolding with Encryption")
Cc: stable@vger.kernel.org
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Guanghui Yang <3497809730@qq.com>
---
fs/f2fs/dir.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index a9563f7fcd88..0562ad211351 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -320,6 +320,7 @@ static struct f2fs_dir_entry *find_in_level(struct inode *dir,
de = find_in_block(dir, dentry_folio, fname, &max_slots, use_hash);
if (IS_ERR(de)) {
+ f2fs_folio_put(dentry_folio, false);
*res_folio = ERR_CAST(de);
de = NULL;
break;
base-commit: a13c140cc289c0b7b3770bce5b3ad42ab35074aa
--
2.52.0.windows.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] 8+ messages in thread* Re: [f2fs-dev] [PATCH v2] f2fs: fix dentry folio leak in find_in_level
2026-07-19 8:45 ` [f2fs-dev] " Guanghui Yang via Linux-f2fs-devel
@ 2026-07-28 1:00 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
-1 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+f2fs @ 2026-07-28 1:00 UTC (permalink / raw)
To: Guanghui Yang; +Cc: jaegeuk, linux-kernel, stable, linux-f2fs-devel
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:
On Sun, 19 Jul 2026 16:45:14 +0800 you wrote:
> find_in_level() gets a dentry folio with f2fs_find_data_folio() before
> calling find_in_block(). If find_in_block() returns an error, the
> function stores the error in res_folio and breaks out of the loop without
> dropping the dentry folio.
>
> This leaks the folio reference on the find_in_block() error path. Drop
> the dentry folio before returning the error to the caller.
>
> [...]
Here is the summary with links:
- [f2fs-dev,v2] f2fs: fix dentry folio leak in find_in_level
https://git.kernel.org/jaegeuk/f2fs/c/13f88c0865be
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-07-28 1:01 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-13 6:36 [PATCH] f2fs: fix dentry folio leak in find_in_level Guanghui Yang
2026-07-13 6:36 ` [f2fs-dev] " Guanghui Yang via Linux-f2fs-devel
2026-07-19 7:17 ` Chao Yu via Linux-f2fs-devel
2026-07-19 7:17 ` Chao Yu
2026-07-19 8:45 ` [PATCH v2] " Guanghui Yang
2026-07-19 8:45 ` [f2fs-dev] " Guanghui Yang via Linux-f2fs-devel
2026-07-28 1:00 ` patchwork-bot+f2fs
2026-07-28 1:00 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.