Re: [PATCH v1 2/9] ext2: mark s_next_generation as guarded by s_next_gen_lock

Jan Kara <[email protected]>
Newsgroups org.kernel.vger.linux-ext4,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel
Message-ID <hf3qj2wqalzphmmz3r47ileff2cktc6hjhyjijba7q7stanapq@tmtqy6yup6c3>
On Thu 16-07-26 22:03:02, Timothy Day wrote:
> On Sun, 12 Jul 2026 12:56:03 -0400, Timothy Day wrote:
> > diff --git a/fs/ext2/super.c b/fs/ext2/super.c
> > index 3999f8f3b156e..8c7f3772917bb 100644
> > --- a/fs/ext2/super.c
> > +++ b/fs/ext2/super.c
> > @@ -1125,9 +1125,11 @@ static int ext2_fill_super(struct super_block *sb, struct fs_context *fc)
> >  		goto failed_mount2;
> >  	}
> >  	sbi->s_gdb_count = db_count;
> > -	sbi->s_next_generation = get_random_u32();
> >  	spin_lock_init(&sbi->s_next_gen_lock);
> 
> If I change this to guard(spinlock_init)(&sbi->s_next_gen_lock), I should
> be able to avoid the context_unsafe() line right after this. I'll fix
> that in the next revision. There may be some other places in the series
> where I can make the same fix.

Yeah, I guess that would be a tad bit better.

								Honza

-- 
Jan Kara <[email protected]>
SUSE Labs, CR
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.