Repository navigation
Commit 350425a
committed
hlink: fix hard-link failure abort (#741) and the latent drain hang it exposes
When a hard-link group member fails its direct link() (EMLINK or
EXDEV) it is written as a regular file and finishes first, claiming
the group's prior_hlinks node; a later member's finish then hits the
"Hlink node data ... already has path" check and aborts the whole
transfer (code 13). Tolerate the duplicate finish: keep the first
leader's path, log an FINFO warning, and continue.
Removing the abort exposes a second, latent bug: finish_hard_link()
decrements flist->in_progress for every file in the completion chain,
but members that failed their direct link() in hard_link_check() were
never counted, so the counter drifts negative and the final drain
hangs forever. Add FLAG_HLINK_WAIT, set at the three increment
sites, and gate the two affected decrements on it.
Tested with a 65000-link pinned-inode EMLINK fixture (full repro and
evidence in the PR description), an -H --link-dest regression matrix,
and the upstream hardlink/link-dest test suite.
hlink: fix hard-link failure abort (#741) and the latent drain hang it exposes
When a hard-link group member fails its direct link() (EMLINK or
EXDEV) it is written as a regular file and finishes first, claiming
the group's prior_hlinks node; a later member's finish then hits the
"Hlink node data ... already has path" check and aborts the whole
transfer (code 13). Tolerate the duplicate finish: keep the first
leader's path, log an FINFO warning, and continue.
Removing the abort exposes a second, latent bug: finish_hard_link()
decrements flist->in_progress for every file in the completion chain,
but members that failed their direct link() in hard_link_check() were
never counted, so the counter drifts negative and the final drain
hangs forever. Add FLAG_HLINK_WAIT, set at the three increment
sites, and gate the two affected decrements on it.
Tested with a 65000-link pinned-inode EMLINK fixture (full repro and
evidence in the PR description), an -H --link-dest regression matrix,
and the upstream hardlink/link-dest test suite.1 parent 8718cd2 commit 350425a
3 files changed
Lines changed: 21 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2253 | 2253 | | |
2254 | 2254 | | |
2255 | 2255 | | |
| 2256 | + | |
2256 | 2257 | | |
2257 | 2258 | | |
2258 | 2259 | | |
| |||
2358 | 2359 | | |
2359 | 2360 | | |
2360 | 2361 | | |
| 2362 | + | |
2361 | 2363 | | |
2362 | 2364 | | |
2363 | 2365 | | |
| |||
2595 | 2597 | | |
2596 | 2598 | | |
2597 | 2599 | | |
2598 | | - | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
2599 | 2604 | | |
2600 | 2605 | | |
2601 | 2606 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| 338 | + | |
338 | 339 | | |
339 | 340 | | |
340 | 341 | | |
| |||
535 | 536 | | |
536 | 537 | | |
537 | 538 | | |
538 | | - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
539 | 543 | | |
540 | 544 | | |
541 | 545 | | |
| |||
555 | 559 | | |
556 | 560 | | |
557 | 561 | | |
558 | | - | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
559 | 570 | | |
560 | | - | |
| 571 | + | |
561 | 572 | | |
562 | 573 | | |
563 | 574 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
0 commit comments