[Tux3] Question on Tux3 Fuse

Daniel Phillips phillips at phunq.net
Thu Sep 25 12:14:57 PDT 2008


On Thursday 25 September 2008 07:31, Pranith Kumar wrote:
> On Thu, Sep 25, 2008 at 5:43 PM, Tero Roponen <tero.roponen at gmail.com>wrote:
> 
> >                if ((errno = -ext2_readdir(dirfile, &(struct fillstate){ .dirent = dirent }, tux3_filler)))
> >                        return -errno;
> >
> Shouldn't this check be done in ext2_readdir itself?? I though that was the
> main purpose of calling
> ext2_readdir... to get any possible errors out of the way...

I do not know what the correct fix is yet, however ext2_readdir is
taken directly from the kernel implementation, probably without
mistakes as far as I can see.  Meaning that it will work in kernel.
We would like to keep it unchanged so that when we port to kernel
we can reasonably expect things to work.  Maybe Fuse has a different
idea of how the readdir api should work.

The readdir internal api is a horrible abomination.  In kernel, any
error from the filler function at all is interpreted as end of list.
I think EINVAL is used for this purpose in the generic kernel filler.
Yuck!  Also, libc seems to interpret "lack of progress", that is, no
change to the directory pos, as end of list.  Double yuck.

I have not looked more deeply yet, but maybe these comments can help
get oriented to the issue.

As a general rule: do not assume that the ancient designers actually
knew what they were doing when they built the framework.  Maintain a
healthy skepticism at every step.

Regards,

Daniel

_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://tux3.org/cgi-bin/mailman/listinfo/tux3



More information about the Tux3 mailing list