From f4f60df6b2d399594f3b82f96fc921e918c46092 Mon Sep 17 00:00:00 2001 From: royalcat Date: Sat, 6 Apr 2024 16:51:17 +0300 Subject: [PATCH] nfs timeout error --- pkg/go-nfs/nfs_ongetattr.go | 2 +- pkg/go-nfs/nfs_onread.go | 2 +- pkg/go-nfs/nfs_onreaddir.go | 2 +- pkg/go-nfs/nfs_onreadlink.go | 2 +- pkg/go-nfs/nfs_onremove.go | 4 ++-- pkg/go-nfs/nfs_onrename.go | 6 +++--- pkg/go-nfs/nfs_onsetattr.go | 2 +- pkg/go-nfs/nfs_onwrite.go | 2 +- pkg/go-nfs/nfsinterface.go | 2 ++ 9 files changed, 13 insertions(+), 11 deletions(-) diff --git a/pkg/go-nfs/nfs_ongetattr.go b/pkg/go-nfs/nfs_ongetattr.go index 40c4148..b936c06 100644 --- a/pkg/go-nfs/nfs_ongetattr.go +++ b/pkg/go-nfs/nfs_ongetattr.go @@ -27,7 +27,7 @@ func onGetAttr(ctx context.Context, w *response, userHandle Handler) error { return &NFSStatusError{NFSStatusNoEnt, err} } if errors.Is(err, context.DeadlineExceeded) { - return &NFSStatusError{NFSStatusJukebox, err} + return &NFSStatusError{timeoutStatus, err} } return &NFSStatusError{NFSStatusIO, err} } diff --git a/pkg/go-nfs/nfs_onread.go b/pkg/go-nfs/nfs_onread.go index 8616acd..ee8e199 100644 --- a/pkg/go-nfs/nfs_onread.go +++ b/pkg/go-nfs/nfs_onread.go @@ -48,7 +48,7 @@ func onRead(ctx context.Context, w *response, userHandle Handler) error { return &NFSStatusError{NFSStatusNoEnt, err} } if errors.Is(err, context.DeadlineExceeded) { - return &NFSStatusError{NFSStatusJukebox, err} + return &NFSStatusError{timeoutStatus, err} } return &NFSStatusError{NFSStatusAccess, err} } diff --git a/pkg/go-nfs/nfs_onreaddir.go b/pkg/go-nfs/nfs_onreaddir.go index 2769d02..7f90a63 100644 --- a/pkg/go-nfs/nfs_onreaddir.go +++ b/pkg/go-nfs/nfs_onreaddir.go @@ -160,7 +160,7 @@ func getDirListingWithVerifier(ctx context.Context, userHandle Handler, fsHandle return nil, 0, &NFSStatusError{NFSStatusAccess, err} } if errors.Is(err, context.DeadlineExceeded) { - return nil, 0, &NFSStatusError{NFSStatusJukebox, err} + return nil, 0, &NFSStatusError{timeoutStatus, err} } return nil, 0, &NFSStatusError{NFSStatusIO, err} } diff --git a/pkg/go-nfs/nfs_onreadlink.go b/pkg/go-nfs/nfs_onreadlink.go index 887047a..691124e 100644 --- a/pkg/go-nfs/nfs_onreadlink.go +++ b/pkg/go-nfs/nfs_onreadlink.go @@ -31,7 +31,7 @@ func onReadLink(ctx context.Context, w *response, userHandle Handler) error { return &NFSStatusError{NFSStatusNoEnt, err} } if errors.Is(err, context.DeadlineExceeded) { - return &NFSStatusError{NFSStatusJukebox, err} + return &NFSStatusError{timeoutStatus, err} } return &NFSStatusError{NFSStatusAccess, err} diff --git a/pkg/go-nfs/nfs_onremove.go b/pkg/go-nfs/nfs_onremove.go index bffb446..b6a892b 100644 --- a/pkg/go-nfs/nfs_onremove.go +++ b/pkg/go-nfs/nfs_onremove.go @@ -39,7 +39,7 @@ func onRemove(ctx context.Context, w *response, userHandle Handler) error { return &NFSStatusError{NFSStatusAccess, err} } if errors.Is(err, context.DeadlineExceeded) { - return &NFSStatusError{NFSStatusJukebox, err} + return &NFSStatusError{timeoutStatus, err} } return &NFSStatusError{NFSStatusIO, err} } @@ -60,7 +60,7 @@ func onRemove(ctx context.Context, w *response, userHandle Handler) error { return &NFSStatusError{NFSStatusAccess, err} } if errors.Is(err, context.DeadlineExceeded) { - return &NFSStatusError{NFSStatusJukebox, err} + return &NFSStatusError{timeoutStatus, err} } return &NFSStatusError{NFSStatusIO, err} } diff --git a/pkg/go-nfs/nfs_onrename.go b/pkg/go-nfs/nfs_onrename.go index dc0d463..9ebcfb4 100644 --- a/pkg/go-nfs/nfs_onrename.go +++ b/pkg/go-nfs/nfs_onrename.go @@ -53,7 +53,7 @@ func onRename(ctx context.Context, w *response, userHandle Handler) error { return &NFSStatusError{NFSStatusNoEnt, err} } if errors.Is(err, context.DeadlineExceeded) { - return &NFSStatusError{NFSStatusJukebox, err} + return &NFSStatusError{timeoutStatus, err} } return &NFSStatusError{NFSStatusIO, err} } @@ -69,7 +69,7 @@ func onRename(ctx context.Context, w *response, userHandle Handler) error { return &NFSStatusError{NFSStatusNoEnt, err} } if errors.Is(err, context.DeadlineExceeded) { - return &NFSStatusError{NFSStatusJukebox, err} + return &NFSStatusError{timeoutStatus, err} } return &NFSStatusError{NFSStatusIO, err} } @@ -92,7 +92,7 @@ func onRename(ctx context.Context, w *response, userHandle Handler) error { return &NFSStatusError{NFSStatusAccess, err} } if errors.Is(err, context.DeadlineExceeded) { - return &NFSStatusError{NFSStatusJukebox, err} + return &NFSStatusError{timeoutStatus, err} } return &NFSStatusError{NFSStatusIO, err} } diff --git a/pkg/go-nfs/nfs_onsetattr.go b/pkg/go-nfs/nfs_onsetattr.go index cc2c202..366773b 100644 --- a/pkg/go-nfs/nfs_onsetattr.go +++ b/pkg/go-nfs/nfs_onsetattr.go @@ -33,7 +33,7 @@ func onSetAttr(ctx context.Context, w *response, userHandle Handler) error { return &NFSStatusError{NFSStatusNoEnt, err} } if errors.Is(err, context.DeadlineExceeded) { - return &NFSStatusError{NFSStatusJukebox, err} + return &NFSStatusError{timeoutStatus, err} } return &NFSStatusError{NFSStatusAccess, err} } diff --git a/pkg/go-nfs/nfs_onwrite.go b/pkg/go-nfs/nfs_onwrite.go index cfe2eb4..a7e5dd0 100644 --- a/pkg/go-nfs/nfs_onwrite.go +++ b/pkg/go-nfs/nfs_onwrite.go @@ -58,7 +58,7 @@ func onWrite(ctx context.Context, w *response, userHandle Handler) error { return &NFSStatusError{NFSStatusNoEnt, err} } if errors.Is(err, context.DeadlineExceeded) { - return &NFSStatusError{NFSStatusJukebox, err} + return &NFSStatusError{timeoutStatus, err} } return &NFSStatusError{NFSStatusAccess, err} } diff --git a/pkg/go-nfs/nfsinterface.go b/pkg/go-nfs/nfsinterface.go index cf439af..be7ae14 100644 --- a/pkg/go-nfs/nfsinterface.go +++ b/pkg/go-nfs/nfsinterface.go @@ -80,6 +80,8 @@ func (n NFSProcedure) String() string { } } +const timeoutStatus = NFSStatusIO + // NFSStatus (nfsstat3) is a result code for nfs rpc calls type NFSStatus uint32