Skip to content

path checker refactor and misc fixes

Benjamin Marzinski dm-devel 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest23 patches 10 repliesIn review
  2. v422 patches 3 repliesSuperseded
  3. v3 posting 2/23 of 20 patches 1 replySuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v3 posting 1/23 of 20 patches0 repliesSuperseded
v220 patches5 repliesSuperseded
v122 patches35 repliesSuperseded

Changes in v5 from the cover letter

19: Changed checker variable name from ct->waited_for to

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23libmultipath: store checker_check() result in checker structlibmultipath/checkers.c libmultipath/checkers.h libmultipath/discovery.c +1 more+19 -150 replies
2/23libmultipath: add missing checker function prototypeslibmultipath/checkers.h+3 -00 replies
3/23libmultipath: split out the code to wait for pending checkerslibmultipath/checkers.c libmultipath/checkers.h libmultipath/checkers/directio.c +1 more+109 -470 replies
4/23libmultipath: remove pending wait code from libcheck_check callslibmultipath/checkers.c libmultipath/checkers/directio.c libmultipath/checkers/tur.c+41 -360 replies
5/23multipath-tools tests: fix up directio teststests/directio.c+82 -510 replies
6/23libmultipath: split get_state into two functionslibmultipath/discovery.c libmultipath/discovery.h libmultipath/libmultipath.version +1 more+23 -80 replies
7/23libmultipath: change path_offline to path_sysfs_statelibmultipath/discovery.c libmultipath/discovery.h libmultipath/libmultipath.version +3 more+40 -370 replies
8/23multipathd: split check_path_state into two functionsmultipathd/main.c+19 -110 replies
9/23multipathd: rename do_check_path to update_path_statemultipathd/main.c+11 -101 reply
10/23multipathd: split check_path into two functionsmultipathd/main.c+26 -161 reply
11/23multipathd: split handle_uninitialized_path into two functionsmultipathd/main.c+14 -51 reply
12/23multipathd: split check_paths into two functionslibmultipath/structs.h multipathd/main.c+56 -581 reply
13/23multipathd: fix "fail path" and "reinstate path" commandslibmultipath/checkers.c multipathd/cli_handlers.c+3 -00 replies
14/23multipathd: update priority once after updating all pathslibmultipath/structs.h multipathd/main.c+123 -602 replies
15/23multipathd: simplify checking for followover_should_failbackmultipathd/main.c+2 -20 replies
16/23multipathd: only refresh prios on PATH_UP and PATH_GHOSTmultipathd/main.c+2 -20 replies
17/23multipathd: remove pointless checkmultipathd/main.c+13 -130 replies
18/23multipathd: fix deferred_failback_tick for reload removesmultipathd/main.c+6 -30 replies
19/23libmultipath: add libcheck_need_wait checker functionlibmultipath/checkers.c libmultipath/checkers.h libmultipath/checkers/directio.c +1 more+36 -21 reply
20/23libmultipath: don't wait in libcheck_pendinglibmultipath/checkers/directio.c libmultipath/checkers/tur.c+23 -380 replies
21/23multipathd: wait for checkers to completelibmultipath/discovery.c libmultipath/libmultipath.version multipathd/main.c+20 -20 replies
22/23multipath-tools tests: fix up directio teststests/directio.c+46 -30 replies
23/23multipathd: use timestamps to tell when the directio checker timed outlibmultipath/checkers/directio.c+31 -132 replies

Reviews trailers per patch

22 of 23 patches have a Reviewed-by or Acked-by.

PatchMartin Wilck
1/23R-b
2/23R-b
3/23R-b
4/23R-b
5/23R-b
6/23R-b
7/23R-b
8/23R-b
9/23R-b
10/23R-b
11/23R-b
12/23R-b
13/23R-b
14/23R-b
15/23R-b
16/23R-b
17/23R-b
18/23R-b
19/23R-b
20/23R-b
21/23R-b
22/23R-b
23/23

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 00/23] path checker refactor and misc fixes

This patchset is based on discussions I had with Martin Wilck about my last, partially applied patchset.

The first two patches are reposts of patches from my earlier patchset, redone to work with the new libmp_mapinfo() API. They make it possible to add maps by WWID with "multipathd add map".

The rest of the patches are work and bugfixes related to refactoring checkerloop so that

