On Tuesday, May 22, 2012 11:50:09 AM UTC+8, Anatol Pomozov wrote:
Hi
On Fri, May 18, 2012 at 1:49 AM, sinlam
<slt...@gmail.com> wrote:
When your filesystem hangs? during fchdir(save_dir) in init()? If so it means for some reason is resolved to fuse4x directory and causes recursion/deadlock.
When I called change dir to old path before calling fuse_main(), it does not hang immediately. Inside xmp_statfs function, I change from fullpath to relative path.
Then I notice xmp_statfs is called more 2500 times
This is a known issue. Or better to say this is one of the "Carbon/Finder wisdoms".
Originally macfuse/fuse4x used "cache statfs data in userspace" option. This option is set in fuse4x kext. But this lead to a bug when Finder shows out-of-date volume size information. I've changed it to "do not cache statfs" but in this case Finder generates much more requests. If this is an issue for you you should cache this data in your filesystem.
May I know how can I cache statfs data in my file system? Any example code is appreciated.
and OS crashed after a while.
What is the crash stacktrace?
Does it mean that the deadlock issue (you mentioned in the initial message) has gone?
I revisited the problem by using existing sample source 'fusexmp_fh' without modification. After compilation, I use the following command to execute the sample:
>sudo ./fusexmp_fh /Users/user/Documents -d -omodules=subdir,subdir="/Users/user/Documents" -o default_permissions -oallow_other
Note that /Users/user/Documents exist but it is empty. The debug output of fusexmp_fh contains the last few lines:
unique: 2554, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 2555, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 2556, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 2557, opcode: STATFS (17), nodeid: 1, insize: 40
fuse: error creating thread: Resource temporarily unavailable
statfs /
statfs /
statfs /
statfs /
unique: 2558, opcode: STATFS (17), nodeid: 1, insize: 40
statfs /
After a few minutes, OS crashed and I am able to get the backtrace with the following output:
(gdb) bt
#0 0xffffff7f807fb19c in ?? ()
#1 0xffffff800032b4c8 in dn_times_locked (dnp=0x60, t1=0xffff0073746e656d,
t2=0x0, t3=0xffffff8006c98800, just_changed_flags=111366528)
at devfs_vnops.c:143
#2 0xffffff800031b4dd in do_journal_io (jnl=0xffffff8040253e00,
offset=0xffffff8040253e40, data=0xffffff8040253e40,
len=18446743524065104256, direction=1076182592) at vfs_journal.c:385
#3 0xffffff8000312aa6 in get_xattrinfo (xvp=0xffffff8040253eb0,
setting=1076182704, ainfop=0xffffff8040253eb0, context=0xffffff8040253eb0)
at vfs_xattr.c:2641
#4 0xffffff8000563b8a in soo_select (fp=0xffffff8040253e00, which=186654344,
wql=0xffffff8006a35180, ctx=0xffffff8006a35180) at sys_socket.c:398
#5 0xffffff8000563d02 in soioctl (so=0x0, cmd=18446743524140392072,
data=0xffffff8006a35180 "?Q?\006????\001", p=0x1) at sys_socket.c:249
#6 0xffffff80005cd61b in DKeyHas4Words ()
If the /Users/user/Documents contains some files, the system just hangs there (deadlock).
Please let me know if anything I can do. Thanks!