]> sourceware.org Git - lvm2.git/commit
pvchange: fix file locking deadlock
authorDavid Teigland <teigland@redhat.com>
Wed, 2 Jun 2021 21:29:54 +0000 (16:29 -0500)
committerDavid Teigland <teigland@redhat.com>
Wed, 2 Jun 2021 21:29:54 +0000 (16:29 -0500)
commit2bce6faed017df8da3e659eff3f42f39d25c7f09
treed7f0ffc2464d2eebeb2c54449baf0e943ce02a2b
parente7f107c24666c8577f30e530b74f1ce0347e459b
pvchange: fix file locking deadlock

Calling clear_hint_file() to invalidate hints would acquire
the hints flock before the global flock which could cause deadlock.
The lock order requires the global lock to be taken first.

pvchange was always invalidating hints, which was unnecessary;
only invalidate hints when changing a PV uuid.  Because of the
lock ordering, take the global lock before clear_hint_file which
locks the hints file.
tools/pvchange.c
This page took 0.405245 seconds and 5 git commands to generate.