The changes represent "v5" of the purge disconnected paths feature. Here are
the key modifications:

1. Renamed purge_path to disconnected with Enum States
Changed from a simple boolean purge_path to an enum path_disconnected_state
with three states:
NOT_DISCONNECTED (0) - path is normal
DISCONNECTED_NO_PURGE - path was disconnected but purge was cancelled or
alreadyattempted
DISCONNECTED_NEEDS_PURGE - path is disconnected and needs to be purged

2. Enhanced WWID Recheck Logic
Modified the WWID recheck condition to trigger if either:
 recheck_wwid is explicitly enabled (existing behavior), OR
Path was previously disconnected (new safety feature)
This provides protection even when users don't enable  recheck_wwid, since
disconnected paths are much more likely to have changed WWIDs

3. Added Disconnected State Recovery
When a path recovers to UP/GHOST state, the disconnected state is cleared
This happens after the WWID recheck, ensuring the WWID is validated before
clearing the flag

4. Improved Purge Loop Logic
Changed from clearing purge_path flag to downgrading from
DISCONNECTED_NEEDS_PURGE to DISCONNECTED_NO_PURGE
This prevents infinite retry loops if purging fails
Better error handling: if prepare_purge_path_info() fails, continue looking
for other paths instead of stopping

5. Fixed prepare_purge_path_info() Error Handling
Now properly cleans up and returns false if dup() fails
Previously would proceed anyway; now treats it as a failure

6. Removed Redundant Code
Removed the clearing of purge_path from reinstate_path() since it's now handled
earlier in update_path_state()
 
7. Comment Improvements
Wrapped all comments to 80 characters
Added clearer explanations of the logic flow
Better documentation of the purge loop behavior

Brian Bunker (1):
  mulitpath-tools Add purge capability to multipath-tools

 libmultipath/checkers.c       |   2 +
 libmultipath/checkers.h       |   2 +
 libmultipath/checkers/tur.c   |  10 ++
 libmultipath/config.c         |   2 +
 libmultipath/config.h         |   3 +
 libmultipath/configure.c      |   1 +
 libmultipath/defaults.h       |   1 +
 libmultipath/dict.c           |  14 ++
 libmultipath/discovery.c      |   3 +-
 libmultipath/io_err_stat.c    |   1 +
 libmultipath/print.c          |   2 +
 libmultipath/propsel.c        |  16 ++
 libmultipath/propsel.h        |   1 +
 libmultipath/structs.h        |  14 ++
 libmultipath/sysfs.c          |   2 +-
 multipath/multipath.conf.5.in |  22 +++
 multipathd/main.c             | 287 +++++++++++++++++++++++++++++++++-
 17 files changed, 374 insertions(+), 9 deletions(-)

-- 
2.52.0


Reply via email to