Re: [PATCH] dcache: rename d_genocide()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux