Skip to content

Conversation

@cfriedt
Copy link
Member

@cfriedt cfriedt commented Jan 1, 2025

If a file object is is re-used, it could inherit the offset field of the previously closed file object, making reading from the beginning of the file impossible until the offset was manually zero'ed.

The offset should always be zero when a file is ready to be used.

The issue really only presents itself when implementing a vtable backend.

Previously, if a file object is was re-used, it could
inherit the offset field of the previously closed file object,
making reading from the beginning of the file impossible
until the offset was manually zero'ed.

The offset should *always* be zero when a file is ready to be
used.

The issue really only presents itself when implementing a
vtable backend.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
@cfriedt cfriedt added the area: Base OS Base OS Library (lib/os) label Jan 1, 2025
@zephyrbot zephyrbot added the size: XS A PR changing only a single line of code label Jan 1, 2025
@cfriedt cfriedt assigned peter-mitsis and ycsin and unassigned nashif and andyross Jan 4, 2025
@cfriedt
Copy link
Member Author

cfriedt commented Jan 4, 2025

Changing assignees because I don't think this was properly assigned.

@henrikbrixandersen henrikbrixandersen merged commit e08cc50 into zephyrproject-rtos:main Jan 5, 2025
30 checks passed
@cfriedt cfriedt deleted the zvfs-set-offset-to-zero-when-reserved branch July 7, 2025 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Base OS Base OS Library (lib/os) size: XS A PR changing only a single line of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants