Re: [PATCH RFC 0/4] fs: port files to rcuref_long_t

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

 



On Sat, 5 Oct 2024 at 14:42, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> and I think that might work, although the zero count case worries me
> (ie 'fput twice').
>
> Currently we avoid the fput twice because we use that
> "inc_not_zero()". So that needs some thinking about.

Actually, it's worse. Even the

        if (ret > 1)

case is dangerous, because we could have two or more threads doing
that atomic_inc_return() on a dead file descriptor at the same time.

So that approach is just broken.

               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