Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

Commit

Permalink
libfuse: on macOS, delete a moved node from the nodes cache
Browse files Browse the repository at this point in the history
Otherwise, the kernel might still treat it as having the old parent
ID.

Issue: #1881
Issue: KBFS-3576
Issue: macfuse/macfuse#553
  • Loading branch information
strib committed Nov 6, 2018
1 parent 4dcbacd commit 66c5beb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libfuse/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"math"
"os"
"runtime"
"strings"
"sync"
"syscall"
Expand Down Expand Up @@ -731,6 +732,16 @@ func (d *Dir) Rename(ctx context.Context, req *fuse.RenameRequest,

switch e := err.(type) {
case nil:
if runtime.GOOS == "darwin" {
movedNode, _, err := d.folder.fs.config.KBFSOps().Lookup(
ctx, realNewDir.node, req.NewName)
if err == nil {
d.folder.nodesMu.Lock()
delete(d.folder.nodes, movedNode.GetID())
d.folder.nodesMu.Unlock()
}
}

return nil
case libkbfs.RenameAcrossDirsError:
var execPathErr error
Expand Down

0 comments on commit 66c5beb

Please sign in to comment.