]> sourceware.org Git - lvm2.git/commit
dev-io: open device read-only to obtain readahead value
authorPeter Rajnoha <prajnoha@redhat.com>
Mon, 25 Jun 2012 09:34:21 +0000 (11:34 +0200)
committerPeter Rajnoha <prajnoha@redhat.com>
Mon, 25 Jun 2012 09:55:37 +0000 (11:55 +0200)
commitc8591b2ac7c99ea43e7f94f3dfb183019c2fed6e
tree150cac280f9e29535c1c35d07d94bcda5eeb9142
parent6fc4c99b2fc745b0167520f9395e9e2e39c162e8
dev-io: open device read-only to obtain readahead value

There's no need to have the device open RW while obtaining the readahead value.
The RW open used before caused the CHANGE udev event to be generated if the
WATCH udev rule was set for the underlying device (and that is normally the
case both for non-dm and dm devices by default).

This did not cause any problems before since we were not interested in
*underlying* devices. However, with upcoming changes (autoactivation), we're
watching for events on underlying devices marked as PVs and such a spurious
event could cause the autoactivation code to be triggered. So when trying
to deactivate the volume, we could end up with immediate activation just after
that because of the CHANGE event originated in the WATCH udev rule since the
underlying device was open RW during the deactivation process.

Though maybe a better solution would be to completely filter such spurious
events out of the autoactivation process somehow, it's still useful if there
are as least spurious events generated as possible in the system itself.
WHATS_NEW
lib/device/dev-io.c
This page took 0.032028 seconds and 5 git commands to generate.