From 0367f45089a0fc03b56c6b340c49bc86de84a25e Mon Sep 17 00:00:00 2001 From: MickaelK Date: Sat, 6 Jan 2024 17:42:02 +1100 Subject: [PATCH] feature (nfs): improve nfs implementation --- server/plugin/plg_backend_nfs4/index.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/plugin/plg_backend_nfs4/index.go b/server/plugin/plg_backend_nfs4/index.go index a634ef22..4576c217 100644 --- a/server/plugin/plg_backend_nfs4/index.go +++ b/server/plugin/plg_backend_nfs4/index.go @@ -135,7 +135,10 @@ func (this Nfs4Share) Cat(path string) (io.ReadCloser, error) { return nil, err } pr, pw := io.Pipe() - go this.client.ReadFileAll(path, pw) + go func() { + _, _ = this.client.ReadFileAll(path, pw) + pw.Close() + }() return pr, nil } @@ -145,9 +148,9 @@ func (this Nfs4Share) Mkdir(path string) error { func (this Nfs4Share) Rm(path string) error { if strings.HasSuffix(path, "/") { - return ErrNotImplemented + return nfs4.RemoveRecursive(this.client, path) } - return nfs4.RemoveRecursive(this.client, path) + return this.client.DeleteFile(path) } func (this Nfs4Share) Mv(from string, to string) error {