Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does FUSE readdir returns Input/output error?

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

like image 639
user465033 Avatar asked Jul 14 '11 11:07

user465033


1 Answers

Such messages may be caused by failed calls to other (possibly unimplemented) FUSE callbacks like getxattr(). Then readdir() is called and results are obtained right.

You can debug a FUSE filesystem running its executable with key -d (debug mode), - that does not daemonize process and prints detailed debug output about FUSE calls.

Also, it would be nice to know what is your platform (Linux/OS X/etc).

like image 148
Dmytro Sirenko Avatar answered Jan 02 '23 13:01

Dmytro Sirenko