Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Mar 2016 11:16:20 -0700
From:      Hiroshi Nishida <nishida@asusa.net>
To:        freebsd-fs@freebsd.org
Subject:   Problem with FUSE + fts
Message-ID:  <56F42EF4.5000505@asusa.net>

next in thread | raw e-mail | index | archive | help
Hi,

I found a weird error with FUSE + fts_read().
Every time a command like find, rm -r that calls fts_read() is used for a FUSE mounted filesystem, it outputs "XXX: No such file or directory" errors for some (not all) files/directories.

In /usr/src/lib/libc/gen/fts.c, there is fts_safe_changedir(FTS *, FTSENT *, int, char *) and the error seems to occur there in the following way:

FTS *sp;
FTSENT *p = sp->fts_cur; // Current node
DIR *dirp = opendir2(p->fts_accpath, oflag); // Open dir
int fd = _dirfd(dirp); // File descriptor of dirp
struct stat sb; _fstat(fd, &sb); // fstat current node through fd

p->fts_ino != sb.st_ino // This happens for some reason...... and sets errno = ENOENT

When the error happens, p->fts_ino always has a small number and sb.st_ino has a great number like:
p->fts_ino = 13, sb.st_ino = 54136

So, a new inode number seems to be allocated to sb.st_ino though the node already has an inode number.

I would appreciate hearing any feedback on this, though I already posted fuse-devel ML and haven't received any helpful responses yet.
The problem seems to be particular to FreeBSD because I don't get any errors with Ubuntu.

The sample FUSE program is located at
https://github.com/scopedog/FUSE-Test

and fts.c is also located under freebsd and ubuntu dirs (interestingly, fts.c of FreeBSD and Ubuntu are almost identical).

Thank you.

-- 
Hiroshi Nishida
nishida@asusa.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56F42EF4.5000505>