Problem with FUSE + fts

Hiroshi Nishida nishida at asusa.net
Tue Apr 5 22:21:23 UTC 2016


Since there is no response even at fuse-devel ML, I would like to write down a solution here.

* Symptom
When using a command that calls fts_read() like "find" or "rm -r" for a FUSE based filesystem, it outputs "No such file or directory" for some files/directories that exist.

* Solution
In /usr/ports/sysutils/fusefs-libs/work/libfuse-fuse_X_X_X/lib/fuse.c, the following struct is declared:

static struct fuse_lowlevel_ops fuse_path_ops = {
         .init = fuse_lib_init,
         .destroy = fuse_lib_destroy,
         .lookup = fuse_lib_lookup,
         .forget = fuse_lib_forget,
         .forget_multi = fuse_lib_forget_multi,
         .getattr = fuse_lib_getattr,

Here, comment out .forget and .forget_multi lines like:

static struct fuse_lowlevel_ops fuse_path_ops = {
         .init = fuse_lib_init,
         .destroy = fuse_lib_destroy,
         .lookup = fuse_lib_lookup,
         //.forget = fuse_lib_forget,
         //.forget_multi = fuse_lib_forget_multi,
         .getattr = fuse_lib_getattr,

Alternatively, you can use "noforget" mount option, though I'm not sure if it can be used for high level APIs like fuse_main().

-- 
Hiroshi Nishida
nishida at asusa.net


More information about the freebsd-fs mailing list