Skip to content

Merging PR#10 - #15

Open
BowMonk wants to merge 3 commits into
mainfrom
dev
Open

BowMonk wants to merge 3 commits into
mainfrom
dev

Conversation

@BowMonk

@BowMonk BowMonk commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Closes issue #7

sdiebolt and others added 3 commits September 30, 2026 13:59
queryAlignment() threw when statx came back without STATX_DIOALIGN, so
storage could not open a file on a pre-6.1 kernel or a filesystem that
does not implement the query (BTRFS, among others). It now falls back to
stx_blksize, or the page size when the kernel did not report that either,
and warns. The page size is a multiple of every sector size such a
filesystem uses, so a buffer aligned to it satisfies any of them.

Moving the statx struct and the resolution into linux_statx.h lets
linux_alignment_check drive the mask directly, since a modern kernel
cannot produce the one this fix is about. Writing that check turned up a
division by zero: a filesystem that reports the query but zeroes
dio_offset_align (tmpfs) had stx_blksize % stx_dio_offset_align evaluated
with a zero divisor whenever stx_blksize was larger. The zero case is now
passed through for the caller to reject, as before.
fix(storage): fall back when the kernel does not report STATX_DIOALIGN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants