summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* reporter: global lock needed before process_each_pvdev-dct-process-v24David Teigland2014-09-261-13/+13
| | | | | | | The block of code that acquires the global lock for process_each_pv() was in the wrong location given the way report_type is munged, and does not equal PVS until later in the function.
* toollib: print ignoring voriginZdenek Kabelac2014-09-261-1/+7
| | | | | | | | | | | | When ignoring 'listed' volume, print info message. (So the final command error message is a bit less confusing, i.e. when user tries to deactive virtual origin: > lvchange -an vg/lvol2_vorigin Ignoring virtual origin logical volume vg/lvol2_vorigin. One or more specified logical volume(s) not found. (Reapplied after revert.)
* toollib: process_each_pv workaround for no mda pvsDavid Teigland2014-09-221-13/+26
| | | | | | Add a workaround for a bug somewhere that can cause a pv with no mda to appear in both its real vg and in the orphan vg when not using lvmetad.
* test: add process-each toollib testsDavid Teigland2014-09-224-0/+1933
|
* logging: use flags to enable warningsDavid Teigland2014-09-225-53/+59
| | | | | | | | | | | | | | | The "warnings" arg was used to enable logging of warnings when reading a pv. This arg is turned into a set of flags with the WARN_PV_READ flag matching the existing behavior. A new flag WARN_INCONSISTENT is added that will cause vg_read_internal() to log the "vg is not consistent" warning, and the various callers do not need to log this warning themselves. A new vg_read flag READ_WARN_INCONSISTENT is used from reporting to enable the WARN_INCONSISTENT flag in vg_read_internal.
* vgreduce: use normal process_each_pvDavid Teigland2014-09-223-83/+76
| | | | In the non-repair case.
* toollib: rewrite process_each_pvDavid Teigland2014-09-2211-374/+460
| | | | | | Process pvs by iterating through vgs, then iterating through devs if the command wants to process non-pv devices. The process_single function can always use the vg and pv args.
* toollib: add ENABLE_ALL_DEVS flagDavid Teigland2014-09-222-3/+4
| | | | | | | The ENABLE_ALL_DEVS flag is added to the command structure for commands that should process all devs (pvs and non-pvs) when they call process_each_pv and the command includes the --all arg. This will be used in a later process_each_pv patch.
* toollib: remove unused arg from process_each_lv_in_vgDavid Teigland2014-09-223-4/+2
| | | | | The failed_lvnames arg is no longer used since the cmd_vg replicator wrapper was removed.
* toollib: improve error message in process_each_lv_in_vgDavid Teigland2014-09-221-6/+11
| | | | Include in the error message the lv name args that were not found.
* toollib: rewrite process_each_lvDavid Teigland2014-09-221-297/+334
| | | | | | - Copy the same form as the new process_each_vg. - Replace unused struct cmd_vg and cmd_vg_read() replicator code with struct vg and vg_read() directly.
* toollib: rewrite process_each_vgDavid Teigland2014-09-221-145/+233
| | | | | | | | - Split the collecting of arguments from processing them. - The split allows the two different loops through vgs to be replaced by a single loop. - Replace unused struct cmd_vg and cmd_vg_read() replicator code with struct vg and vg_read() directly.
* toollib: add ALL_VGS_IS_DEFAULT flagDavid Teigland2014-09-222-14/+21
| | | | | | | The ALL_VGS_IS_DEFAULT flag is added to the command structure for commands that should process all vgs when they call process_each_vg or process_each_lv with no args. This will be used in later patches to process_each functions.
* Revert "toollib: print ignoring vorigin"David Teigland2014-09-221-6/+1
| | | | | | This reverts commit 7f4b1e7411d7ff59abe2063db7273fd600e2bf72. will reapply this on top of toollib patch set
* fix: regression for recent persistent commitZdenek Kabelac2014-09-192-12/+17
| | | | | | | | | Do not let fly metadata with just 'minor' set (since they would not be readable on older version) Be permissive with invalid major/minor number and just report them as problem, but allow to use such metadata with default major:minor.
* cleanup: use int32 for major minorZdenek Kabelac2014-09-191-2/+2
| | | | Use consistently int32_t for major, minor.
* cache: fix regression and invert testZdenek Kabelac2014-09-191-1/+1
| | | | | | | Last commit c710f02e0181cc2db5455f0c98033247a70ecc30 converting code to use lv_update_and_reload() intoduced invalid test for error result. Fix it and properly check for if (!...)
* debug: enhance mmap catch codeZdenek Kabelac2014-09-191-17/+12
| | | | | | | Use nice instruction_HLT macro Use log_debug_mem() Don't actually log things after we prohibit 'mmap'. Move initialization of strerror & udev before blocking mmap.
* man: document obsoleted optionsZdenek Kabelac2014-09-192-2/+16
| | | | | It's shown on comand line help and it's accepted argument, so provide matching man entry.
* backup: drops locked memoryZdenek Kabelac2014-09-191-0/+4
| | | | | Since we want to backup metadata, this is the point we no longer want to hold memory locked.
* cleanup: lvchange remove some extra code.Zdenek Kabelac2014-09-191-18/+2
| | | | | | | | | We do not need to restore LV content on error path - since for reactivation we always use ondisk/commited metadata, so passed data are never used. Drop some unneded extra message, since the called function repeated logs same info.
* lvchange: backup final metadataZdenek Kabelac2014-09-192-1/+9
| | | | | | Shift backup after final metadata commit. Synchronize with wiping.
* tools: common handling of --persistent optionZdenek Kabelac2014-09-195-126/+103
| | | | | | | | | | | | | | | Move common code for reading and processing of --persistent arguments for lvcreate and lvchange into lvmcmdline. Reuse validate_major_minor() routine for validation. Don't blindly activate LVs after change in cluster and instead only local reactivation is supported. (we have now many limited targets now). Dropping 'sigint_caught()' handling, since prompt() is resolving this case itself.
* metadata: validate major, minor numbersZdenek Kabelac2014-09-194-13/+67
| | | | Validate major, minor numbers after reading them from metadata.
* cleanup: use const for cmd contextZdenek Kabelac2014-09-192-19/+19
|
* cleanup: switch to use CHANGE_AEYZdenek Kabelac2014-09-194-5/+5
| | | | Since for other enums we use 'Y' or 'N' use it with 'AE' as well.
* wipe_lv: move sync_local_dev_names in frontZdenek Kabelac2014-09-191-2/+2
| | | | Synchronize things before checking for locally active volume.
* memlock: drop uneeded lockZdenek Kabelac2014-09-192-0/+8
| | | | Avoid doing buffered operation within memory lock.
* memlock: ensure memory is allocation before lockingZdenek Kabelac2014-09-191-3/+3
| | | | | strerror may mmap ram if it was not yet used. dm_udev_get_sync_support may initilize udev if it was still not used.
* debug: mmap traps mmap and mmap64 on i386Zdenek Kabelac2014-09-191-16/+46
| | | | | | | Add code to trap both mmap implementation on 32bit arch. Use dlsym() Use hlt instraction instead of int3 - generates usable stack trace when problem is catched.
* WHATS_NEWZdenek Kabelac2014-09-181-0/+1
|
* makefiles: fix linking of PIE codeZdenek Kabelac2014-09-181-2/+2
| | | | | | | | | | | | | | | | PIE documentation: : https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html http://lfs.osuosl.org/hlfs/view/unstable/glibc/chapter02/pie.html suggest to suply -fPIE (or -fpie) with -pie during executable compilation. When -fPIC and -fPIE are used together - -fPIE wins Drop usage of -DPIE - we are not using this flag anywhere TODO: cleanup linking flags
* debug: enhance trap of mmapZdenek Kabelac2014-09-181-11/+12
| | | | | | Don't install trap for mlockall case Add another code path for -fPIE compilation, in this case the address of mmap function is 'plt' address.
* cleanup: update messageZdenek Kabelac2014-09-181-1/+1
|
* debug: catch mmap with -DDEBUG_MEMLOCKZdenek Kabelac2014-09-182-0/+72
|
* cleanup: detect unsupported options earlierZdenek Kabelac2014-09-181-12/+12
| | | | Avoid unnecessary converions of pool.
* cache: Enable cache segment type by default.Alasdair G Kergon2014-09-173-4/+6
|
* lvconvert: Further restrictions on cache/pools.Alasdair G Kergon2014-09-174-3/+48
| | | | | Would be better to define what is supported not what isn't, but this'll have to do for now.
* lvconvert: Disallow mixing of cache and thin pools.Alasdair G Kergon2014-09-171-0/+12
| | | | | --cachepool can't take a thin pool and --thinpool can't take a cache pool.
* lvconvert: Restrict use of cache LVs.Alasdair G Kergon2014-09-172-0/+13
| | | | | Refuse use of -m and -s with cache LVs until full support can be provided.
* cleanup: Remove metadata.h from tools dir.Alasdair G Kergon2014-09-175-8/+5
| | | | | metadata.h is meant to be internal to the library. metadata-exported.h contains the things needed by tools.
* vgchange: support clustered conversion for active lvZdenek Kabelac2014-09-174-17/+64
| | | | | | | | | | | | | | | | | | | | If we want to support conversion of VG to clustered type, we currently need to relock active LV to get proper DLM lock. So add extra loop after change of VG clustered attribute to exlusively activate all active top level LVs. When doing change -cy -> -cn we should validate LVs are not active on other cluster nodes - we could be sure about this only when with local exclusive activation - for other types we require user to deactivate volumes first. As a workaround for this limitation there is always locking_type = 0 which amongs other skip the detection of active LVs. FIXME: clvmd should handle looks for cluster locking type all the time.
* locking: add locking_supports_remote_queriesZdenek Kabelac2014-09-174-1/+8
| | | | | | Add function to detect whether locking could be used to query for lock type so we could recognize exclusive activation.
* cache-pool: Fix specification of cachemode when converting to cache-poolJonathan Brassow2014-09-162-0/+2
| | | | | | Failure to copy the 'feature_flags' lvconvert_param to the matching lv_segment field meant that when a user specified the cachemode argument, the request was not honored.
* clean-up: better macro usageJonathan Brassow2014-09-161-2/+2
| | | | | | Use 'lv_is_mirror' instead of 'lv_is_mirrored && !lv_is_raid' - both are the same as asking if the non-RAID mirror implementation is being used.
* vgchange: disable cluster convert for active LVsZdenek Kabelac2014-09-163-25/+29
| | | | | | | | | While we could probably reacquire some type of lock when going from non-clustered to clustered vg, we don't have any single road back to drop the lock and keep LV active. For now keep it safe and prohibit conversion when LV is active in the VG.
* va_list: properly pass va_list through functionsZdenek Kabelac2014-09-163-5/+17
| | | | | | | | | | Code should not just pass va_list arg through the function as args could be passed in many strange ways. Use va_copy(). For details look in i.e.: http://julipedia.meroh.net/2011/09/using-vacopy-to-safely-pass-ap.html
* devices: Detect rotational devices.Alasdair G Kergon2014-09-163-22/+38
| | | | Add dev_is_rotational() for future use by allocation code.
* mirrors: Fix checks for mirror/raid/pvmove LVs.Alasdair G Kergon2014-09-1615-22/+45
| | | | | | | | | | | | | | | | | Try to enforce consistent macro usage along these lines: lv_is_mirror - mirror that uses the original dm-raid1 implementation (segment type "mirror") lv_is_mirror_type - also includes internal mirror image and log LVs lv_is_raid - raid volume that uses the new dm-raid implementation (segment type "raid") lv_is_raid_type - also includes internal raid image / log / metadata LVs lv_is_mirrored - LV is mirrored using either kernel implementation (excludes non-mirror modes like raid5 etc.) lv_is_pvmove - internal pvmove volume
* cmirror: fix endian issues on s390Liuhua Wang2014-09-151-4/+5
| | | | | | | | | | | | | | | | | Cmirrord has endian bugs, which cause failure to lvcreate a mirrored lv on s390. - data_size is uint32, should not use xlate64 to convert, which will cause data_size 0 after xlate. - request_type and data_size still used by local(v5_data_switch), should convert later. If request_type xlate too early, it will cause request_type judge error; if data_size xlate too early, it will cause coredump in case DM_ULOG_CLEAR_REGION. - when receiving package in clog_request_from_network. vp[0] will always be little endian. We could use xlate64(vp[0]) == vp[0] to decide if the local node is little endian or not. Signed-off-by: Lidong Zhong<lzhong@suse.com> & Liuhua Wang <lwang@suse.com> Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>