]> sourceware.org Git - lvm2.git/commit
Use new dev_open_readonly fn to prevent opening devices for read-write when not neces...
authorPeter Rajnoha <prajnoha@redhat.com>
Sat, 28 May 2011 09:48:14 +0000 (09:48 +0000)
committerPeter Rajnoha <prajnoha@redhat.com>
Sat, 28 May 2011 09:48:14 +0000 (09:48 +0000)
commit5771fee535de1aeef080389dc54f8e827f603687
treecdc50c811a3756e905c96529c91a650a5ffced11
parent2c8102f7a1cef8244aa3b011f63fa665d0867063
Use new dev_open_readonly fn to prevent opening devices for read-write when not necessary.

Before, we used vg_write_lock_held call to determnine the way a device is
opened. Unfortunately, this opened many devices in RW mode when it was not
really necessary. With the OPTIONS+="watch" rule used in the udev rules,
this could fire numerous events while closing such devices (and it caused
useless scans from within udev rules in return).

A common bug we hit with this was with the lvremove command which was unable
to remove the LV since it was being opened from within the udev rules. This
patch should minimize such situations (at least with respect to LVM handling
of devices).

Though there's still a possibility someone will open a device 'outside' in
parallel and fire the event based on the watch rule when closing a device
once opened for RW.
lib/device/dev-io.c
lib/device/dev-luks.c
lib/device/dev-md.c
lib/device/dev-swap.c
lib/format1/disk-rep.c
lib/format_pool/disk_rep.c
lib/format_text/format-text.c
lib/format_text/text_label.c
lib/label/label.c
tools/lvmdiskscan.c
This page took 0.037368 seconds and 5 git commands to generate.