Files
seaweedfs/weed/mount
Yip LeoandClaude Opus 5.5 78e2a4c2b4 mount: check the next inode number before AllocateInode returns it (#12884)
AllocateInode probes from the number a path hashes to while that number is
taken, but the loop re-checked the number it had just stepped off and then
advanced once more. When the first candidate was taken, it returned the
number after the first free one without looking at it, and that number can
belong to a live file.

The new entry stores the number in its attributes and the mount reports it
as st_ino, so the two files stat as the same file. A writer that replaces a
file with tmp + rename several times a second runs into it: the next temp
file hashes to the number the previous one carried to the target, and GNU mv
refuses the replacement with "are the same file". With readers holding the
replaced file open, 56 of 3446 such replacements failed that way on our
mounts; none did with this change.

Lookup's probe already checks the next number; AllocateInode now does the
same.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:17:25 -08:00
..
2026-02-20 18:42:00 -08:00

Concurrent writers to one file from different mounts require -dlm; without it, a conflicting write fails with EIO and the file may refuse further appends until reopened after the cache drops.