Report no device number for a zeroed stat (closes #462) #473

Open
clawbot wants to merge 1 commits from issue-462-memfs-device-number into next
pull from: issue-462-memfs-device-number
Collaborator

closes #462

deviceNumberFromStat now returns false when the stat's device and inode numbers are both zero, as well as when there is no stat. No real file has both zero.

Disclosure: with the pinned afero v1.15.0 the in-memory filesystem gives no stat, so the function already returned false there. The zeroed stat the issue describes comes from afero master, which is unreleased. The fix stops the first afero upgrade from making every in-memory file report device 0. The new test covers both shapes: a real MemMapFs file info, and one carrying a stat with only uid, gid and size set.

Model: opus-5-5

closes https://git.eeqj.de/sneak/vaultik/issues/462 `deviceNumberFromStat` now returns false when the stat's device and inode numbers are both zero, as well as when there is no stat. No real file has both zero. Disclosure: with the pinned `afero` v1.15.0 the in-memory filesystem gives no stat, so the function already returned false there. The zeroed stat the issue describes comes from `afero` `master`, which is unreleased. The fix stops the first `afero` upgrade from making every in-memory file report device 0. The new test covers both shapes: a real `MemMapFs` file info, and one carrying a stat with only uid, gid and size set. Model: opus-5-5
clawbot added the needs-review label 2026-11-19 08:31:13 +01:00
clawbot self-assigned this 2026-11-19 08:31:13 +01:00
clawbot added 1 commit 2026-11-19 08:31:13 +01:00
deviceNumberFromStat returned device 0 and true for a stat whose device
and inode numbers are both zero. afero's unreleased master gives such a
stat for every in-memory file; the pinned v1.15.0 gives none. It now
returns false for it, as its comment says, and a test covers both
in-memory shapes.

Model: opus-5-5
Author
Collaborator

Verdict: PASS
Head: 8d586ed4f9

deviceNumberFromStat now refuses a stat whose device and inode numbers are both zero, which matches its comment and the issue's definition of done, and the new test covers both in-memory shapes.

Model: opus-5-5

Verdict: PASS Head: 8d586ed4f95d740b2e3a2cc43896ae37c2490fd5 `deviceNumberFromStat` now refuses a stat whose device and inode numbers are both zero, which matches its comment and the issue's definition of done, and the new test covers both in-memory shapes. Model: opus-5-5
Some checks are pending
check / check (push) Waiting to run
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-462-memfs-device-number:issue-462-memfs-device-number
git checkout issue-462-memfs-device-number
Sign in to join this conversation.