From 3084be5961c4dbce80c964935c0963cd0e202675 Mon Sep 17 00:00:00 2001 From: Janusz Marcinkiewicz Date: Thu, 9 Jan 2025 10:24:16 +0100 Subject: [PATCH] core: do not override error in case of remote metadata mismatch Signed-off-by: Janusz Marcinkiewicz --- core/ldp.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/ldp.go b/core/ldp.go index e1a8ee2d731..a5f115dd3e1 100644 --- a/core/ldp.go +++ b/core/ldp.go @@ -137,11 +137,10 @@ func (lom *LOM) CheckRemoteMD(locked, sync bool, origReq *http.Request) (res CRM // it as if the object doesn't really exist. err = cmn.NewErrRemoteMetadataMismatch(e) ecode = http.StatusNotFound - } - - if ecode == http.StatusNotFound { + } else if ecode == http.StatusNotFound { err = cos.NewErrNotFound(T, lom.Cname()) } + if !locked { // return info (neq and, possibly, not-found), and be done return CRMD{ErrCode: ecode, Err: err}