create: set f.entry after creating files

After Tcreate on a file, the fid is open and should be usable for
read/write without a separate Topen. Set f.entry via root.Open()
after creation so subsequent reads/writes on the same fid work.
This commit is contained in:
Ollie Agent 2026-08-02 16:23:08 +02:00
parent b23785a4d9
commit bb152f401d
1 changed files with 3 additions and 0 deletions

View File

@ -457,6 +457,9 @@ func create(root *fs.Tree, cs *connState, fc *plan9.Fcall) *plan9.Fcall {
f.path = newPath
f.qid = qid
f.mode = fc.Mode
if ent, err := root.Open(rel); err == nil {
f.entry = ent
}
return &plan9.Fcall{Type: plan9.Rcreate, Tag: fc.Tag, Qid: qid}
}