Commit f0afdaf7 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 131662a9
...@@ -506,7 +506,7 @@ type Head struct { ...@@ -506,7 +506,7 @@ type Head struct {
inflightOSCacheUploads int32 inflightOSCacheUploads int32
// head/watch opens // head/watch opens
// XXX protected by ... zheadMu ? wlinkMu sync.Mutex
wlinkTab map[*WatchLink]struct{} wlinkTab map[*WatchLink]struct{}
// waiters for zhead.At to become ≥ their at. // waiters for zhead.At to become ≥ their at.
...@@ -1563,9 +1563,10 @@ func (wnode *WatchNode) Open(flags uint32, fctx *fuse.Context) (nodefs.File, fus ...@@ -1563,9 +1563,10 @@ func (wnode *WatchNode) Open(flags uint32, fctx *fuse.Context) (nodefs.File, fus
rxTab: make(map[uint64]chan string), rxTab: make(map[uint64]chan string),
} }
// XXX locking head.wlinkMu.Lock()
// XXX del wlinkTab[w] on w.sk.File.Release // XXX del wlinkTab[w] on w.sk.File.Release
head.wlinkTab[wlink] = struct{}{} head.wlinkTab[wlink] = struct{}{}
head.wlinkMu.Unlock()
go wlink.serve() go wlink.serve()
return wlink.sk.File(), fuse.OK return wlink.sk.File(), fuse.OK
...@@ -1579,9 +1580,13 @@ func (wlink *WatchLink) serve() { ...@@ -1579,9 +1580,13 @@ func (wlink *WatchLink) serve() {
if err != nil { if err != nil {
log.Error(err) log.Error(err)
} }
// XXX locking
delete(wlink.head.wlinkTab, wlink)
// XXX deactiwate all watches from wlink.byfile[*] // XXX deactiwate all watches from wlink.byfile[*]
head := wlink.head
head.wlinkMu.Lock()
delete(head.wlinkTab, wlink)
head.wlinkMu.Unlock()
} }
func (wlink *WatchLink) _serve() (err error) { func (wlink *WatchLink) _serve() (err error) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment