deviceNumberFromStat in internal/snapshot/scanner.go says it returns false for the in-memory filesystem. On Linux it returns device 0 and true, because afero's MemMapFs returns a syscall.Stat_t with every field but uid, gid and size zero.
Definition of done: the function returns false when the stat result carries no real device (the in-memory filesystem), as its comment says, or the comment and every caller are corrected to match what it does, whichever the code's use of the device number needs; a test covers the in-memory case; make check passes.
Model: opus-5-5
Found while answering https://git.eeqj.de/sneak/vaultik/issues/459.
`deviceNumberFromStat` in `internal/snapshot/scanner.go` says it returns false for the in-memory filesystem. On Linux it returns device 0 and true, because `afero`'s `MemMapFs` returns a `syscall.Stat_t` with every field but uid, gid and size zero.
Definition of done: the function returns false when the stat result carries no real device (the in-memory filesystem), as its comment says, or the comment and every caller are corrected to match what it does, whichever the code's use of the device number needs; a test covers the in-memory case; `make check` passes.
Model: opus-5-5
PR: #473 (branch issue-462-memfs-device-number). deviceNumberFromStat now returns false for a stat whose device and inode numbers are both zero; a test covers the in-memory filesystem.
Disclosure: the pinned afero v1.15.0 gives in-memory files no stat, so the bug only appears with aferomaster; the fix guards the next upgrade.
Model: opus-5-5
PR: https://git.eeqj.de/sneak/vaultik/pulls/473 (branch `issue-462-memfs-device-number`). `deviceNumberFromStat` now returns false for a stat whose device and inode numbers are both zero; a test covers the in-memory filesystem.
Disclosure: the pinned `afero` v1.15.0 gives in-memory files no stat, so the bug only appears with `afero` `master`; the fix guards the next upgrade.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found while answering #459.
deviceNumberFromStatininternal/snapshot/scanner.gosays it returns false for the in-memory filesystem. On Linux it returns device 0 and true, becauseafero'sMemMapFsreturns asyscall.Stat_twith every field but uid, gid and size zero.Definition of done: the function returns false when the stat result carries no real device (the in-memory filesystem), as its comment says, or the comment and every caller are corrected to match what it does, whichever the code's use of the device number needs; a test covers the in-memory case;
make checkpasses.Model: opus-5-5
PR: #473 (branch
issue-462-memfs-device-number).deviceNumberFromStatnow returns false for a stat whose device and inode numbers are both zero; a test covers the in-memory filesystem.Disclosure: the pinned
aferov1.15.0 gives in-memory files no stat, so the bug only appears withaferomaster; the fix guards the next upgrade.Model: opus-5-5