ext2: annotate ext2_update_dynamic_rev() as requiring s_lock

ext2_update_dynamic_rev() modifies several fields within
'struct ext2_super_block' and is already documented as requiring
s_lock. Express that with __must_hold() for Clang's context analysis.

Both callers ext2_xattr_update_super_block() and __ext2_write_inode()
already hold s_lock.

Signed-off-by: Timothy Day <timday@thelustrecollective.com>
Acked-by: Marco Elver <elver@google.com>
Link: https://patch.msgid.link/20260811160336.782342-3-timday@thelustrecollective.com
Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
Timothy Day 2026-08-11 12:03:30 -04:00 committed by Jan Kara
parent e76ed86ee8
commit eb34d14371
2 changed files with 3 additions and 1 deletions

View File

@ -761,7 +761,8 @@ extern __printf(3, 4)
void ext2_error(struct super_block *, const char *, const char *, ...);
extern __printf(3, 4)
void ext2_msg(struct super_block *, const char *, const char *, ...);
extern void ext2_update_dynamic_rev (struct super_block *sb);
extern void ext2_update_dynamic_rev(struct super_block *sb)
__must_hold(&EXT2_SB(sb)->s_lock);
extern void ext2_sync_super(struct super_block *sb, struct ext2_super_block *es,
int wait);

View File

@ -127,6 +127,7 @@ void ext2_msg(struct super_block *sb, const char *prefix,
* This must be called with sbi->s_lock held.
*/
void ext2_update_dynamic_rev(struct super_block *sb)
__must_hold(&EXT2_SB(sb)->s_lock)
{
struct ext2_super_block *es = EXT2_SB(sb)->s_es;