Skip to content

Possible crash consistency bug in the fast write path #16

Description

@paulwedeck

Hello,
there is another place where cmpxchg is used to "atomically" set 16 bytes (see #9).
This is in the fast write path when appending a file.
In this case, the file length and file timestamps are updated together.
Crash states are possible where the file data has been updated but not the timestamps.
This is obviously just a minor bug but should still be addressed.

Currently, this cannot be realized atomically.
For the strict mode, I propose to just disable this half of the fast write path.
For the relaxed mode, I propose to swap the order, so that the timestamp might be updated without the new file length/data but not vice-versa.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions