From e859e64179345c67bbf967bf81b23d894035b427 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 31 Mar 2015 16:01:22 +1100 Subject: [PATCH] fsImpl.Check: Bail out early on Linux. To my great disappointment, I can't figure out a way to make this test reliable on Linux. Hopefully the cited mailing list thread will come through. --- samples/forgetfs/forget_fs.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/samples/forgetfs/forget_fs.go b/samples/forgetfs/forget_fs.go index c359a49..1a00e76 100644 --- a/samples/forgetfs/forget_fs.go +++ b/samples/forgetfs/forget_fs.go @@ -17,6 +17,7 @@ package forgetfs import ( "fmt" "os" + "runtime" "github.com/jacobsa/fuse" "github.com/jacobsa/fuse/fuseops" @@ -183,6 +184,16 @@ func (fs *fsImpl) Check() { fs.mu.Lock() defer fs.mu.Unlock() + // On Linux we often don't receive forget ops, and never receive destroy ops + // (cf. http://goo.gl/EUbxEg, fuse-devel thread "Root inode lookup count"). + // So there's not really much we can check here. + // + // TODO(jacobsa): Figure out why we don't receive destroy. If we can reliably + // receive it, we can treat it as "forget all". + if runtime.GOOS == "linux" { + return + } + for k, v := range fs.inodes { // Special case: we don't require the root inode to have reached zero. // OS X doesn't seem to send forgets for the root, and Linux only does