summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* add longer comment about independent metadata areasdev-dct-new-scan-8David Teigland2017-10-191-0/+12
| | | | | and how rescanning labels doesn't apply when reading metadata from files.
* add more comments about the roles of fic and fidDavid Teigland2017-10-193-6/+36
|
* label_scan: use a single aio contextDavid Teigland2017-10-183-34/+15
| | | | | | A new aio context was being created, io_setup(2), in each call to rescan labels. This is an expensive call, so keep the aio context around to reuse in each call.
* doc: add description of disk readingDavid Teigland2017-10-181-0/+246
|
* scanning: get async events from config settingDavid Teigland2017-10-183-19/+22
|
* lvmetad_vg_lookup: use fid ref_count to fix unwanted freeDavid Teigland2017-10-181-0/+2
|
* pvscan: use new dev scanning codeDavid Teigland2017-10-181-14/+20
|
* label_scan: use the new scanning for label_scan_invalidDavid Teigland2017-10-181-17/+34
|
* scanning: remove references to async readsDavid Teigland2017-10-182-19/+18
| | | | | Now that label_read_data structs are used for both sync and async reads.
* config: move init of aio/scan settingsDavid Teigland2017-10-182-24/+24
|
* config: move scan settings to devices sectionDavid Teigland2017-10-182-23/+23
|
* label_scan: fix label scan for independent metadata areasDavid Teigland2017-10-183-4/+42
| | | | | | | | When label_scan reads metadata from independent areas, not from the devices, set a flag on the vginfo. Use this flag to avoid trying to rescan those devices in vg_read() since the metadata won't be found on them, and wreck the lvmcache data set up by the label scan.
* add comment describing the role of fid/ficDavid Teigland2017-10-181-0/+19
|
* pvscan: quit if duplicates are found in label scanDavid Teigland2017-10-181-0/+5
| | | | | | | duplicate PVs are detected during label scan and lvmetad is disabled when they are detected. pvscan --cache can quit after label scan if duplicates were found rather than going through the remaining metadata reading steps.
* label_scan: get scan_size from config settingDavid Teigland2017-10-185-14/+22
|
* label_scan: use label_read_data for synchronous scansDavid Teigland2017-10-182-134/+291
| | | | | | We can read a large amount of data into label_read_data synchronously also, and use this data in the processing path instead of reading each bit of data from disk separately.
* update configure for aioDavid Teigland2017-10-181-0/+46
|
* label_scan: add to vgcfgrestoreDavid Teigland2017-10-181-0/+2
| | | | | | This command doesn't use process_each so it needs to do a label_scan itself before trying to parse metadata, which wants to know which PVs are on which devices.
* configure: improve libaio checkDavid Teigland2017-10-186-5/+12
|
* configure: autoreconfDavid Teigland2017-10-181-0/+23
|
* conditional compile with AIO_SUPPORTDavid Teigland2017-10-182-0/+40
|
* label_scan: remove async/sync distinction from callersDavid Teigland2017-10-184-49/+58
|
* scanning: rewrite lvmetad_pvscan_vg to use new label readingDavid Teigland2017-10-185-195/+508
| | | | | | This is used to refresh the lvmetad content for a VG after lvmlockd has invalidated the cached copy of the metadata in lvmetad.
* pvscan: use new label_scan dataDavid Teigland2017-10-187-17/+56
| | | | | | | | | 'pvscan --cache' for scanning all devices now uses label_scan_async and can reuse data like other commands. 'pvscan --cache dev' can't do a label_scan because it's only allowed to read the single dev. A label_read on that single dev is added prior to reading the VG from it.
* scanning: allocate label data struct from mem poolDavid Teigland2017-10-181-12/+21
| | | | | | Use a separate alloc/free loop for ld structs from mem pool vs the aio-related structs that are not from pool.
* dev-io: add layer around async ioDavid Teigland2017-10-184-125/+224
| | | | | Use the actual aio system calls only in dev-io.c and use an obfuscation layer above that in lvm.
* label_scan: pull out to top levelDavid Teigland2017-10-183-10/+23
| | | | | | | | | | | label_scan is a primary step that a command performs, following the standard pattern for command processing. It was being called as a side effect of a utility/helper function, which made it less obvious and made it easier to be called without realizing it. Pull it up to a prominent top level in the sequence of primary steps. label_scan is not something that should be done in various low level places as needed.
* vg_read: avoid another extraneous device readDavid Teigland2017-10-181-13/+31
| | | | | | | | | | | when using async read data. This is the short disk read that validates VG metadata before reading the full metadata. There's a nearly identical function in the label scan path, as this one in the vg_read path. The other version was already adapted to use the label read data, but this one was missed.
* vg_read: use the same async read code as label scanDavid Teigland2017-10-1813-50/+302
| | | | | | | Both for rescanning labels at the start of vg_read, and then passing and using that reread data through the vg_read() path to avoid rereading the same data from disk.
* vg_read: improve messages and add commentsDavid Teigland2017-10-182-33/+42
| | | | comments added where future error path handling should go
* vg_read: new wording for functions and messagesDavid Teigland2017-10-185-14/+30
| | | | | | Make the function names and messages parallel each other on the two parallel vg reading paths (label reading and vg_read).
* labels: move the label scan at the start of each vg_readDavid Teigland2017-10-184-28/+61
| | | | This moves a low level label scan to the start of vg_read.
* labels: avoid label_read when getting fmt in vg_readDavid Teigland2017-10-181-1/+1
| | | | | | | | | | | When vg_read() begins, it looks up the format (fmt) for the VG name in lvmcache, telling lvmcache_fmt_from_vgname() to reread labels on all devices in the VG. Avoid rereading the labels on all the devices, and trust that lvmcache has correct information. If the format of the VG is not available, the calling code already rescans labels and retries.
* labels: avoid label_read when getting device from pvidDavid Teigland2017-10-1812-112/+52
| | | | | | | | | | | | | | | | | When the low levels of vg_read() are parsing VG metadata, they see a PVID, and try to get the device for it, calling lvmcache_device_from_pvid(). When this function found the dev for this PVID in lvmcache, it would issue a full label_read() on that device and verify that the pvid/dev mapping in lvmcache is correct. Remove this label_read() and trust that the pvid to dev mapping in lvmcache is correct. If metadata changed between the initial label scan performed by the command, and the locked vg_read(), then other code exists to rescan labels. (The lvmetad case already trusted the contents of lvmcache.)
* labels: avoid metadata area read using async read dataDavid Teigland2017-10-189-46/+116
| | | | | | Copy the metadata out of the initial async read buffer instead of performing another two synchronous reads (first to check vgname, second to read all metadata.)
* labels: avoid mda_header read using async read dataDavid Teigland2017-10-187-48/+92
| | | | | | | | | Extend the initial async read buffer size to cover all the headers/metadata that need to be read from the device during label scan. Copy the mda_header from this buffer instead of performing another synchronous read for it.
* labels: add async label scanDavid Teigland2017-10-1815-88/+639
|
* lvmcache: simplify metadata cacheDavid Teigland2017-10-1814-344/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The copy of VG metadata stored in lvmcache was not being used in general. It pretended to be a generic VG metadata cache, but was not being used except for clvmd activation. There it was used to avoid reading from disk while devices were suspended, i.e. in resume. This removes the code that attempted to make this look like a generic metadata cache, and replaces with with something narrowly targetted to what it's actually used for. This is a way of passing the VG from suspend to resume in clvmd. Since in the case of clvmd one caller can't simply pass the same VG to both suspend and resume, suspend needs to stash the VG somewhere that resume can grab it from. (resume doesn't want to read it from disk since devices are suspended.) The lvmcache vginfo struct is used as a convenient place to stash the VG to pass it from suspend to resume, even though it isn't related to the lvmcache or vginfo. These suspended_vg* vginfo fields should not be used or touched anywhere else, they are only to be used for passing the VG data from suspend to resume in clvmd. The VG data being passed between suspend and resume is never modified, and will only exist in the brief period between suspend and resume in clvmd. suspend has both old (current) and new (precommitted) copies of the VG metadata. It stashes both of these in the vginfo prior to suspending devices. When vg_commit is successful, it sets a flag in vginfo as before, signaling the transition from old to new metadata. resume grabs the VG stashed by suspend. If the vg_commit happened, it grabs the new VG, and if the vg_commit didn't happen it grabs the old VG. The VG is then used to resume LVs. This isolates clvmd-specific code and usage from the normal lvm vg_read code, making the code simpler and the behavior easier to verify. Sequence of operations: - lv_suspend() has both vg_old and vg_new and stashes a copy of each onto the vginfo: lvmcache_save_suspended_vg(vg_old); lvmcache_save_suspended_vg(vg_new); - vg_commit() happens, which causes all clvmd instances to call lvmcache_commit_metadata(vg). A flag is set in the vginfo indicating the transition from the old to new VG: vginfo->suspended_vg_committed = 1; - lv_resume() needs either vg_old or vg_new to use in resuming LVs. It doesn't want to read the VG from disk since devices are suspended, so it gets the VG stashed by lv_suspend: vg = lvmcache_get_suspended_vg(vgid); If the vg_commit did not happen, suspended_vg_committed will not be set, and in this case, lvmcache_get_suspended_vg() will return the old VG instead of the new VG, and it will resume LVs based on the old metadata.
* liblvm: Move lib code used exclusively into metadata-liblvm.cAlasdair G Kergon2017-10-189-673/+727
| | | | Also remove some redundant function definitions from metadata.h.
* tidy: Add missing underscores to statics.Alasdair G Kergon2017-10-1837-362/+358
|
* libdm: fix typo in libdevmapper.pcZdenek Kabelac2017-10-182-1/+2
| | | | Fixing name for RT libraries and using RT_LIBS.
* lvmlockd: check error for sanlock access to lvmlock LVDavid Teigland2017-10-173-6/+18
| | | | | When the sanlock daemon does not have permission to access the lvmlock LV, make the error messages more helpful.
* device: Separate errors for dev not found and filtered.Alasdair G Kergon2017-10-175-4/+18
| | | | | | | | Replaced the confusing device error message "not found (or ignored by filtering)" by either "not found" or "excluded by a filter". (Later we should be able to say which filter.) Left the the liblvm code paths alone.
* tests: check external origin is monitoredZdenek Kabelac2017-10-161-0/+47
|
* thin: monitor also external originZdenek Kabelac2017-10-162-1/+9
| | | | | Add missing monitoring for external origin LVs and add -real suffix for UUID used for monitoring of external origin.
* configure: autoreconfMarian Csontos2017-10-161-26/+1
|
* replicator: remove the codeDavid Teigland2017-10-1322-1859/+7
| | | | | It has not been used in a long time and is not expected to be used further.
* Update WHATS_NEWMarian Csontos2017-10-131-2/+4
|
* lvcreate: allow 100%FREE creation of "--type mirror" to workHeinz Mauelshagen2017-10-121-0/+7
| | | | | | | | | | Fixes the following case with 3PVs and 3 legs "mirror" LV: # lvcreate -l100%FREE --type mirror -m2 vg3 Insufficient free space for log allocation for logical volume . Unable to allocate extents for mirror log. Related: rhbz1269533
* test: "Disable" lvconvert-raid-reshapeMarian Csontos2017-10-121-0/+5
| | | | | ...when running from ramdisk. This causes test failure, so it is kept on eyes.