From 42705dbe9e03be26d9bd1e36bde99ef632261247 Mon Sep 17 00:00:00 2001 From: Will Scott Date: Tue, 23 Jan 2024 14:38:24 +0100 Subject: [PATCH] invalidate the specific item being removed fix #123 --- nfs_onremove.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nfs_onremove.go b/nfs_onremove.go index 222cc82..53a7ca7 100644 --- a/nfs_onremove.go +++ b/nfs_onremove.go @@ -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 { @@ -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} }