aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs_filehandle.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/mount/weedfs_filehandle.go')
-rw-r--r--weed/mount/weedfs_filehandle.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/weed/mount/weedfs_filehandle.go b/weed/mount/weedfs_filehandle.go
index e0149aee9..bfc129240 100644
--- a/weed/mount/weedfs_filehandle.go
+++ b/weed/mount/weedfs_filehandle.go
@@ -3,19 +3,16 @@ package mount
import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
- "time"
+ "github.com/seaweedfs/seaweedfs/weed/util"
)
func (wfs *WFS) AcquireHandle(inode uint64, flags, uid, gid uint32) (fileHandle *FileHandle, status fuse.Status) {
var entry *filer_pb.Entry
- _, _, entry, status = wfs.maybeReadEntry(inode)
+ var path util.FullPath
+ path, _, entry, status = wfs.maybeReadEntry(inode)
if status == fuse.OK {
- if entry != nil && wfs.option.WriteOnceReadMany {
- if entry.Attributes.Mtime+10 < time.Now().Unix() {
- if flags&fuse.O_ANYWRITE != 0 {
- return nil, fuse.EPERM
- }
- }
+ if wfs.wormEnabledForEntry(path, entry) && flags&fuse.O_ANYWRITE != 0 {
+ return nil, fuse.EPERM
}
// need to AcquireFileHandle again to ensure correct handle counter
fileHandle = wfs.fhMap.AcquireFileHandle(wfs, inode, entry)