From c7313f36dee285a8adab801632c8d692bd5f5e7e Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 4 Oct 2015 17:14:40 +0200 Subject: [PATCH] fallocate: return ENOSYS The implementation was incomplete, disable fallocate completely for now. See https://github.com/rfjakob/gocryptfs/issues/1 Fixes xfstests generic/075 --- pathfs_frontend/file.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pathfs_frontend/file.go b/pathfs_frontend/file.go index 697d58d..02ebc42 100644 --- a/pathfs_frontend/file.go +++ b/pathfs_frontend/file.go @@ -331,14 +331,10 @@ func (f *file) GetAttr(a *fuse.Attr) fuse.Status { return fuse.OK } +// Allocate FUSE call, fallocate(2) func (f *file) Allocate(off uint64, sz uint64, mode uint32) fuse.Status { - f.lock.Lock() - err := syscall.Fallocate(int(f.fd.Fd()), mode, int64(off), int64(sz)) - f.lock.Unlock() - if err != nil { - return fuse.ToStatus(err) - } - return fuse.OK + cryptfs.Warn.Printf("Fallocate is not supported, returning ENOSYS - see https://github.com/rfjakob/gocryptfs/issues/1\n") + return fuse.ENOSYS } const _UTIME_NOW = ((1 << 30) - 1)