tech-kern archive

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

Re: fcntl(F_GETPATH) support





2019年9月16日(月) 3:43 Jason Thorpe <thorpej%me.com@localhost>:


> On Sep 15, 2019, at 11:03 AM, Christos Zoulas <christos%zoulas.com@localhost> wrote:
>
> I think it is quite reliable because all the file descriptors would be recently
> opened and therefore be in the cache.  One would need to DoS the cache
> cause eviction. If that turns out to be false, we can make the namecache
> reliable, or withdraw it.

If we had a way to ask the file system for the / a name+parent in the event we don't find an entry in the name cache, then we don't have to make the name cache "reliable".

but it would be a super expensive operation for the majority of filesystems, right?
 

FWIW, I don't think making the name cache "reliable" is necessarily a good idea -- it could be abused to consume kernel memory by creating lots of long-named files / directories.

In the event that the name really can't be determined (perhaps it's an open-unlinked file?), then I think it's perfectly reasonable to return ENOENT for F_GETPATH; callers need to be capable of handling that.

-- thorpej



Home | Main Index | Thread Index | Old Index