linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: don't call iput() from f2fs_drop_inode()
       [not found] <202509301450.138b448f-lkp@intel.com>
@ 2025-09-30 23:29 ` Mateusz Guzik
  2025-10-01 15:39   ` Jaegeuk Kim
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mateusz Guzik @ 2025-09-30 23:29 UTC (permalink / raw)
  To: brauner
  Cc: linux-kernel, linux-fsdevel, josef, oe-lkp, linux-f2fs-devel, ltp,
	oliver.sang, Mateusz Guzik

iput() calls the problematic routine, which does a ->i_count inc/dec
cycle. Undoing it with iput() recurses into the problem.

Note f2fs should not be playing games with the refcount to begin with,
but that will be handled later. Right now solve the immediate
regression.

Fixes: bc986b1d756482a ("fs: stop accessing ->i_count directly in f2fs and gfs2")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202509301450.138b448f-lkp@intel.com
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
---
 fs/f2fs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 2619cbbd7d2d..26ec31eb8c80 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1769,7 +1769,7 @@ static int f2fs_drop_inode(struct inode *inode)
 			sb_end_intwrite(inode->i_sb);
 
 			spin_lock(&inode->i_lock);
-			iput(inode);
+			atomic_dec(&inode->i_count);
 		}
 		trace_f2fs_drop_inode(inode, 0);
 		return 0;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] f2fs: don't call iput() from f2fs_drop_inode()
  2025-09-30 23:29 ` [PATCH] f2fs: don't call iput() from f2fs_drop_inode() Mateusz Guzik
@ 2025-10-01 15:39   ` Jaegeuk Kim
  2025-10-06 18:00   ` [f2fs-dev] " patchwork-bot+f2fs
  2025-10-09  3:34   ` Chao Yu
  2 siblings, 0 replies; 4+ messages in thread
From: Jaegeuk Kim @ 2025-10-01 15:39 UTC (permalink / raw)
  To: Mateusz Guzik
  Cc: brauner, linux-kernel, linux-fsdevel, josef, oe-lkp,
	linux-f2fs-devel, ltp, oliver.sang

On 10/01, Mateusz Guzik wrote:
> iput() calls the problematic routine, which does a ->i_count inc/dec
> cycle. Undoing it with iput() recurses into the problem.
> 
> Note f2fs should not be playing games with the refcount to begin with,
> but that will be handled later. Right now solve the immediate
> regression.
> 
> Fixes: bc986b1d756482a ("fs: stop accessing ->i_count directly in f2fs and gfs2")
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Closes: https://lore.kernel.org/oe-lkp/202509301450.138b448f-lkp@intel.com
> Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
> ---
>  fs/f2fs/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 2619cbbd7d2d..26ec31eb8c80 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -1769,7 +1769,7 @@ static int f2fs_drop_inode(struct inode *inode)
>  			sb_end_intwrite(inode->i_sb);
>  
>  			spin_lock(&inode->i_lock);
> -			iput(inode);
> +			atomic_dec(&inode->i_count);

It seems this was applied by Josef [1], added in 6.18-rc1. Let me apply this fix
after my f2fs pull request, since I don't have this issue in my -next tree yet.

[1] https://lore.kernel.org/all/b8e6eb8a3e690ce082828d3580415bf70dfa93aa.1755806649.git.josef@toxicpanda.com/

>  		}
>  		trace_f2fs_drop_inode(inode, 0);
>  		return 0;
> -- 
> 2.43.0
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: don't call iput() from f2fs_drop_inode()
  2025-09-30 23:29 ` [PATCH] f2fs: don't call iput() from f2fs_drop_inode() Mateusz Guzik
  2025-10-01 15:39   ` Jaegeuk Kim
@ 2025-10-06 18:00   ` patchwork-bot+f2fs
  2025-10-09  3:34   ` Chao Yu
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+f2fs @ 2025-10-06 18:00 UTC (permalink / raw)
  To: Mateusz Guzik
  Cc: brauner, linux-kernel, linux-f2fs-devel, oe-lkp, oliver.sang,
	linux-fsdevel, josef, ltp

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:

On Wed,  1 Oct 2025 01:29:57 +0200 you wrote:
> iput() calls the problematic routine, which does a ->i_count inc/dec
> cycle. Undoing it with iput() recurses into the problem.
> 
> Note f2fs should not be playing games with the refcount to begin with,
> but that will be handled later. Right now solve the immediate
> regression.
> 
> [...]

Here is the summary with links:
  - [f2fs-dev] f2fs: don't call iput() from f2fs_drop_inode()
    https://git.kernel.org/jaegeuk/f2fs/c/8ec5fc1ff77e

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] 4+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: don't call iput() from f2fs_drop_inode()
  2025-09-30 23:29 ` [PATCH] f2fs: don't call iput() from f2fs_drop_inode() Mateusz Guzik
  2025-10-01 15:39   ` Jaegeuk Kim
  2025-10-06 18:00   ` [f2fs-dev] " patchwork-bot+f2fs
@ 2025-10-09  3:34   ` Chao Yu
  2 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2025-10-09  3:34 UTC (permalink / raw)
  To: Mateusz Guzik, brauner
  Cc: chao, linux-kernel, linux-f2fs-devel, oe-lkp, oliver.sang,
	linux-fsdevel, josef, ltp

On 10/1/2025 7:29 AM, Mateusz Guzik wrote:
> iput() calls the problematic routine, which does a ->i_count inc/dec
> cycle. Undoing it with iput() recurses into the problem.
> 
> Note f2fs should not be playing games with the refcount to begin with,
> but that will be handled later. Right now solve the immediate
> regression.
> 
> Fixes: bc986b1d756482a ("fs: stop accessing ->i_count directly in f2fs and gfs2")
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Closes: https://lore.kernel.org/oe-lkp/202509301450.138b448f-lkp@intel.com
> Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-09  3:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <202509301450.138b448f-lkp@intel.com>
2025-09-30 23:29 ` [PATCH] f2fs: don't call iput() from f2fs_drop_inode() Mateusz Guzik
2025-10-01 15:39   ` Jaegeuk Kim
2025-10-06 18:00   ` [f2fs-dev] " patchwork-bot+f2fs
2025-10-09  3:34   ` 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).