1. multipath devices get resynced with the kernel occasionally, even if they have not paths

2. If multiple paths from a multipath device are checked in the same loop, the multipath device will only get resynced once.

3. All the paths of a multipath device will converge to being checked at the same time (at least as much as their differing checkint values will allow).

4. The times for checking the paths of each multipath device will spread out as much as possible so multipathd doesn't do all of it's checking in a burst.

5. path checking is done my multipath device (for initialized paths, the uninitialized paths are handled after all the adopted paths are handled).

Items 1 & 2 are handled by patch 10 and preceding patches.

Items 3 & 4 and handled by patch 17 and preceding patches.

Item 5 is handled by patch 18 and 19.

Changes in v5 (all from Martin's suggestions):
19: Changed checker variable name from ct->waited_for to

    ct->checked_state

23: New patch to change the directio checker to use timestamps to
check for timeout.

Changes in v4 (all from Martin's suggestions):
09: Changed commit message and fixed incorrect comment
10: Moved getting checkint from config to the if clause where its used 11 & 12: Moved setting pp->checkint from 12 to 11
14: Added comment about when refresh_all is set.

Changes in v3:
0: adapt to 27053732 'fixup "libmultipath: use libmp_pathinfo() in
update_multipath_table()"'. This is identical to 1d564df4 ("multipathd: adjust when mpp is synced with the kernel") on mwilck/tip.
11: fix commit message (Martin)
17: use symbolic return code (Martin)

Changes in v2 (old patch number in quotes):
01: change from returning minor number to dm info (Martin) 02: adapt to change in patch 01
05 (05-07): squash into one commit (Martin)
08 (10): fix commit message (Matin)
10 (12): rename do_check_mpp amd check_mpp
11 (13): move the code that saved the path name to right before it was
removed (Martin)
14 (16): use symbolic return codes (Martin)
15 (17): set path state to PATH_UNCHECKED when orphaned, and skip paths
in INIT_REMOVED in sync_map_state() (Martin)
17 (19): clear pp->pending_ticks in check_path() if the path is delayed
instead of pending. Use a different equation to check if we need to modify the ticks, that can adjust the ticks on every check. adapt to change in patch 14
18 (20): adapt to change in patch 14
19 (21): adapt to change in patch 10 and 14
20 (22): Add fixes trailer

Benjamin Marzinski (23):
libmultipath: store checker_check() result in checker struct
libmultipath: add missing checker function prototypes
libmultipath: split out the code to wait for pending checkers
libmultipath: remove pending wait code from libcheck_check calls multipath-tools tests: fix up directio tests
libmultipath: split get_state into two functions
libmultipath: change path_offline to path_sysfs_state
multipathd: split check_path_state into two functions
multipathd: rename do_check_path to update_path_state
multipathd: split check_path into two functions
multipathd: split handle_uninitialized_path into two functions
multipathd: split check_paths into two functions
multipathd: fix "fail path" and "reinstate path" commands
multipathd: update priority once after updating all paths
multipathd: simplify checking for followover_should_failback
multipathd: only refresh prios on PATH_UP and PATH_GHOST
multipathd: remove pointless check
multipathd: fix deferred_failback_tick for reload removes
libmultipath: add libcheck_need_wait checker function
libmultipath: don't wait in libcheck_pending
multipathd: wait for checkers to complete
multipath-tools tests: fix up directio tests
multipathd: use timestamps to tell when the directio checker timed out

 libmultipath/checkers.c           |  47 +++-
 libmultipath/checkers.h           |  10 +-
 libmultipath/checkers/directio.c  | 177 +++++++++----
 libmultipath/checkers/tur.c       |  79 +++---
 libmultipath/discovery.c          |  97 ++++---
 libmultipath/discovery.h          |   6 +-
 libmultipath/libmultipath.version |   4 +-
 libmultipath/print.c              |   2 +-
 libmultipath/propsel.c            |   1 +
 libmultipath/structs.h            |  21 +-
 multipathd/cli_handlers.c         |   1 +
 multipathd/main.c                 | 409 ++++++++++++++++++------------
 tests/directio.c                  | 182 +++++++++----
 13 files changed, 676 insertions(+), 360 deletions(-)
Signature · 1 line
2.45.0