summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* process_each_pv: do full scan earlier to find new devicesdev-dct-dev-cache-full-scanDavid Teigland2015-12-114-9/+28
| | | | | | | | | | | | | | | | | | | | | | Before commit c1f246fedfc349c25749da501e68a7f70bd122b0, _get_all_devices() did a full device scan before get_vgnameids() was called. New devices would be added to the dev-cache before label scanning done by get_vgnameids. So, labels would be read from new devices by the first 'pvs' command. After that commit, _get_all_devices() was called after get_vgnameids() was finished with label scanning. So, new devices would be missed by the label scanning, and would not appear to be lvm devices to the first 'pvs' command. A new device would be added to .cache by the first command, so the second 'pvs' command would scan labels from it in get_vgnameids(). Now, the full device scan is factored out of get_all_devices() and called by itself at the start of the command so that new devices will be known before get_vgnameids() scans labels.
* cleanup: add missing WHATS_NEWZdenek Kabelac2015-12-111-0/+2
|
* tests: check lvrename of stacked cache poolZdenek Kabelac2015-12-111-0/+48
|
* fix static linkingRiku Voipio2015-12-112-1/+2
| | | | | | | | | | | | | | | | | Static linking fails currently, as -lm and -lpthread are missing: gcc -O2 -fPIC -O2 -L../libdm -L../lib -L../libdaemon/client -static -L../libdm/ioctl \ -o dmsetup.static dmsetup.o -ldevmapper -lrt ../libdm/ioctl/libdevmapper.a(libdm-stats.o): In function `dm_stats_create_region': libdm-stats.c:(.text+0x2d69): undefined reference to `log10' libdm-stats.c:(.text+0x2d6e): undefined reference to `lround' ../libdm/ioctl/libdevmapper.a(pool.o): In function `dm_pool_create': pool.c:(.text+0x134): undefined reference to `pthread_mutex_lock' pool.c:(.text+0x14f): undefined reference to `pthread_mutex_unlock' Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
* tests: fix loggingZdenek Kabelac2015-12-102-2/+2
| | | | Actually file redirection must be before stderr redir.
* lvrename: always allow to rename poolsZdenek Kabelac2015-12-101-3/+7
| | | | | | | | Since we mark cache-pool as 'hidden/private' while it is in-use, we may still allow user to change it's name. It should not cause any harm and user may prefer better naming for a cache-pool in use.
* cache: support stacked renameZdenek Kabelac2015-12-101-6/+6
| | | | | | Preserve skip_pool flag when running for_each_sub_lv() so lvrename continues to work when thin-pool is using cached data LV.
* lvmlockd: reconnect to lvmetad if it's restartedDavid Teigland2015-12-101-28/+52
| | | | | If lvmetad is restarted after lvmlockd has connected to it, then lvmlockd should reconnect.
* lvrename: move the lvmlockd LV lockDavid Teigland2015-12-092-12/+12
| | | | | | The function it was in is used for various internal renaming of hidden LVs where a lock from lvmlockd does not apply.
* dmeventd: Don't trust fifo with wrong attrs.Alasdair G Kergon2015-12-081-9/+25
| | | | | | | | If an existing fifo has the wrong attributes it cannot be trusted so we must unlink it and recreate it correctly. (Replaces 2c8d6f5c90d5be62b48ba2881f2a6631091dc5af: if the other end of the fifo already got opened while its mode was insecure, delaying the chmod isn't going to make any difference!)
* dmeventd: Extend checks on client socket.Alasdair G Kergon2015-12-082-2/+34
| | | | | | | | | Reinstate and extend checks removed by e1b111b02accb4145b82b8b47ce57ed93b1a7184. The code has always assumed that only root has access to the directory containing the fifos and that they are under the complete control of dmeventd code. If anything is found not to be as expected, then open() should certainly not be attempted!
* post-releaseAlasdair G Kergon2015-12-054-2/+8
|
* pre-releasev2_02_137Alasdair G Kergon2015-12-054-6/+11
|
* tests: extend testZdenek Kabelac2015-12-041-4/+16
|
* archiver: fix reporting for check_current_backupZdenek Kabelac2015-12-041-10/+14
| | | | | | | | | | | | | It's getting a bit more complex here. Basic idea behind is - check_current_backup() should not log error when a user is using a read-only filesystem, so e.g. vgscan will not report any error when it tries to take missing backup. We still have cases when error could be reported though, e.g. the backup this would be a symbolic link, but these are rather misconfiguration and unexpected case.
* debug: correct stack tracingZdenek Kabelac2015-12-041-1/+2
| | | | | | | Here the 'goto' is correct path, as !device_is_usable is traceable with <backtrace>. Keep the 'stack' for unusable device.
* libdm: add some doc for mirror statusZdenek Kabelac2015-12-041-5/+5
| | | | Comment content of struct for mirror status.
* lvconvert: Reinstate raid merge after splitmirror.Alasdair G Kergon2015-12-031-1/+1
| | | | | After commit 46c8d6bb8ae91ee67c8633496cc6c3d92bb4f3ce (lvconvert: Improve message for raid without -m)
* tests: check read-only backup archiveZdenek Kabelac2015-12-031-0/+70
|
* vgextend: reinstantiate archivingZdenek Kabelac2015-12-032-0/+7
| | | | | Since commit f5d06efbab4c7c77298b18b95c23111575a8db1a we lost archiving. Restore it now with process_each_vg.
* cleanup: drop log_suppress(2) usageZdenek Kabelac2015-12-033-18/+17
| | | | No longer need to use log_suppress(2) instance so dropped.
* archiver: inital change toward proper loggingZdenek Kabelac2015-12-031-27/+37
| | | | | | | | | | | | | | We have to modes of 'archive()' usage - 1. compulsory - fail stops command and user may try '-An' option to do a command. 2. non-compulsory - some fails in archiving are ignorable (i.e. read-only filesystem where archive dir is located). Those 2 cases needs to be properly handle - i.e. the non-compulsory logging should not be tampering error logging message production. So more work here is needed
* log: use full buffer size for printfZdenek Kabelac2015-12-032-11/+14
| | | | | | | | | | | Pass full buffer size to printf() function - no reason to make buffer 1 char smaller. Also rename locn buffer to message buffer directly since it's not used for anything else. TODO: we may use same buffer also for 'buf[]' since there is no collision - so may safe 1K on stack usage.
* cleanup: use try_id_read_formatZdenek Kabelac2015-12-032-8/+3
| | | | Better then using log_suppress in this case.
* uuid: add id_read_format_tryZdenek Kabelac2015-12-033-7/+31
| | | | | | | Provide id_read_format() functionality without log_error when ID is not valid one - it will just return 0. Does not need to use log_suppress() then.
* lvconvert: Reinstate mirror to raid conversions.Alasdair G Kergon2015-12-031-2/+7
| | | | | | Reinstate conversions from mirror to raid stopped by commit 46c8d6bb8ae91ee67c8633496cc6c3d92bb4f3ce (lvconvert: Improve message for raid without -m).
* man lvm: add section about unique VG namesDavid Teigland2015-12-021-0/+22
|
* toollib: only interpret vgname arg as uuid for vgrenamedev-dct-process-each-2David Teigland2015-12-013-8/+7
| | | | | | In general, --select should be used to specify a VG by UUID, but vgrename already allows a uuid to be substituted for the name, so continue to allow it in that case.
* toollib: allow VG UUID to be used in place of VG namedev-dct-process-each-1David Teigland2015-12-011-0/+39
| | | | | | | | If the VG arg from the command line does not match the name of any known VGs, then check if the arg looks like a UUID. If it's a valid UUID, then compare it to the UUID of known VGs. If it matches the UUID of a known VG, then process that VG.
* lvresize: use process_each_vgDavid Teigland2015-12-011-29/+34
| | | | No functional change.
* lvrename: use process_each_vgDavid Teigland2015-12-011-36/+57
| | | | No functional change.
* lvcreate: use process_each_vgDavid Teigland2015-12-011-52/+71
| | | | No functional change.
* vgextend: pass single vgname as process_each_vg argDavid Teigland2015-12-0116-34/+37
| | | | | | | | | Pass the single vgname as a new process_each_vg arg instead of setting a cmd flag to tell process_each_vg to take only the first vgname arg from argv. Other commands with different argv formats will be able to use it this way.
* lvmcache: change duplicate VG name warnings to verbosedev-dct-dupvgnamesEDavid Teigland2015-12-011-20/+33
| | | | | | | | | When two different VGs with the same name exist, they are both stored in lvmcache using the vginfo->next list. Previously, the code would print warnings (sometimes) when adding VGs to this list. Now the duplicate VG names are handled by higher level code, so this list no longer needs to print warnings about duplicate VG names being found.
* vg_read: look up vgid from nameDavid Teigland2015-12-013-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | After recent changes to process_each, vg_read() is usually given both the vgname and vgid for the intended VG. However, in some cases vg_read() is given a vgid with no vgname, or is given a vgname with no vgid. When given a vgid with no vgname, vg_read() uses lvmcache to look up the vgname using the vgid. If the vgname is not found, vg_read() fails. When given a vgname with no vgid, vg_read() should also use lvmcache to look up the vgid using the vgname. If the vgid is not found, vg_read() fails. If the lvmcache lookup finds multiple vgids for the vgname, then the lookup fails, causing vg_read() to fail because the intended VG is uncertain. Usually, both vgname and vgid for the intended VG are passed to vg_read(), which means the lvmcache translations between vgname and vgid are not done.
* toollib: remove unused functionDavid Teigland2015-12-011-29/+0
|
* process_each: resolve duplicate VG namesDavid Teigland2015-12-011-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If two different VGs with the same name exist on the system, a command that just specifies that ambiguous name will fail with a new error: $ vgs -o name,uuid ... foo qyUS65-vn32-TuKs-a8yF-wfeQ-7DkF-Fds0uf foo vfhKCP-mpc7-KLLL-Uh08-4xPG-zLNR-4cnxJX $ lvs foo Multiple VGs found with the same name: foo Use the --select option with VG UUID (vg_uuid). $ vgremove foo Multiple VGs found with the same name: foo Use the --select option with VG UUID (vg_uuid). $ lvs -S vg_uuid=qyUS65-vn32-TuKs-a8yF-wfeQ-7DkF-Fds0uf lv1 foo ... This is implemented for process_each_vg/lv, and works with or without lvmetad. It does not work for commands that do not use process_each. This change includes one exception to the behavior shown above. If one of the VGs is foreign, and the other is not, then the command assumes that the intended VG is the local one and uses it.
* process_each: always use list of vgnames on systemDavid Teigland2015-12-011-50/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes process_each_vg/lv always use the list of vgnames on the system. When specific VGs are named on the command line, the corresponding entries from vgnameids_on_system are moved to vgnameids_to_process. Previously, when specific VGs were named on the command line, the vgnameids_on_system list was not created, and vgnameids_to_process was created from the arg_vgnames list (which is only names, without vgids). Now, vgnameids_on_system is always created, and entries are moved from that list to vgnameids_to_process -- either some (when arg_vgnames specifies only some), or all (when the command is processing all VGs, or needs to look at all VGs for checking tags/selection). This change adds one new lvmetad lookup (vg_list) to a command that specifies VG names. It adds no new work for other commands, e.g. non-lvmetad commands, or commands that look at all VGs. When using lvmetad, 'lvs foo' previously sent one request to lvmetad: 'vg_lookup foo'. Now, 'lvs foo' sends two requests to lvmetad: 'vg_list' and 'vg_lookup foo <uuid>'. (The lookup can now always include the uuid in the request because the initial vg_list contains name/vgid pairs.)
* mirror: fix conditionZdenek Kabelac2015-12-011-1/+1
| | | | Recent patch tested wrong condition for error
* cleanup: use dm_get_status_mirrorZdenek Kabelac2015-12-015-280/+118
| | | | Use libdm function to parse mirror status report.
* lib: pass mem pool to check_transient_statusZdenek Kabelac2015-12-014-3/+5
| | | | | check_transient_status() may need to allocate some memory, so pass in already existing mem pool.
* tests: unit test for mirror statusZdenek Kabelac2015-12-014-2/+77
|
* libdm: introduce dm_get_status_mirrorZdenek Kabelac2015-12-014-15/+152
| | | | Add missing function to parse mirror status.
* lvconvert: Improve message for raid without -m.Alasdair G Kergon2015-11-302-2/+3
|
* lvmcache: new function to check if VG is foreignDavid Teigland2015-11-304-0/+44
| | | | | | | | When not using lvmetad, this uses the system_id field in the cached vginfo structs that are populated during a scan. When using lvmetad, this requests the VG from lvmetad, and checks the system_id field in the returned metadata.
* system_id: refactor check for allowed system_idDavid Teigland2015-11-302-17/+34
| | | | | Refactor the code that checks for an allowable system_id so that it can be used from other places.
* lvmcache: include system_id in vginfo cacheDavid Teigland2015-11-303-7/+37
| | | | | Save system_id just like creation_host and lock_type strings in vginfo cache.
* lvmetad: include both vgid and vgname in lookup requestDavid Teigland2015-11-301-7/+18
| | | | | | When the command already knows both the vgid and vgname, it should send both to lvmetad for a more exact request, and it can save lvmetad the work of a name lookup.
* post-releaseAlasdair G Kergon2015-11-284-2/+8
|
* pre-releasev2_02_136Alasdair G Kergon2015-11-284-4/+4
|