On Wed, Sep 21, 2022 at 05:07:50PM +0200, Christian Brauner wrote: > > I don't think file_dentry() should be used for this. > > > > file_dentry() is basically a hack for overlayfs's "fake path" thing. > > It should only be used where strictly necessary. At one point it > > would be good to look again at cleaning this mess up. > > Yeah, that's what I was getting at. The file_dentry() helper would > ideally just be as simple as file_inode() and then we'd have > file_dentry_real() for the stacking filesystem scenarios. I would rather minimize the number of places where we access file->f_path.dentry in the first place. Any of those is asking for confusion and overlayfs-triggered bugs. A helper for that would invite bugs where it gets used in places of file_dentry() and vice versa; sure, the same bugs are possible for open-coded variants (and we had such bugs), but I would rather have fewer places doing that to start with (don't get me started on the debugfs design. Please.)