6

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

taras
  • 6,566
  • 10
  • 39
  • 50
user465033
  • 61
  • 1
  • 3

1 Answers1

1

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).

Dmytro Sirenko
  • 5,003
  • 21
  • 26