Commit bcd4aed8 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b4137415
...@@ -1046,22 +1046,6 @@ func (f *BigFile) invalidateBlk(ctx context.Context, blk int64) (err error) { ...@@ -1046,22 +1046,6 @@ func (f *BigFile) invalidateBlk(ctx context.Context, blk int64) (err error) {
if int64(len(blkdata)) == blksize { if int64(len(blkdata)) == blksize {
func() { func() {
// store retrieved data back to OS cache for file @<rev>/file[blk] // store retrieved data back to OS cache for file @<rev>/file[blk]
//
// XXX there is deadlock here:
//
// T1: Lookup "head"
// -> nodefs.rawBridge.lookupLock.Lock
// -> zheadMu.RLock
// `-> block (waiting for handleδZ to WUnlock zheadMu)
//
// T2 (this thread): Lookup "@<revX>"
// -> nodefs.rawBridge.lookupLock.Lock
// `-> block (waiting for T1)
//
// see https://github.com/hanwen/go-fuse/commit/d0fca860
// for when rawBridge.lookupLock was introduced.
//
// -> should be fixed: https://review.gerrithub.io/c/hanwen/go-fuse/+/487809
blkrev, _ := f.LastBlkRev(ctx, blk, f.head.zconn.At()) blkrev, _ := f.LastBlkRev(ctx, blk, f.head.zconn.At())
frev, funlock, err := groot.lockRevFile(blkrev, f.zfile.POid()) frev, funlock, err := groot.lockRevFile(blkrev, f.zfile.POid())
if err != nil { if err != nil {
......
...@@ -64,11 +64,11 @@ import ( ...@@ -64,11 +64,11 @@ import (
// //
// XXX concurrent use // XXX concurrent use
// //
// XXX see also zodb.ΔTail // See also zodb.ΔTail
type ΔFtail struct { type ΔFtail struct {
// ΔFtail merges btree.ΔTail with history of ZBlk // ΔFtail merges btree.ΔTail with history of ZBlk
δBtail *ΔBtail δBtail *ΔBtail
fileIdx map[*btree.LOBTree]SetBigFile // root -> {} BigFile XXX root -> oid? fileIdx map[*btree.LOBTree]SetBigFile // root -> {} BigFile XXX root -> oid? XXX as of @head?
// data with δF changes. Actual for part of tracked set that was taken // data with δF changes. Actual for part of tracked set that was taken
// into account. // into account.
...@@ -191,6 +191,8 @@ func (δFtail *ΔFtail) Track(file *BigFile, blk int64, path []btree.LONode, zbl ...@@ -191,6 +191,8 @@ func (δFtail *ΔFtail) Track(file *BigFile, blk int64, path []btree.LONode, zbl
// Objects in Zhead must not be modified. // Objects in Zhead must not be modified.
// During call to Update zhead must not be otherwise used - even for reading. // During call to Update zhead must not be otherwise used - even for reading.
func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit, zhead *ZConn) ΔF { func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit, zhead *ZConn) ΔF {
// XXX δFtail.update() first?
δB := δFtail.δBtail.Update(δZ) δB := δFtail.δBtail.Update(δZ)
δF := ΔF{Rev: δB.Rev, ByFile: make(map[*BigFile]*ΔFile)} δF := ΔF{Rev: δB.Rev, ByFile: make(map[*BigFile]*ΔFile)}
......
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