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, Oct 05, 2024 at 03:14:14PM -0700, Linus Torvalds wrote:

> There are probably other cases that just do "get_file()" on an
> existing 'struct file *" directly, but it's usually fairly hard to get
> users to refer to file pointers without giving an actual file
> descriptor number. But things like "split a vma" will do it (on the
> file that is mapped), and probably a few other cases, but I bet it
> really is just a few cases.

You can keep sending SCM_RIGHTS packets filled with references
to the same file, for example...

Anyway, which error would you return?  EBADF?  Because fget() callers
really expect a struct file reference or NULL.  Sure, we can teach that
to return ERR_PTR() and deal with all callers (not that many these days),
but then there's fdget().  I've looked through those recently; more than
half treats "not open" as EBADF, but there's a bunch of EINVAL, etc.




[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