aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs_xattr.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/mount/weedfs_xattr.go')
-rw-r--r--weed/mount/weedfs_xattr.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/weed/mount/weedfs_xattr.go b/weed/mount/weedfs_xattr.go
index 7a5109ee8..b03fa01f1 100644
--- a/weed/mount/weedfs_xattr.go
+++ b/weed/mount/weedfs_xattr.go
@@ -103,13 +103,17 @@ func (wfs *WFS) SetXAttr(cancel <-chan struct{}, input *fuse.SetXAttrIn, attr st
}
}
- path, _, entry, status := wfs.maybeReadEntry(input.NodeId)
+ path, fh, entry, status := wfs.maybeReadEntry(input.NodeId)
if status != fuse.OK {
return status
}
if entry == nil {
return fuse.ENOENT
}
+ if fh != nil {
+ fh.entryLock.Lock()
+ defer fh.entryLock.Unlock()
+ }
if entry.Extended == nil {
entry.Extended = make(map[string][]byte)
@@ -177,13 +181,17 @@ func (wfs *WFS) RemoveXAttr(cancel <-chan struct{}, header *fuse.InHeader, attr
if len(attr) == 0 {
return fuse.EINVAL
}
- path, _, entry, status := wfs.maybeReadEntry(header.NodeId)
+ path, fh, entry, status := wfs.maybeReadEntry(header.NodeId)
if status != fuse.OK {
return status
}
if entry == nil {
return fuse.OK
}
+ if fh != nil {
+ fh.entryLock.Lock()
+ defer fh.entryLock.Unlock()
+ }
if entry.Extended == nil {
return fuse.ENOATTR