On Mon, Feb 12, 2024 at 09:02:58AM +0200, Amir Goldstein wrote: > If you are going to make kill_litter_super() an alias of kill_anon_super() > I suggest going the extra mile and replacing the remaining 30 instances of > kill_litter_super(). > > If the rules become straight forward for the default ->kill_sb(), > then maybe we should even make ->kill_sb() optional and do: > > diff --git a/fs/super.c b/fs/super.c > index d35e85295489..6200cac0e4f8 100644 > --- a/fs/super.c > +++ b/fs/super.c > @@ -458,6 +458,18 @@ static void kill_super_notify(struct super_block *sb) > super_wake(sb, SB_DEAD); > } > > +static void kill_sb(struct super_block *s) > +{ > + struct file_system_type *fs = s->s_type; > + > + if (fs->kill_sb) > + fs->kill_sb(s); > + else if (fs->fs_flags & FS_REQUIRES_DEV) > + kill_block_super(s); > + else > + kill_anon_super(s); > +} Bloody bad idea, IMO. Note that straight use of kill_anon_super() pretty much forces you into doing everything from ->put_super(). And that leads to rather clumsy failure exits in foo_fill_super(), since you *won't* get ->put_super() called unless you've got to setting ->s_root. Considering how easily the failure exits rot, I'd rather discourage that variant.