Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the offset of readdir would change randomly while readding a really large amount of files directory #300

Open
shiqi-lu opened this issue Jul 20, 2016 · 4 comments

Comments

@shiqi-lu
Copy link

Environment: 10.11.5
osxfuse: 2.8.3

There's a serious problem in osxfuse, I use fusexmp to test it.

1.I generate 1 million empty files(zero size) in a directory on my local drive (for example: /Users/test/1m)
2.mount the fusexmp, this is the command:
sudo ./fusexmp /Volumes/loop -omodules=threadid:subdir,subdir=/Users/test -oallow_other,native_xattr,volname=LoopbackFS
3.run the command in the terminal:
\ls -f /Volumes/loop/1m
-f will only call the readdir function.

now,the problem is, ls command would run a really really long time, and it seems it never ever comes to an end. and the same way I test in linux using fuse, it only took several seconds. I think there might have some bugs in osxfuse.

I hope you can find out and fix it.

@shiqi-lu
Copy link
Author

Sorry to forget to write my analysis here,

In my own filesystem, I find a really strange thing, that the offset will jump randomly, because my filesystem will call readdir function repeatedly and use filler to fill the data and offset. The strange thing is, when the offset is about 600000 or 700000, the offset will change to really small number, like about 100 or 0 or 359(the actual number will be changed every time), then next will change to 702381......they are changing all the time, so the readdir function will never end............

I hope this bug can be fixed as soon as possible.

@bfleischer
Copy link
Member

bfleischer commented Jul 21, 2016

Could you check if you are seeing the same issues with the loopback file system?

https://github.com/osxfuse/filesystems/tree/master/filesystems-c/loopback

@shiqi-lu
Copy link
Author

I test that, It's the same, if you use the same ls command in the local, it only cost 10s. both the loopback and fusexmp has the same problem, the ls command will never end, and never shows th result.

you can test this yourself, I upload a application that can generate 1 million empty file, actually you can generate it yourself, it might cost lots of time, my application can generate it only a couple minutes. the usage is:
./dayuperf -d /Users/test/1m -w -l -s 0 -t 10 -i 100000

after the test, you can delete it use:
./dayuperf -d /Users/test/1m -c -l -s 0 -t 10 -i 100000

I hope this would be helpful

dayuperf.zip

@shiqi-lu
Copy link
Author

I test this problem in osxfuse3.5.3 and macOS 10.12.1
and it still exists.
I hope it will be fixed soon.

Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants