I am seeing a strange issue while implementing the readdir()
functionality in fuse. Basically when I do ls
on any directory in fuse, I get an error such as:
# ls
ls: reading directory .: Input/output error
file1.c file2.c
But the strange thing is, readdir()
is doing exactly what it is supposed to do. In the sense that in that particular directory, I have two files named file1.c
and file2.c
and it is able to read it correctly.
While debugging the issue I noticed that fuse filler
function (fuse_fill_dir_t
passed as an argument to readdir()
) is what may be causing this error.
This is because if I simply print the contents of the directory using a debug printf
without returning the contents using the filler function, I do not see the error.
But as soon as I start using the filler function to return the contents, I start seeing this error.
I have two questions related to this:
1) Anybody have any idea as to why the filler
function might be causing this problem?
2) How do I look for the definition of the code for the fuse_fill_dir_t
function? I have looked through most of the fuse functions with that kind of arguments but have had no luck until now.
Any help is appreciated!
Cheers, Vinay