Runtime service SetVariable does not call Reclaim() on linux


Tinh Nguyen
 

Hi,

On OS (like Linux), the runtime service Setvariable() will return EFI_OUT_OF_RESOURCE when the variable store is almost full.
Why does it not call Reclaim to free up space?

I found this code block:
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c

if (AtRuntime ()) {
if (IsCommonUserVariable && ((VarSize + mVariableModuleGlobal->CommonUserVariableTotalSize) > mVariableModuleGlobal->CommonMaxUserVariableSpace)) {
RecordVarErrorFlag (VAR_ERROR_FLAG_USER_ERROR, VariableName, VendorGuid, Attributes, VarSize);
}
if (IsCommonVariable && ((VarSize + mVariableModuleGlobal->CommonVariableTotalSize) > mVariableModuleGlobal->CommonRuntimeVariableSpace)) {
RecordVarErrorFlag (VAR_ERROR_FLAG_SYSTEM_ERROR, VariableName, VendorGuid, Attributes, VarSize);
}
Status = EFI_OUT_OF_RESOURCES;
goto Done;
}
//
// Perform garbage collection & reclaim operation, and integrate the new variable at the same time.
//

Status = Reclaim (
mVariableModuleGlobal->VariableGlobal.NonVolatileVariableBase,
&mVariableModuleGlobal->NonVolatileLastVariableOffset,
FALSE,
Variable,
NextVariable,
HEADER_ALIGN (VarSize)
);

Please help me out.

Many thanks,