From owner-freebsd-fs@freebsd.org Thu Mar 24 18:23:08 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C1DCADCC19 for ; Thu, 24 Mar 2016 18:23:08 +0000 (UTC) (envelope-from nishida@asusa.net) Received: from asusam.asj-hosting.net (asusa.asj-hosting.net [219.118.222.245]) (using TLSv1.2 with cipher CAMELLIA256-SHA (256/256 bits)) (Client CN "*.asj-hosting.net", Issuer "Go Daddy Secure Certificate Authority - G2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 026D91EB5 for ; Thu, 24 Mar 2016 18:23:06 +0000 (UTC) (envelope-from nishida@asusa.net) Received: (qmail 13295 invoked by uid 89); 25 Mar 2016 03:16:22 +0900 X-ASJ-Track-ID: <20160324181622.13295.qmail@asusam.asj-hosting.net> X-Spam-Checker-Version: ASJ KMsrv Spam Check Process Internal X-Spam-Status: No, hits=0.0 X-Spam-Flag: No X-Virus-Scanned: ASJ KMsrv Virus Check Process 08041001 X-ASJ-SMTP-Authentication: nishida@asusa.net X-ASJ-Arrival-IP: 50.207.112.201 X-ASJ-SPF-Info: auth X-ASJ-Scan-ID: <1458843382.467161.13288@asusam.asj-hosting.net> X-ASJ-Received-SPF: pass (send with smtp authentication by nishida@asusa.net@50.207.112.201) Received: from gw.asusa.net (HELO rd03.asusa-internal.net) (nishida@asusa.net@50.207.112.201) by asusams.asj-hosting.net with ESMTPS (AES128-SHA encrypted); 25 Mar 2016 03:16:22 +0900 To: freebsd-fs@freebsd.org From: Hiroshi Nishida Subject: Problem with FUSE + fts Message-ID: <56F42EF4.5000505@asusa.net> Date: Thu, 24 Mar 2016 11:16:20 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 18:23:08 -0000 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