]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: unset sysfs path after transition to dead state (#6174)
authorMichal Sekletar <msekletar@users.noreply.github.com>
Fri, 23 Jun 2017 00:29:15 +0000 (02:29 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 23 Jun 2017 00:29:15 +0000 (20:29 -0400)
commit05e33aa1d5c074df863d9de4bf236dd676347a4c
tree1baf8075f1399dd61c6cc612e8b4f25225941cf1
parentb007626897e73603dd57d31f83b53eaafd89f13e
core: unset sysfs path after transition to dead state (#6174)

Device is gone and most likely it will get garbage collected. However in
cases when it doesn't get gc'ed (because it is referenced by some
other unit, e.g. mount from fstab) we need to unset sysfs. This is
because when device appears next time, possibly, with different sysfs
path we need to update the sysfs path. Current code could end up caching
stale sysfs path forever.

In reality this is not a problem for normal disks (unless you swap them
during system runtime). However this issue causes failures to mount
filesystems on LVM where sysfs path depends on activation
order (i.e. logical volumes from volume group that is activated first
get assigned lower dm-X numbers and corresponding syspaths).

Fixes #6126.
src/core/device.c