Commit 2752a889 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Make UnionFs robust against Open() of non-existent file.

parent 82a6f8c3
......@@ -753,6 +753,12 @@ func (me *UnionFs) Open(name string, flags uint32) (fuseFile fuse.File, status f
return fuse.NewDevNullFile(), fuse.OK
}
r := me.getBranch(name)
if r.branch < 0 {
// This should not happen, as a GetAttr() should have
// already verified existence.
log.Println("UnionFs: open of non-existent file:", name)
return nil, fuse.ENOENT
}
if flags&fuse.O_ANYWRITE != 0 && r.branch > 0 {
code := me.Promote(name, r)
if code != fuse.OK {
......
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