[dm-devel] [PATCH 0/2] Handle remapped LUNs better

Benjamin Marzinski bmarzins at redhat.com
Tue Feb 9 05:19:25 UTC 2021


This patchset adds a new config option, recheck_wwid_time, to help deal
with devices getting remapped. It's based on Chongyun's patch, but
instead of always checking if the LUN is remapped, users can set how
many seconds the LUN must be down before it gets rechecked, or disable
this checking entirely, since it is simply there to keep users from
shooting themselves in the foot.  Setting the value to 0 makes this
always recheck when a path is restored.

Unlike Chongyun's patch, it doesn't issue a remove uevent. I'm not
actually sure what the purpose of the remove uevent was, since it
doesn't cause the path to be removed, and multipath already removed it.
Instead, it works like Martin's uev_update_path code, and re-adds the
path after it removes it.  There is one issue I noticed here.  While
udev will update the WWID in the database when it gets a new uevent,
sysfs will still record the original WWID, so if multipathd ever fails
back to using sysfs for the WWID, it will see the wrong value.

Another possible check that I didn't include is this patchset is to have
multipath look at the LUN number whenever it adds a new path to a
multipath device. If the LUN number doesn't match the existing LUN
numbers, all the old paths should have their wwids checked as soon as
possible (immediately, if the path is up), since mismatching LUN numbers
is a red flag that something has gone wrong.

Benjamin Marzinski (2):
  libmultipath: fix use-after-free in uev_add_path
  multipathd: add recheck_wwid_time option to verify the path wwid

 libmultipath/config.c             |   1 +
 libmultipath/config.h             |   1 +
 libmultipath/configure.c          |   4 +-
 libmultipath/configure.h          |   2 +
 libmultipath/defaults.h           |   1 +
 libmultipath/dict.c               |  36 ++++++++++
 libmultipath/libmultipath.version |   6 ++
 libmultipath/structs.h            |  10 +++
 multipath/multipath.conf.5        |  18 +++++
 multipathd/cli_handlers.c         |   9 +++
 multipathd/main.c                 | 107 +++++++++++++++++++++++++++---
 multipathd/main.h                 |   2 +
 12 files changed, 187 insertions(+), 10 deletions(-)

-- 
2.17.2




More information about the dm-devel mailing list