Commit 5f21e010 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8c378ced
...@@ -1031,16 +1031,20 @@ func (root *Root) mkrevfile(rev zodb.Tid, fid zodb.Oid) (_ *BigFile, release fun ...@@ -1031,16 +1031,20 @@ func (root *Root) mkrevfile(rev zodb.Tid, fid zodb.Oid) (_ *BigFile, release fun
frevpath := fmt.Sprintf("@%s/bigfile/%s", rev, fid) // relative to fs root for now frevpath := fmt.Sprintf("@%s/bigfile/%s", rev, fid) // relative to fs root for now
defer xerr.Contextf(&err, "/: mkrevfile %s", frevpath) defer xerr.Contextf(&err, "/: mkrevfile %s", frevpath)
// FIXME checking for "node{0}" is fragile:
// XXX the node could be still forgotten since we are not holding open on it
// XXX -> always os.open unconditionally for now
// or is it ok since it is just a cache?
// XXX (also disabled for now due to race-detector)
/*
// first check without going through kernel, whether the inode maybe known already // first check without going through kernel, whether the inode maybe known already
xfrev := fsconn.LookupNode(root.Inode(), frevpath) xfrev := fsconn.LookupNode(root.Inode(), frevpath)
if xfrev != nil { if xfrev != nil {
// FIXME checking for "node{0}" is fragile, but currently no other way
// XXX the node could be still forgotten since we are not holding open on it
// XXX -> always os.open unconditionally? or it is ok since it is just a cache?
if xfrev.String() != "node{0}" { if xfrev.String() != "node{0}" {
return xfrev.Node().(*BigFile), func(){}, nil return xfrev.Node().(*BigFile), func(){}, nil
} }
} }
*/
// we have to ping the kernel // we have to ping the kernel
frevospath := gmntpt + "/" + frevpath // now starting from OS / frevospath := gmntpt + "/" + frevpath // now starting from OS /
...@@ -1049,7 +1053,7 @@ func (root *Root) mkrevfile(rev zodb.Tid, fid zodb.Oid) (_ *BigFile, release fun ...@@ -1049,7 +1053,7 @@ func (root *Root) mkrevfile(rev zodb.Tid, fid zodb.Oid) (_ *BigFile, release fun
return nil, nil, err return nil, nil, err
} }
xfrev = fsconn.LookupNode(root.Inode(), frevpath) xfrev := fsconn.LookupNode(root.Inode(), frevpath)
// must be !nil as open succeeded // must be !nil as open succeeded
return xfrev.Node().(*BigFile), func() { f.Close() }, nil return xfrev.Node().(*BigFile), func() { f.Close() }, nil
} }
......
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