]> sourceware.org Git - lvm2.git/commit
lvs: disable scanning optimization
authorDavid Teigland <teigland@redhat.com>
Tue, 19 Nov 2019 16:27:02 +0000 (10:27 -0600)
committerDavid Teigland <teigland@redhat.com>
Tue, 19 Nov 2019 16:56:12 +0000 (10:56 -0600)
commit7474440d3b540d20eb4f997efeb31b881cc6ac8e
treeddc021004a7e0433bdf4a643a9fb9dfbb1b517e2
parentf88f7c0fdcdfbefa37df6adb36a637526bd7e93b
lvs: disable scanning optimization

The scanning optimization can produce warnings from
'lvs' when run concurrently with commands modifying LVs,
so disable the optimization until it can be improved.

Without the scanning optimization, lvs will always
read all PVs twice:

1. read metadata from all PVs, saving it in memory
2. for each VG
3. lock VG
4. reread metadata from all PVs in VG, replacing metadata
   saved from step 1
5. run command on VG
6. unlock VG

The optimization would usually cause step 4 to be skipped,
and PVs would be read only once.

Running the command in step 5 using metadata that was not
read under the VG lock is usually fine, except for the
fact that lvs attempts to validate the metadata by comparing
it to current dm state.  If other commands are modifying dm
state while lvs is running, lvs may see differences between
metadata from step 1 and dm state checked during step 5,
and print warnings.

(A better fix may be to detect the concurrent change and
fall back to rereading metadata in step 4 only when needed.)
tools/commands.h
This page took 0.034377 seconds and 5 git commands to generate.