filer: hand uploaded chunks back on WORM rejection in saveMetaData

The locked recheck discarded uncommittedChunks, so a rejected write
left its uploaded chunks behind; return them so callers delete them.
This commit is contained in:
user.email committed 2026-10-24 09:52:12 -07:00
1 parent e144503caf
commit 84e227dbc3
1 file changed
+2 -2
@@ -322,9 +322,9 @@ func (fs *FilerServer) saveMetaData(ctx context.Context, r *http.Request, fileNa
// recheck under the lock: WORM may have been enabled during the upload
if enforced, wormErr := fs.wormEnforcedForEntry(ctx, path); wormErr != nil {
return nil, wormErr, nil
return nil, wormErr, uncommittedChunks
} else if enforced {
return nil, errors.New(constants.ErrMsgOperationNotPermitted), nil
return nil, errors.New(constants.ErrMsgOperationNotPermitted), uncommittedChunks
}
inlineAppendHandled := false