* [PATCH] fs: assert on I_FREEING not being set in iput() and iput_not_last()
@ 2025-12-01 13:20 Mateusz Guzik
2025-12-02 10:29 ` Jan Kara
2025-12-03 10:15 ` Christian Brauner
0 siblings, 2 replies; 3+ messages in thread
From: Mateusz Guzik @ 2025-12-01 13:20 UTC (permalink / raw)
To: brauner; +Cc: viro, jack, linux-kernel, linux-fsdevel, Mateusz Guzik
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
---
fs/inode.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/inode.c b/fs/inode.c
index cc8265cfe80e..521383223d8a 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1968,7 +1968,7 @@ void iput(struct inode *inode)
retry:
lockdep_assert_not_held(&inode->i_lock);
- VFS_BUG_ON_INODE(inode_state_read_once(inode) & I_CLEAR, inode);
+ VFS_BUG_ON_INODE(inode_state_read_once(inode) & (I_FREEING | I_CLEAR), inode);
/*
* Note this assert is technically racy as if the count is bogusly
* equal to one, then two CPUs racing to further drop it can both
@@ -2010,6 +2010,7 @@ EXPORT_SYMBOL(iput);
*/
void iput_not_last(struct inode *inode)
{
+ VFS_BUG_ON_INODE(inode_state_read_once(inode) & (I_FREEING | I_CLEAR), inode);
VFS_BUG_ON_INODE(atomic_read(&inode->i_count) < 2, inode);
WARN_ON(atomic_sub_return(1, &inode->i_count) == 0);
--
2.48.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fs: assert on I_FREEING not being set in iput() and iput_not_last()
2025-12-01 13:20 [PATCH] fs: assert on I_FREEING not being set in iput() and iput_not_last() Mateusz Guzik
@ 2025-12-02 10:29 ` Jan Kara
2025-12-03 10:15 ` Christian Brauner
1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2025-12-02 10:29 UTC (permalink / raw)
To: Mateusz Guzik; +Cc: brauner, viro, jack, linux-kernel, linux-fsdevel
On Mon 01-12-25 14:20:37, Mateusz Guzik wrote:
> Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Makes sense. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/inode.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/inode.c b/fs/inode.c
> index cc8265cfe80e..521383223d8a 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -1968,7 +1968,7 @@ void iput(struct inode *inode)
>
> retry:
> lockdep_assert_not_held(&inode->i_lock);
> - VFS_BUG_ON_INODE(inode_state_read_once(inode) & I_CLEAR, inode);
> + VFS_BUG_ON_INODE(inode_state_read_once(inode) & (I_FREEING | I_CLEAR), inode);
> /*
> * Note this assert is technically racy as if the count is bogusly
> * equal to one, then two CPUs racing to further drop it can both
> @@ -2010,6 +2010,7 @@ EXPORT_SYMBOL(iput);
> */
> void iput_not_last(struct inode *inode)
> {
> + VFS_BUG_ON_INODE(inode_state_read_once(inode) & (I_FREEING | I_CLEAR), inode);
> VFS_BUG_ON_INODE(atomic_read(&inode->i_count) < 2, inode);
>
> WARN_ON(atomic_sub_return(1, &inode->i_count) == 0);
> --
> 2.48.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fs: assert on I_FREEING not being set in iput() and iput_not_last()
2025-12-01 13:20 [PATCH] fs: assert on I_FREEING not being set in iput() and iput_not_last() Mateusz Guzik
2025-12-02 10:29 ` Jan Kara
@ 2025-12-03 10:15 ` Christian Brauner
1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2025-12-03 10:15 UTC (permalink / raw)
To: Mateusz Guzik; +Cc: Christian Brauner, viro, jack, linux-kernel, linux-fsdevel
On Mon, 01 Dec 2025 14:20:37 +0100, Mateusz Guzik wrote:
>
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes
[1/1] fs: assert on I_FREEING not being set in iput() and iput_not_last()
https://git.kernel.org/vfs/vfs/c/aa8aba61d4e1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-03 10:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-01 13:20 [PATCH] fs: assert on I_FREEING not being set in iput() and iput_not_last() Mateusz Guzik
2025-12-02 10:29 ` Jan Kara
2025-12-03 10:15 ` Christian Brauner
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).