Walk an operand below .zfs or a symlink on its own (closes #142)
check / check (push) Canceled after 0s

An operand under another was dropped as covered by it even when a
directory between them was named .zfs or was a symlink. The walk of
the outer operand enters neither, so the files under the inner operand
went unscanned and their records were deleted. walkReaches now reports
such an operand as not reached, so pruneRoots keeps it and walks it on
its own. README lists both cases with the others.

Judgement call: the new constant zfsDirName replaces the .zfs literal
in operandWarning and subdirJob too, because goconst rejects a third
copy.

Model: opus-5-5
This commit is contained in:
2026-10-26 12:23:51 +00:00
parent aa99b37b99
commit fd76633211
4 changed files with 122 additions and 10 deletions
+11 -5
View File
@@ -455,11 +455,17 @@ scan and are enumerated concurrently: every operand seeds the shared walk worker
pool. Overlapping operands are harmless — an operand that duplicates another or
lies under another is dropped before walking, so every file is reached exactly
once and produces one database record. An operand under another one is kept,
though, and walked on its own when any directory from it (from its directory,
for a regular file) up to but not including the operand covering it is a default
exclude, is not on a persistent filesystem (see "Rules for the walk"), or, with
`-x`, is on a different filesystem than that operand, because that operand's
walk does not enter such a directory and so does not reach it.
though, when the walk of the outer operand does not reach it. It is then walked
on its own. The walk of the outer operand does not reach the inner one when it,
or any directory between the two, is:
- named `.zfs`;
- a symlink;
- a default exclude;
- not on a persistent filesystem (see "Rules for the walk");
- with `-x`, on a different filesystem than the outer operand.
For a regular-file operand, only the directories between the two count.
An operand that is a symlink (never followed, not even as an operand), socket,
FIFO, or device node, or a directory named `.zfs`, is not scanned. `scan` prints