Skip to content

Commit

Permalink
invalidate the specific item being removed
Browse files Browse the repository at this point in the history
fix #123
  • Loading branch information
willscott committed Jan 23, 2024
1 parent 6d7d6af commit 42705db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nfs_onremove.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func onRemove(ctx context.Context, w *response, userHandle Handler) error {
preCacheData := ToFileAttribute(dirInfo, fullPath).AsCache()

toDelete := fs.Join(append(path, string(obj.Filename))...)
toDeleteHandle := userHandle.ToHandle(fs, append(path, string(obj.Filename)))

err = fs.Remove(toDelete)
if err != nil {
Expand All @@ -57,7 +58,7 @@ func onRemove(ctx context.Context, w *response, userHandle Handler) error {
return &NFSStatusError{NFSStatusIO, err}
}

if err := userHandle.InvalidateHandle(fs, obj.Handle); err != nil {
if err := userHandle.InvalidateHandle(fs, toDeleteHandle); err != nil {
return &NFSStatusError{NFSStatusServerFault, err}
}

Expand Down

0 comments on commit 42705db

Please # to comment.