Re: xattr names for unprivileged stacking?

Miklos Szeredi
2020-08-30T19:05:56Z

On Sat, Aug 29, 2020 at 9:25 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> On Sat, Aug 29, 2020 at 09:13:24PM +0200, Miklos Szeredi wrote:
>
> > > d_path() is the least of the problems, actually. Directory tree structure on
> > > those, OTOH, is a serious problem. If you want to have getdents(2) on that
> > > shite, you want an opened descriptor that looks like a directory. And _that_
> > > opens a large can of worms. Because now you have fchdir(2) to cope with,
> > > lookups going through /proc/self/fd/<n>/..., etc., etc.
> >
> > Seriously, nobody wants fchdir(). And getdents() does not imply fchdir().
>
> Yes, it does. If it's a directory, fchdir(2) gets to deal with it.
> If it's not, no getdents(2). Unless you special-case the damn thing in
> said fchdir(2).

Huh? f_op->iterate() needed for getdents(2) and i_op->lookup() needed
for fchdir(2).

Yes, open(..., O_ALT) would be special. Let's call it open_alt(2) to
avoid confusion with normal open on a normal filesystem. No special
casing anywhere at all. It's a completely new interface that returns
a file which either has ->read/write() or ->iterate() and which points
to an inode with empty i_ops.

Thanks,
Miklos