Commit b51c2c59 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fs: don't log error failing MvChild

Document MvChild failure condition.

Change-Id: I928335eb79c73bdedb14c9f7544c3b15e3862af8
parent 97aecbbf
......@@ -510,9 +510,8 @@ func (b *rawBridge) Rename(cancel <-chan struct{}, input *fuse.RenameIn, oldName
if input.Flags&RENAME_EXCHANGE != 0 {
p1.ExchangeChild(oldName, p2, newName)
} else {
if ok := p1.MvChild(oldName, p2, newName, true); !ok {
log.Println("MvChild failed")
}
// MvChild cannot fail with overwrite=true.
_ = p1.MvChild(oldName, p2, newName, true)
}
}
return errnoToStatus(errno)
......
......@@ -574,7 +574,8 @@ retry:
}
// MvChild executes a rename. If overwrite is set, a child at the
// destination will be overwritten, should it exist.
// destination will be overwritten, should it exist. It returns false
// if 'overwrite' is false, and the destination exists.
func (n *Inode) MvChild(old string, newParent *Inode, newName string, overwrite bool) bool {
if len(newName) == 0 {
log.Panicf("empty newName for MvChild")
......
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