[dm-devel] [PATCH v5 19/22] multipath -u: don't grab devices already passed to system
Hannes Reinecke
hare at suse.de
Mon Apr 16 06:30:45 UTC 2018
On Sat, 14 Apr 2018 00:00:12 +0200
Martin Wilck <mwilck at suse.com> wrote:
> Setting SYSTEMD_READY=0 on a device that has previously been passed to
> systemd is dangerous - already mounted file systems might be
> unmounted by systemd.
>
> Avoid that by checking for previously set DM_MULTIPATH_DEVICE_PATH
> environment variable.
>
> This requires to change the exit status of multipath -u - it needs to
> exit with status 0 even if the path is not a multipath device path,
> otherwise udev doesn't import the printed key-value pairs. We do this
> only for "multipath -u"; legacy "multipath -c", which is more likely
> to be run in user scripts, still exits with 1 for non-multipath
> devices.
>
> The condition ENV{DM_MULTIPATH_DEVICE_PATH}!="1" before the
> "multipath -u" statement in multipath.rules needs to be removed. This
> condition was pointless anyway, because until this patch,
> DM_MULTIPATH_DEVICE_PATH hadn't been imported from the db and thus
> was never set, and "multipath -u" was always invoked. We want to keep
> this behavior.
>
> Signed-off-by: Martin Wilck <mwilck at suse.com>
> ---
> multipath/main.c | 46
> +++++++++++++++++++++++++++++++++++++++++++++-
> multipath/multipath.rules | 5 ++++- 2 files changed, 49
> insertions(+), 2 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare at suse.com>
Cheers,
Hannes
More information about the dm-devel
mailing list