Summary
FluxSectorInterface::flushChanges() gathers only modified tracks and passes them to writeDiskCommand(), but writeDiskCommand() discards that list and recreates a list of every logical track in the layout.
This makes a direct filesystem update attempt to rewrite the entire disk, even though only the modified tracks have been loaded.
Reproduction
A direct Roland D-20 filesystem update:
fluxengine putfile -c rolandd20 -f drive:1 \ -l TESTSND.333 -p TESTSND2.333
After reading the directory, FluxEngine attempted a full-disk write and failed before writing because the untouched tracks were absent from the in-memory image:
Error: sector 0.0.0 is missing from the image
This appears generic to direct filesystem modifications, not Roland-specific.
Cause
The overload with a location argument currently reconstructs all logical locations:
auto sectorLocations =
std::ranges::views::keys(diskLayout.layoutByLogicalLocation);
auto chs = std::vector(sectorLocations.begin(), sectorLocations.end());
It then writes chs, ignoring the supplied list.
Proposed fix
Use the supplied logical-location list:
void writeDiskCommand(
const DiskLayout& diskLayout,
const Image& image,
Encoder& encoder,
FluxSinkFactory& fluxSinkFactory,
Decoder* decoder,
FluxSource* fluxSource,
const std::vector<CylinderHead>& logicalLocations)
{
if (fluxSource && decoder)
writeTracksAndVerify(
diskLayout, fluxSinkFactory, encoder,
*fluxSource, *decoder, image, logicalLocations);
else
writeTracks(
diskLayout, fluxSinkFactory, encoder,
image, logicalLocations);
}
The existing overload with no list can continue to construct and pass all logical tracks for full-disk write operations.
Summary
FluxSectorInterface::flushChanges()gathers only modified tracks and passes them towriteDiskCommand(), butwriteDiskCommand()discards that list and recreates a list of every logical track in the layout.This makes a direct filesystem update attempt to rewrite the entire disk, even though only the modified tracks have been loaded.
Reproduction
A direct Roland D-20 filesystem update:
fluxengine putfile -c rolandd20 -f drive:1 \ -l TESTSND.333 -p TESTSND2.333After reading the directory, FluxEngine attempted a full-disk write and failed before writing because the untouched tracks were absent from the in-memory image:
This appears generic to direct filesystem modifications, not Roland-specific.
Cause
The overload with a location argument currently reconstructs all logical locations:
It then writes
chs, ignoring the supplied list.Proposed fix
Use the supplied logical-location list:
The existing overload with no list can continue to construct and pass all logical tracks for full-disk
writeoperations.