Commit 4bf3e5de authored by Baokun Li's avatar Baokun Li Committed by Yifan Qiao
Browse files

ext4: clean up s_mb_rb_lock to fix build warnings with C=1

mainline inclusion
from mainline-v6.10-rc1
commit e19089dff547c9e1f09712acc3536d7b0aa9ce3d
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAD018
CVE: CVE-2024-40955

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e19089dff547c9e1f09712acc3536d7b0aa9ce3d



--------------------------------

Running sparse (make C=1) on mballoc.c we get the following warning:

 fs/ext4/mballoc.c:3194:13: warning: context imbalance in
  'ext4_mb_seq_structs_summary_start' - wrong count at exit

This is because __acquires(&EXT4_SB(sb)->s_mb_rb_lock) was called in
ext4_mb_seq_structs_summary_start(), but s_mb_rb_lock was removed in commit
83e80a6e ("ext4: use buckets for cr 1 block scan instead of rbtree"),
so remove the __acquires to silence the warning.

Signed-off-by: default avatarBaokun Li <libaokun1@huawei.com>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20240319113325.3110393-10-libaokun1@huawei.com


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Signed-off-by: default avatarYifan Qiao <qiaoyifan4@huawei.com>
parent aeabdb73
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -3194,7 +3194,6 @@ int ext4_seq_mb_stats_show(struct seq_file *seq, void *offset)
}

static void *ext4_mb_seq_structs_summary_start(struct seq_file *seq, loff_t *pos)
__acquires(&EXT4_SB(sb)->s_mb_rb_lock)
{
	struct super_block *sb = pde_data(file_inode(seq->file));
	unsigned long position;