fuse4x ioctl

122 views
Skip to first unread message

Florian Bogner

unread,
Mar 14, 2012, 8:57:53 AM3/14/12
to fus...@googlegroups.com

Hello,

After first posting to the wrong mailing list I'm hopefully on the right now...

I'm trying to implement an ioctl call for a FUSE filesystem.
After searching around I found this blogpost: http://fuse4x.1054701.n5.nabble.com/Fuse4X-0-8-7-has-been-released-td4610274.html
It say's that one of the next releases will feature ioctl in fuse4x - but I didn't find any further information.

Can someone maybe give me an update on this?
Is there already some code or is someone working on it?
Is help needed?

Anatol Pomozov

unread,
Mar 14, 2012, 5:54:44 PM3/14/12
to fus...@googlegroups.com
Hi, Florian.

On Wed, Mar 14, 2012 at 5:57 AM, Florian Bogner <fbo...@gmail.com> wrote:
> Hello,
>
> After first posting to the wrong mailing list I'm hopefully on the right
> now...
>
> I'm trying to implement an ioctl call for a FUSE filesystem.
> After searching around I found this
> blogpost: http://fuse4x.1054701.n5.nabble.com/Fuse4X-0-8-7-has-been-released-td4610274.html
> It say's that one of the next releases will feature ioctl in fuse4x - but I
> didn't find any further information.

I expected to implement it soon after 0.8.7 but never had time for it. Sorry.

> Can someone maybe give me an update on this?

FUSE_IOCTL is not implemented as well as other bits (e.g. FUSE_POLL)
but it is definitely on my plate and I would like to implement it. The
userspace part is ready so the only thing have to be done is kernel
part.

> Is there already some code or is someone working on it?

IOCTL sits half-baked in my local repo - I'll try to look at it once again.

> Is help needed?
The project is constantly looking for a new contributors/developers so
yes, any help is welcome. Especially if you have experience with
- XNU/BSD virtual filesystem layer
- Packermaker tool
- Objective C

Florian Bogner

unread,
Mar 14, 2012, 6:07:25 PM3/14/12
to fus...@googlegroups.com
Hi Anatol,

Yes we were really happy when we discovered the user space part - fuse4x is currently the only one having the headers.

Yes I'm definitely interest in getting involved - the problem is that I'm currently quite stressed (full time job + university)
I did quite some low level development (mainly on embedded systems) so the kernel module (VFS) is the most interesting part for me.

Are you interested in implementing the IOCTL part or would you like to source it out? ;-)

Florian Bogner

eMail: fbo...@gmail.com

Anatol Pomozov

unread,
Mar 14, 2012, 6:15:38 PM3/14/12
to fus...@googlegroups.com
Hi

On Wed, Mar 14, 2012 at 3:07 PM, Florian Bogner <fbo...@gmail.com> wrote:
> Hi Anatol,
>
> Yes we were really happy when we discovered the user space part - fuse4x is
> currently the only one having the headers.
>
> Yes I'm definitely interest in getting involved - the problem is that I'm
> currently quite stressed (full time job + university)

Yep, I feel your pain :)

> I did quite some low level development (mainly on embedded systems) so the
> kernel module (VFS) is the most interesting part for me.
>
> Are you interested in implementing the IOCTL part or would you like to
> source it out? ;-)

If you can take care of IOCTL in kernel this would be really great. I
expect that this function will be ~50-60 lines of code.

Florian Bogner

unread,
Mar 14, 2012, 6:22:57 PM3/14/12
to fus...@googlegroups.com
Hi

Jep that sounds like a plan!

Could you just send me a patch from the things you already did - then I would take a look and create a small timeframe...

I'm on holiday in two weeks so I think that's a good starting point.

Florian Bogner

Mobil: +43 664 82 000 30
eMail: fbo...@gmail.com

Anatol Pomozov

unread,
Mar 14, 2012, 7:14:24 PM3/14/12
to fus...@googlegroups.com
Hi

On Wed, Mar 14, 2012 at 3:22 PM, Florian Bogner <fbo...@gmail.com> wrote:
> Hi
>

> Jep that sounds like a plan!
>
> Could you just send me a patch from the things you already did - then I
> would take a look and create a small timeframe...

Sure. I rebased my changes and pushed it here
https://github.com/anatol/kext/tree/ioctl

Anatol Pomozov

unread,
Mar 14, 2012, 7:50:37 PM3/14/12
to fus...@googlegroups.com
Hi

On Wed, Mar 14, 2012 at 4:14 PM, Anatol Pomozov
<anatol....@gmail.com> wrote:
> Hi
>

> On Wed, Mar 14, 2012 at 3:22 PM, Florian Bogner <fbo...@gmail.com> wrote:
>> Hi
>>
>> Jep that sounds like a plan!
>>
>> Could you just send me a patch from the things you already did - then I
>> would take a look and create a small timeframe...
>
> Sure. I rebased my changes and pushed it here
> https://github.com/anatol/kext/tree/ioctl

I stuck with the fact that ioctl() returns ENOTTY. It might be related
to this function
https://github.com/anatol/xnu/blob/master/bsd/vfs/vfs_vnops.c#L1259

It looks like XNU does not allow custom ioctl for regular files (only
for device files???). I did not find any solution how to make ioctl
call to fuse VNOP function.

Florian Bogner

unread,
Mar 15, 2012, 4:36:57 AM3/15/12
to fus...@googlegroups.com, Eddi Weinwurm
Hello,

After readying the ioctl man page I totally agree with you!


     [ENOTTY]           fildes is not associated with a character special
                        device.

     [ENOTTY]           The specified request does not apply to the kind of
                        object that the descriptor fildes references.

ioctl should only be called on special devices!

I think the fcntl call (http://pubs.opengroup.org/onlinepubs/009695399/functions/fcntl.htmlhttp://linux.die.net/man/2/fcntl) is more interesting (at least for me).


To get back to basics:
I will first check out what fuse it doing with the ioctl syscal! 


Florian Bogner

Mobil: +43 664 82 000 30
eMail: fbo...@gmail.com

Anatol Pomozov

unread,
Mar 18, 2012, 6:56:17 PM3/18/12
to fus...@googlegroups.com, Eddi Weinwurm
Hi,

On Thu, Mar 15, 2012 at 1:36 AM, Florian Bogner <fbo...@gmail.com> wrote:
> Hello,
>

> After readying the ioctl man page I totally agree with you!
>
> http://www.manpagez.com/man/2/ioctl/
>
> [ENOTTY] fildes is not associated with a character special
> device.
>
> [ENOTTY] The specified request does not apply to the kind of
> object that the descriptor fildes references.


> ioctl should only be called on special devices!

I do not see such restriction with fuse on Linux. It allows to call
ioctl() on regular files as well. It seems up to filesystem
implementation to return this error.

In macosx the kernel checks if file is a special devices. If it is not
then kernel returns ENOTTY and vfs layer is not called at all.

Anyway the ioctl() is implemented, please check
https://github.com/anatol/kext and test if you have time. You might
look at fuse/examples/fioc.c example that shows how ioctl can be used.
Currently ioctl retry logic is not implemented yet (ioctl in cuse).

Reply all
Reply to author
Forward
0 new messages