ext4: clear i_state_flags when alloc inode
Subsystems (2)
PATCH 1/1 ext4: clear i_state_flags when alloc inode
i_state_flags used on 32-bit archs, need to clear this flag when alloc inode.
Find this issue when umount ext4, sometimes track the inode as orphan accidently, cause ext4 mesg dump.
--- fs/ext4/ialloc.c | 1 - fs/ext4/inode.c | 1 - fs/ext4/super.c | 1 + 3 files changed, 1 insertion(+), 2 deletions(-)
fs/ext4/ialloc.c +0 -1
@@ -1293,7 +1293,6 @@ struct inode *__ext4_new_inode(struct mnt_idmap *idmap, ei->i_csum_seed =ext4_chksum (csum, (__u8 *)&gen,sizeof (gen)); } -ext4_clear_state_flags (ei);/* Only relevant on 32-bit archs */ ext4_set_inode_state (inode,EXT4_STATE_NEW ); ei->i_extra_isize = sbi->s_want_extra_isize;
fs/ext4/inode.c +0 -1
@@ -5285,7 +5285,6 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino, ei->i_projid =make_kprojid (&init_user_ns, i_projid);set_nlink (inode,le16_to_cpu (raw_inode->i_links_count)); -ext4_clear_state_flags (ei);/* Only relevant on 32-bit archs */ ei->i_inline_off =0 ; ei->i_dir_start_lookup =0 ; ei->i_dtime =le32_to_cpu (raw_inode->i_dtime);
fs/ext4/super.c +1 -0
@@ -1396,6 +1396,7 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)inode_set_iversion (&ei->vfs_inode,1 ); ei->i_flags =0 ; +ext4_clear_state_flags (ei);/* Only relevant on 32-bit archs */ spin_lock_init (&ei->i_raw_lock); ei->i_prealloc_node =RB_ROOT ;atomic_set (&ei->i_prealloc_active,0 );
---
base-commit: 9823120909776bbca58a3c55ef1f27d49283c1f3
change-id: 20251104-ext4-3f9647dcedd0
Best regards,
Signature · 1 line
Haibo Chen <[email protected]>
Quoted 7 lines · Haibo Chen
i_state_flagsused on 32-bit archs, need to clear this flag when alloc inode.
Find this issue when umount ext4, sometimes track the inode as orphan accidently, cause ext4 mesg dump.Fixes acf943e9768e ("ext4: fix checks for orphan inodes")Signed-off-by Haibo Chen <[email protected]>
Looks good to me. Feel free to add:
Honza
Quoted 51 lines
--- fs/ext4/ialloc.c | 1 - fs/ext4/inode.c | 1 - fs/ext4/super.c | 1 + 3 files changed, 1 insertion(+), 2 deletions(-)fs/ext4/ialloc.c +0
-1@@ -1293,7 +1293,6 @@ struct inode *__ext4_new_inode(struct mnt_idmap *idmap, ei->i_csum_seed =ext4_chksum (csum, (__u8 *)&gen,sizeof (gen)); } -ext4_clear_state_flags (ei);/* Only relevant on 32-bit archs */ ext4_set_inode_state (inode,EXT4_STATE_NEW ); ei->i_extra_isize = sbi->s_want_extra_isize;fs/ext4/inode.c +0
-1@@ -5285,7 +5285,6 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino, ei->i_projid =make_kprojid (&init_user_ns, i_projid);set_nlink (inode,le16_to_cpu (raw_inode->i_links_count)); -ext4_clear_state_flags (ei);/* Only relevant on 32-bit archs */ ei->i_inline_off =0 ; ei->i_dir_start_lookup =0 ; ei->i_dtime =le32_to_cpu (raw_inode->i_dtime);fs/ext4/super.c +1
-1@@ -1396,6 +1396,7 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)inode_set_iversion (&ei->vfs_inode,1 ); ei->i_flags =0 ; +ext4_clear_state_flags (ei);/* Only relevant on 32-bit archs */ spin_lock_init (&ei->i_raw_lock); ei->i_prealloc_node =RB_ROOT ;atomic_set (&ei->i_prealloc_active,0 ); ---base-commit:
9823120909776bbca58a3c55ef1f27d49283c1f3
change-id: 20251104-ext4-3f9647dcedd0Best regards,
Signature · 1 line
Haibo Chen <[email protected]>
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Quoted 7 lines · Haibo Chen
i_state_flagsused on 32-bit archs, need to clear this flag when alloc inode.
Find this issue when umount ext4, sometimes track the inode as orphan accidently, cause ext4 mesg dump.Fixes acf943e9768e ("ext4: fix checks for orphan inodes")Signed-off-by Haibo Chen <[email protected]>
Looks good to me.
Quoted 48 lines
--- fs/ext4/ialloc.c | 1 - fs/ext4/inode.c | 1 - fs/ext4/super.c | 1 + 3 files changed, 1 insertion(+), 2 deletions(-)fs/ext4/ialloc.c +0
-1@@ -1293,7 +1293,6 @@ struct inode *__ext4_new_inode(struct mnt_idmap *idmap, ei->i_csum_seed =ext4_chksum (csum, (__u8 *)&gen,sizeof (gen)); } -ext4_clear_state_flags (ei);/* Only relevant on 32-bit archs */ ext4_set_inode_state (inode,EXT4_STATE_NEW ); ei->i_extra_isize = sbi->s_want_extra_isize;fs/ext4/inode.c +0
-1@@ -5285,7 +5285,6 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino, ei->i_projid =make_kprojid (&init_user_ns, i_projid);set_nlink (inode,le16_to_cpu (raw_inode->i_links_count)); -ext4_clear_state_flags (ei);/* Only relevant on 32-bit archs */ ei->i_inline_off =0 ; ei->i_dir_start_lookup =0 ; ei->i_dtime =le32_to_cpu (raw_inode->i_dtime);fs/ext4/super.c +1
-1@@ -1396,6 +1396,7 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)inode_set_iversion (&ei->vfs_inode,1 ); ei->i_flags =0 ; +ext4_clear_state_flags (ei);/* Only relevant on 32-bit archs */ spin_lock_init (&ei->i_raw_lock); ei->i_prealloc_node =RB_ROOT ;atomic_set (&ei->i_prealloc_active,0 ); ---base-commit:
9823120909776bbca58a3c55ef1f27d49283c1f3
change-id: 20251104-ext4-3f9647dcedd0Best regards,
Quoted 7 lines · Haibo Chen
i_state_flagsused on 32-bit archs, need to clear this flag when alloc inode.
Find this issue when umount ext4, sometimes track the inode as orphan accidently, cause ext4 mesg dump.Fixes acf943e9768e ("ext4: fix checks for orphan inodes")Signed-off-by Haibo Chen <[email protected]>
Looks good. Feel free to add:
Quoted 48 lines
--- fs/ext4/ialloc.c | 1 - fs/ext4/inode.c | 1 - fs/ext4/super.c | 1 + 3 files changed, 1 insertion(+), 2 deletions(-)fs/ext4/ialloc.c +0
-1@@ -1293,7 +1293,6 @@ struct inode *__ext4_new_inode(struct mnt_idmap *idmap, ei->i_csum_seed =ext4_chksum (csum, (__u8 *)&gen,sizeof (gen)); } -ext4_clear_state_flags (ei);/* Only relevant on 32-bit archs */ ext4_set_inode_state (inode,EXT4_STATE_NEW ); ei->i_extra_isize = sbi->s_want_extra_isize;fs/ext4/inode.c +0
-1@@ -5285,7 +5285,6 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino, ei->i_projid =make_kprojid (&init_user_ns, i_projid);set_nlink (inode,le16_to_cpu (raw_inode->i_links_count)); -ext4_clear_state_flags (ei);/* Only relevant on 32-bit archs */ ei->i_inline_off =0 ; ei->i_dir_start_lookup =0 ; ei->i_dtime =le32_to_cpu (raw_inode->i_dtime);fs/ext4/super.c +1
-1@@ -1396,6 +1396,7 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)inode_set_iversion (&ei->vfs_inode,1 ); ei->i_flags =0 ; +ext4_clear_state_flags (ei);/* Only relevant on 32-bit archs */ spin_lock_init (&ei->i_raw_lock); ei->i_prealloc_node =RB_ROOT ;atomic_set (&ei->i_prealloc_active,0 ); ---base-commit:
9823120909776bbca58a3c55ef1f27d49283c1f3
change-id: 20251104-ext4-3f9647dcedd0Best regards,
Quoted 6 lines · Haibo Chen
i_state_flagsused on 32-bit archs, need to clear this flag when alloc inode.
Find this issue when umount ext4, sometimes track the inode as orphan accidently, cause ext4 mesg dump.
Applied, thanks!
[1/1] ext4: clear i_state_flags when alloc inode
commit: 322a9e3c77253842617257af246cb5a0ac77851c
Best regards,
Signature · 1 line
Theodore Ts'o <[email protected]>