Skip to contentSkip to conversation

What about adding AT_NO_AUTOMOUNT analogue to openat2?

DISCUSSION Askar Safin 4 participants 5 messages Apr 10, 2020 – Apr 11, 2020

Subsystems (2)
lore
Share & tools
lore
#1 lore raw
Quoted 1 line · Askar Safin

What about adding stat's AT_NO_AUTOMOUNT analogue to openat2?

There isn't one. I did intend to add RESOLVE_NO_AUTOMOUNTS after openat2 was merged -- it's even mentioned in the commit message -- but I haven't gotten around to it yet. The reason it wasn't added from the outset was that I wasn't sure if adding it would be as simple as the other RESOLVE_* flags.

Note that like all RESOLVE_* flags, it would apply to all components so it wouldn't be truly analogous with AT_NO_AUTOMOUNT (though as I've discussed at length on this ML, most people do actually want the RESOLVE_* semantics). But you can emulate the AT_* ones much more easily with RESOLVE_* than vice-versa).

Signature · 4 lines
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
<https://www.cyphar.com/>
maintainer
#2 lore raw
Quoted 9 lines · Aleksa Sarai
Quoted 1 line · Askar Safin

What about adding stat's AT_NO_AUTOMOUNT analogue to openat2?

There isn't one. I did intend to add RESOLVE_NO_AUTOMOUNTS after openat2 was merged -- it's even mentioned in the commit message -- but I haven't gotten around to it yet. The reason it wasn't added from the outset was that I wasn't sure if adding it would be as simple as the other RESOLVE_* flags.

Quoted 5 lines

Note that like all RESOLVE_* flags, it would apply to all components so it wouldn't be truly analogous with AT_NO_AUTOMOUNT (though as I've discussed at length on this ML, most people do actually want the RESOLVE_* semantics). But you can emulate the AT_* ones much more easily with RESOLVE_* than vice-versa).

Er... Not triggering automount on anything but the last component means failing with ENOENT. *All* automount points are empty and are bloody well going to remain such, as far as I'm concerned.

#3 lore raw
Quoted 16 lines · Al Viro
Quoted 9 lines · Aleksa Sarai
Quoted 1 line · Askar Safin

What about adding stat's AT_NO_AUTOMOUNT analogue to openat2?

There isn't one. I did intend to add RESOLVE_NO_AUTOMOUNTS after openat2 was merged -- it's even mentioned in the commit message -- but I haven't gotten around to it yet. The reason it wasn't added from the outset was that I wasn't sure if adding it would be as simple as the other RESOLVE_* flags.

Quoted 5 lines

Note that like all RESOLVE_* flags, it would apply to all components so it wouldn't be truly analogous with AT_NO_AUTOMOUNT (though as I've discussed at length on this ML, most people do actually want the RESOLVE_* semantics). But you can emulate the AT_* ones much more easily with RESOLVE_* than vice-versa).

Quoted 3 lines

Er... Not triggering automount on anything but the last component means failing with ENOENT. *All* automount points are empty and are bloody well going to remain such, as far as I'm concerned.

I wasn't suggesting that RESOLVE_NO_AUTOMOUNTS would unmask whatever is on the underlying filesystem -- I agree that would be completely insane.

It would just give you -EXDEV (or perhaps -EREMOTE) if you walk into an automount (the same logic as with the other RESOLVE_NO_* flags). We could make it -ENOENT if you prefer, but that means userspace can't tell the difference between it hitting an automount and the target actually not existing.

Signature · 4 lines
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
<https://www.cyphar.com/>
#4 lore raw

* Aleksa Sarai:

Quoted 5 lines

It would just give you -EXDEV (or perhaps -EREMOTE) if you walk into an automount (the same logic as with the other RESOLVE_NO_* flags). We could make it -ENOENT if you prefer, but that means userspace can't tell the difference between it hitting an automount and the target actually not existing.

Maybe there's a better way to show the difference to userspace involving something related to O_PATH?