Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs: assert on I_FREEING not being set in iput() and iput_not_last()

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Link: https://patch.msgid.link/20251201132037.22835-1-mjguzik@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Mateusz Guzik and committed by
Christian Brauner
aa8aba61 222047f6

+2 -1
+2 -1
fs/inode.c
··· 1968 1968 1969 1969 retry: 1970 1970 lockdep_assert_not_held(&inode->i_lock); 1971 - VFS_BUG_ON_INODE(inode_state_read_once(inode) & I_CLEAR, inode); 1971 + VFS_BUG_ON_INODE(inode_state_read_once(inode) & (I_FREEING | I_CLEAR), inode); 1972 1972 /* 1973 1973 * Note this assert is technically racy as if the count is bogusly 1974 1974 * equal to one, then two CPUs racing to further drop it can both ··· 2010 2010 */ 2011 2011 void iput_not_last(struct inode *inode) 2012 2012 { 2013 + VFS_BUG_ON_INODE(inode_state_read_once(inode) & (I_FREEING | I_CLEAR), inode); 2013 2014 VFS_BUG_ON_INODE(atomic_read(&inode->i_count) < 2, inode); 2014 2015 2015 2016 WARN_ON(atomic_sub_return(1, &inode->i_count) == 0);