Skip to content

core: unset sysfs path after transition to dead state#6174

Merged
keszybz merged 1 commit intosystemd:masterfrom
msekletar:unset-stale-syspath
Jun 23, 2017
Merged

core: unset sysfs path after transition to dead state#6174
keszybz merged 1 commit intosystemd:masterfrom
msekletar:unset-stale-syspath

Conversation

@msekletar
Copy link
Contributor

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).

@msekletar msekletar added bug 🐛 Programming errors, that need preferential fixing pid1 labels Jun 22, 2017
@msekletar msekletar requested review from poettering and teg June 22, 2017 14:20
@poettering
Copy link
Member

lgtm

Does this help in the case of #6126?

@poettering poettering added the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Jun 22, 2017
@msekletar
Copy link
Contributor Author

Yes

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 systemd#6126
@msekletar msekletar force-pushed the unset-stale-syspath branch from a8382fa to 0e139ca Compare June 22, 2017 14:35
@msekletar
Copy link
Contributor Author

I have force pushed new version where I've referenced the issue #6126

@keszybz keszybz removed the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Jun 23, 2017
@keszybz keszybz merged commit 05e33aa into systemd:master Jun 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐛 Programming errors, that need preferential fixing pid1

Development

Successfully merging this pull request may close these issues.

3 participants