# lib/std/posix/test.zig: don't compare blksize in "fstatat" · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/cf47d283d101e5d8e0d1ca7ec427d40efc40f358)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: cf47d283d101e5d8e0d1ca7ec427d40efc40f358

Requested commit: cf47d283d101e5d8e0d1ca7ec427d40efc40f358

Commit: cf47d283d101e5d8e0d1ca7ec427d40efc40f358

Tree: 96494f4cd5859c4ba30d375552912c4445f9a2ab

Author: Pat Tullmann

Committer: Pat Tullmann

## Message

```
lib/std/posix/test.zig: don't compare blksize in "fstatat"

In trying to reproduce the race in #24380, my system tripped over the stat
"blocks" field changing in this test.  The value was almost always 8
(effectively 4k) or very infrequently 0 (I saw the 0 from both `fstat` and
`fstatat`).  I believe the underlying filesystem is free to asynchronously
change this value. For example, if it migrates a file between some
"inline" or maybe journal storage, and actual on-disk blocks.  So it seems
plausible that its allowed to change between stat calls.

Breaking up the struct comparison this way means we also don't compare any
of the padding or "reserved" fields, too.  And we can narrow down the
s390x-linux work-around.

```

## Parents

- [caf80e90b85a2a7855c369887dce163cf036ff7e](https://git.cafe/gitcafe/zig/commit/caf80e90b85a2a7855c369887dce163cf036ff7e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/cf47d283d101e5d8e0d1ca7ec427d40efc40f358?format=markdown)
