Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV from pathInode.GetAttr() on ESTALE #298

Open
charles-dyfis-net opened this issue May 13, 2019 · 0 comments
Open

SIGSEGV from pathInode.GetAttr() on ESTALE #298

charles-dyfis-net opened this issue May 13, 2019 · 0 comments
Labels
obsolete issues in deprecated/frozen code.

Comments

@charles-dyfis-net
Copy link

charles-dyfis-net commented May 13, 2019

ENOSYS and EBADF are both handled in the pathfs GetAttr implementation, but the Linux-kernel NFS server can return ESTALE as well.

This would explain fi not being set, and causing a nil pointer exception on line 619 below:

if file == nil || code == fuse.ENOSYS || code == fuse.EBADF {
fi, code = n.fs.GetAttr(n.GetPath(), context)
if !code.Ok() {
return code
}
// This is a bug in the filesystem implementation, but let's not
// crash.
if fi == nil {
log.Printf("Bug: fs.GetAttr returned OK with nil data")
return fuse.EINVAL
}
}
// Set inode number (unless already set or disabled).
n.setClientInode(fi.Ino)

...as seen in the following stack trace (which is from 291273c; filed here, however, as the codepath appears to still be accessible in master):

github.com/hanwen/go-fuse/fuse/pathfs.(*pathInode).GetAttr(0xc421652660, 0xc421f00598, 0x7b16e0, 0x0, 0xc421f00618, 0xc4200b2360)
        /tmp/build/src/GO/src/github.com/hanwen/go-fuse/fuse/pathfs/pathfs.go:615 +0x9b
github.com/hanwen/go-fuse/fuse/nodefs.(*FileSystemConnector).internalLookup(0xc4241fc510, 0xc421f00598, 0xc421671f10, 0xc420a50060, 0x2b, 0xc421f00600, 0x60000000008, 0x8)
        /tmp/build/src/GO/src/github.com/hanwen/go-fuse/fuse/nodefs/fsops.go:89 +0x11d
github.com/hanwen/go-fuse/fuse/nodefs.(*rawBridge).Lookup(0xc4241fc510, 0xc421f00600, 0xc420a50060, 0x2b, 0xc421f00570, 0x0)
        /tmp/build/src/GO/src/github.com/hanwen/go-fuse/fuse/nodefs/fsops.go:104 +0xb7
github.com/hanwen/go-fuse/fuse.doLookup(0xc420138000, 0xc421f00480)
        /tmp/build/src/GO/src/github.com/hanwen/go-fuse/fuse/opcode.go:287 +0x86
github.com/hanwen/go-fuse/fuse.(*Server).handleRequest(0xc420138000, 0xc421f00480, 0xc421f00480)
        /tmp/build/src/GO/src/github.com/hanwen/go-fuse/fuse/server.go:404 +0x296
github.com/hanwen/go-fuse/fuse.(*Server).loop(0xc420138000, 0xc422217d01)
        /tmp/build/src/GO/src/github.com/hanwen/go-fuse/fuse/server.go:376 +0x162
created by github.com/hanwen/go-fuse/fuse.(*Server).readRequest
        /tmp/build/src/GO/src/github.com/hanwen/go-fuse/fuse/server.go:284 +0x2be
@hanwen hanwen added the obsolete issues in deprecated/frozen code. label Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
obsolete issues in deprecated/frozen code.
Projects
None yet
Development

No branches or pull requests

2 participants