Re: [git pull] d_revalidate pile

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

 



On Mon, 27 Jan 2025 at 16:27, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>
>  struct external_name {
>         atomic_t count;
>         struct rcu_head head;
>         unsigned char name[] __aligned(sizeof(unsigned long));
>  };

Btw, now that the external name looks like this, and has a 32-bit hole
on 64-bit, I wonder if we should just add a length to the external
name.

It would be free on 64-bit, and it would actually mean that we could
atomically load the name and the length for external names and never
worry about any overruns.

The internal name would still race, since the length in the dentry can
change at any time under us, but any code that really needs to avoid
an overrun and doesn't take any locks can still do things like

        if (name == &dentry->d_iname && len >= DNAME_INLINE_LEN)
                .. we know we raced ..

and for things like d_path() or similar at worst it can just limit len
to DNAME_INLINE_LEN-1 or whatever.

I'm thinking mainly dentry_string_cmp(), which currently does things
one byte at a time at least partially for the "I must not overrun a
NUL character because 'len' may be bogus" reason.

Maybe I'm just being silly.

          Linus




[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