Commit 7c3ad92
committed
check: check reference count for modprobe --remove --wait success case
The commit "check,common/*: replace module removal with patient module
removal" introduced the new helper function _patient_rmmod() which calls
modprobe command with --wait option to do patient module removal.
However, the modprobe command can return a zero exit status even when
the module removal fails. In such cases, the failure remains unreported
and hidden. This behavior was observed during the execution of blktests
srp test group using rdma_rxe driver on a kernel affected by the
rdma_rxe module unload failure bug, which was addressed by the recent
patch [1].
To address this problem, check the reference count of the target module
after calling the modprobe command in _patient_rmmod(). If the module's
reference count indicates a removal failure, print an error message to
stderr. While at it, change the print target stream from stdout to
stderr for other error messages in _patient_rmmod() to ensure the
messages are printed on failure.
[1] https://lore.kernel.org/linux-rdma/[email protected]/
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Daniel Wagner <[email protected]>
Signed-off-by: Shin'ichiro Kawasaki <[email protected]>1 parent 0819d1f commit 7c3ad92
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
533 | | - | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
534 | 537 | | |
535 | 538 | | |
536 | 539 | | |
| |||
544 | 547 | | |
545 | 548 | | |
546 | 549 | | |
547 | | - | |
| 550 | + | |
548 | 551 | | |
549 | 552 | | |
550 | 553 | | |
| |||
575 | 578 | | |
576 | 579 | | |
577 | 580 | | |
578 | | - | |
| 581 | + | |
579 | 582 | | |
580 | 583 | | |
581 | 584 | | |
| |||
0 commit comments