Re: [PATCH] ovl: add ioctls to retrieve layer file descriptors

Giuseppe Scrivano <[email protected]> Wed, 08 Jul 2026 16:31:54 +0200
Newsgroups org.kernel.vger.linux-unionfs,org.kernel.vger.linux-api,org.kernel.vger.linux-fsdevel
Message-ID <[email protected]>
Miklos Szeredi <[email protected]> writes:

> On Wed, 8 Jul 2026 at 14:27, Giuseppe Scrivano <[email protected]> wrote:
>
>> is there any existing user of such a mechanism?  I don't see any mount
>> specific info under /proc or /sys.
>
> Not yet, but I think it would be good to have one.  It's definitely a
> bigger bite than adding an ioctl(), though.
>
>> >> OVL_IOC_GET_LAYERS_INFO: copy a struct ovl_layers_info to userspace
>> >>                         with numlower, numlowerdata, and has_upper.
>> >
>> > Isn't this info obtainable via statmount(2) already?  If not, it
>> > should be there, instead of a specialized ioctl.
>>
>
>> no that is not exposed by statmount
>
> I mean, you should be able to get that info by counting the lowerdir+,
> datadir+ and upperdir options, no?

Amir suggested to add that functionality when I've asked for some
feedback before sending the patch here.  I am fine to drop it if this is
the consensus although I see its utility from user space.

Regards,
Giuseppe