Commit 703cbead authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Fix failure case handling in PathFilesystem.{Unlink,Rmdir}.

parent 8effbf7f
......@@ -586,11 +586,10 @@ func (me *PathFileSystemConnector) Mkdir(header *InHeader, input *MkdirIn, name
if mount == nil {
return nil, ENOENT
}
err := mount.fs.Mkdir(filepath.Join(fullPath, name), input.Mode)
if err != OK {
return nil, err
}
code = mount.fs.Mkdir(filepath.Join(fullPath, name), input.Mode)
if code == OK {
out, code = me.Lookup(header, name)
}
return out, code
}
......@@ -600,10 +599,10 @@ func (me *PathFileSystemConnector) Unlink(header *InHeader, name string) (code S
return ENOENT
}
code = mount.fs.Unlink(filepath.Join(fullPath, name))
if code == OK {
// Like fuse.c, we update our internal tables.
me.unlinkUpdate(header.NodeId, name)
}
return code
}
......@@ -613,7 +612,9 @@ func (me *PathFileSystemConnector) Rmdir(header *InHeader, name string) (code St
return ENOENT
}
code = mount.fs.Rmdir(filepath.Join(fullPath, name))
if code == OK {
me.unlinkUpdate(header.NodeId, name)
}
return code
}
......
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