Skip to content

flan: Overwriting an object doesn't persist the number of bytes written #60

@avborup

Description

@avborup

Context

This issue applies to flan development, specifically on the jag/flan-overwrite branch.

This issue was originally described with this message from the Discord server. The issue specific to the number of bytes was discovered with this message. Additionally the original overwrite issue was shown to exist with this GitHub Gist.

Demo

Running the flan_test_overwrite test from jag/flan-overwrite twice with a fresh mkfs.flexalloced loopback device produces the following behaviour:

$ sudo FLAN_TEST_DEV=/dev/loop1 ./build/flan/flan_test_overwrite 4096
Before object write, read data (16 bytes):
After object write, read data (28 bytes): My favourite food is salad!
Closing, re-opening
Before object write, read data (28 bytes): My favourite food is salad!
After object write, read data (28 bytes): My favourite food is pizza!
Closing, re-opening
Before object write, read data (28 bytes): My favourite food is pizza!
After object write, read data (32 bytes): My favourite food is chocolate!

$ sudo FLAN_TEST_DEV=/dev/loop1 ./build/flan/flan_test_overwrite 4096
Before object write, read data (28 bytes): My favourite food is chocola
After object write, read data (28 bytes): My favourite food is salad!
Closing, re-opening
Before object write, read data (28 bytes): My favourite food is salad!
After object write, read data (28 bytes): My favourite food is pizza!
Closing, re-opening
Before object write, read data (28 bytes): My favourite food is pizza!
After object write, read data (32 bytes): My favourite food is chocolate!

On the second run, the initial print shows that the object has 28 bytes of data. However, it should have 32 as shown by the end of the first run. The actual data in the object seems to have been persisted, so it's only the number of bytes that seem to be the problem now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions