rdma: map RC transport errors to protocol codes

Classify the rejected-argument, short-transfer, and oversized-
value failures of the session server as bad requests at the
route boundary, answering the closest S3-style protocol error
instead of a generic internal failure.
This commit is contained in:
Jihyeon Gim
2026-09-04 19:44:45 +09:00
parent 1a8d4c9c97
commit 50f4482173
+7 -2
View File
@@ -40,10 +40,15 @@ func (errRouteUnavailable) Error() string {
}
// isRouteBadRequest reports whether err is a malformed-request
// class error from the Linux route handlers.
// class error: an invalid header value from the route handlers or
// a rejected argument, short transfer, or oversized value from
// the session server.
func isRouteBadRequest(err error) bool {
var bad errRouteBadRequest
return errors.As(err, &bad)
return errors.As(err, &bad) ||
errors.Is(err, rcserver.ErrShort) ||
errors.Is(err, rcserver.ErrTrunc) ||
errors.Is(err, rcserver.ErrArg)
}
// isRouteNotFound reports whether err identifies an unknown or