Commit message (Collapse)AuthorAgeFilesLines
* systemd: depend on systemd-udev-settle unit in activation unitHEADmasterPeter Rajnoha2012-09-122-2/+3
| | | | | | | | | | | The "fedora-wait-storage.service" that the "lvm2-activation.service" had as a dependency (which was fedora-specific solution anyway) is obsolete now as this unit called "modprobe scsi_wait_scan" which is not used anymore. The "fedora-wait-storage.service" had "systemd-udev-settle" as its dependency, so let's depend on this one directly now, bypassing the out-dated "fedora-wait-storage.service".
* vgchange: fix -aay to activate proper volumesPeter Rajnoha2012-09-122-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | Using 'activation/auto_activation_volume_list = [ "vg/lvol1" ]'. Before this patch: 3 logical volume(s) in volume group "vg" now active LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert lvol0 vg -wi----- 4.00m lvol1 vg -wi-a--- 4.00m lvol2 vg -wi-a--- 4.00m lvol3 vg -wi-a--- 4.00m (vg/lvol1 activated as it passes the list and all subsequent volumes too - wrong!) With this patch: 1 logical volume(s) in volume group "vg" now active LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert lvol0 vg -wi----- 4.00m lvol1 vg -wi-a--- 4.00m lvol2 vg -wi----- 4.00m lvol3 vg -wi----- 4.00m (only vg/lvol1 activated as it passes the list and no other - correct!)
* RAID: Properly handle resync of RAID LVsJonathan Brassow2012-09-112-14/+38
| | | | | | | Issuing a 'lvchange --resync <VG>/<RAID_LV>' had no effect. This is because the code to handle RAID LVs was not present. This patch adds the code that will clear the metadata areas of RAID LVs - causing them to resync upon activation.
* cleanup: Restructure code that handles mirror resyncingJonathan Brassow2012-09-111-29/+86
| | | | | | | | | | | | | | | | | When an LV is to be resynced, the metadata areas are cleared and the LV is reactivated. This is true for mirroring and will also be true for RAID LVs. We restructure the code in lvchange_resync() so that we keep all the common steps necessary (validation of ability to resync, deactivation, activation of meta/log devices, clearing of those devices, etc) and place the code that will be divergent in separate functions: detach_metadata_devices() attach_metadata_devices() The common steps will be processed on lists of metadata devices. Before RAID capability is added, this will simply be the mirror log device (if found). This patch lays the ground-work for adding resync of RAID LVs.
* cleanup: Reduce indentation by short-circuiting functionJonathan Brassow2012-09-112-43/+56
| | | | | | | | | By changing the conditional for resyncing mirrors with core-logs a bit, we can short-circuit the rest of the function for that case and reduce the amount of indenting in the rest of the function. This cleanup will simplify future patches aimed at properly handling the resync of RAID LVs.
* RAID: Disallow addition of RAID images while array is not in-syncJonathan Brassow2012-09-101-0/+4
| | | | | | | | We cannot add images to a RAID array while it is not in-sync. The kernel will simply reject the table, saying: 'rebuild' specified while array is not in-sync Now we check to ensure the LV is in-sync before attempting image additions.
* RAID: '--test' should not cause a valid create command to failJonathan Brassow2012-09-053-0/+10
| | | | | | | | | It is necessary when creating a RAID LV to clear the new metadata areas. Failure to do so could result in a prepopulated bitmap that would cause the new array to skip syncing portions of the array. It is a requirement that the metadata LVs be activated and cleared in the process of creating. However in test mode, this requirement should be lifted - no new LVs should be created or written to.
* cleanup: Use segtype->ops->name() instead of segtype->name where applicableJonathan Brassow2012-09-054-9/+11
| | | | | | | | When printing a message for the user and the lv_segment pointer is available, use segtype->ops->name() instead of segtype->name. This gives a better user-readable name for the segment. This is especially true for the 'striped' segment type, which prints "linear" if there is an area_count of one.
* TEST (lvresize-raid): Also test resizing of RAID10Jonathan Brassow2012-09-051-2/+33
* make: fix subdir order for distcleanPeter Rajnoha2012-08-271-2/+2
| | | | | | The 'test' subdir needs to be processed before 'tools' subdir for distclean as all the cmd names are read from 'tools/.commands' file. Otherwise we'd end up with dangling symlinks in 'tools' subdir.
* config: require dm_config_create_value for dm_config_node's valuePeter Rajnoha2012-08-273-7/+10
| | | | | | | | | | | | | | | | | If we were defining a section (which is a node without a value) and the value was created automatically on dm_config_create_node call, we were wasting resources as the next step after creating the config node itself was assigning NULL for the node's value. The dm_config_node_create + dm_config_create_value sequence should be used instead for settings and dm_config_node_create alone for sections. The majority of the code already used the correct sequence. Though with dm_config_node_create fn creating the value as well, the pool memory was being trashed this way. This patch removes the node value initialization on dm_config_create_node fn call and keeps it for the direct dm_config_create_value fn call.
* test: snapshot_extend_threshold -> snapshot_autoextend_thresholdPeter Rajnoha2012-08-272-2/+2
| | | | | Missing the "auto" prefix in the config key name. The unknown setting is silently ignored otherwise.
* setvbuf: reopen only valid fdPeter Rajnoha2012-08-273-24/+34
| | | | | | We should check whether the fd is opened before trying to reopen it. For example, the stdin is closed in test/lib/harness.c causing the test suite to fail.
* tests: testing lvm_lv_renameZdenek Kabelac2012-08-273-2/+87
| | | | Test stacking of rename operation within one udev transaction.
* lvm2api: extend lvm2api with lvm_lv_renameZdenek Kabelac2012-08-273-0/+27
| | | | Add support for LV rename.
* setvbuf: close and reopen stream before changeAlasdair G Kergon2012-08-262-6/+60
| | | | | | | | Fix setvbuf code by closing and reopening stream before changing buffer. But we need to review what this code is doing embedded inside a library function rather than the simpler original form being run independently at the top of main() by tools that need it.
* buffering: use unbuffered silent mode for liblvmAlasdair G Kergon2012-08-266-5/+23
| | | | | | Disable private buffering when using liblvm. When private stdin/stdout buffering is not used always use silent mode.
* config: add silent modeAlasdair G Kergon2012-08-2545-160/+198
| | | | | | | | | | | | | | | | Accept -q as the short form of --quiet. Suppress non-essential standard output if -q is given twice. Treat log/silent in lvm.conf as equivalent to -qq. Review all log_print messages and change some to log_print_unless_silent. When silent, the following commands still produce output: dumpconfig, lvdisplay, lvmdiskscan, lvs, pvck, pvdisplay, pvs, version, vgcfgrestore -l, vgdisplay, vgs. [Needs checking.] Non-essential messages are shifted from log level 4 to log level 5 for syslog and lvm2_log_fn purposes.
* RAID: Add support for RAID10Jonathan Brassow2012-08-2411-7/+218
| | | | | | This patch adds support for RAID10. It is not the default at this stage. The user needs to specify '--type raid10' if they would like RAID10 instead of stacked mirror over stripe.
* version: updateAlasdair G Kergon2012-08-242-2/+2
* clenaup: compatible definition for older gccZdenek Kabelac2012-08-231-2/+2
| | | | | | | Fixes previous commit, it seems older gcc compilers do not recognize same typedef. (Easiest would be probably to directly include proper header here).
* cleanup: add some missing stack backtracesZdenek Kabelac2012-08-231-9/+12
* thin: discardZdenek Kabelac2012-08-232-3/+3
* lvmapi: validate extents size for lvcreateZdenek Kabelac2012-08-231-5/+8
* cleanup: initilize percent to INVALIDZdenek Kabelac2012-08-231-2/+2
| | | | | Always initialize percent to INVALID value, in case target would have forget to setup this value somehow.
* clvmd,lvmetad: check for fcntl resultZdenek Kabelac2012-08-232-2/+4
| | | | Report any problem of fcntl.
* activation: report error messageZdenek Kabelac2012-08-231-0/+3
| | | | | If the monitoring activation failed and we have not yet reported error - give the user error message for failure reason.
* lvconvert: use _reload_lv on more placesZdenek Kabelac2012-08-232-60/+31
| | | | Use common subroutine.
* lvconvert: move _reload_lv()Zdenek Kabelac2012-08-231-27/+28
| | | | Just move in front
* cleanup: format1 test whether PV was foundZdenek Kabelac2012-08-231-1/+4
| | | | Avoid dereferecing NULL pointer.
* cleanup: add __attribute__ ((nonnull(1)))Zdenek Kabelac2012-08-232-0/+2
* check: add internal errors for unexpected pathsZdenek Kabelac2012-08-237-6/+42
| | | | | | | | | | | | | | | | | | | | Adding couple INTERNAL_ERROR reports for unwanted parameters: Ensure the 'top' metadata node cannot be NULL for lvmetad. Make obvious vginfo2 cannot be NULL. Report internal error if handler and vg is undefined. Check for handle in poll_vg(). Ensure seg is not NULL in dev_manager_transient(). Report missing read_ahead for _lv_read_ahead_single(). Check for report handler in dm_report_object(). Check missing VG in _vgreduce_single().
* cleanup: add error message and simplify creationZdenek Kabelac2012-08-231-7/+3
| | | | | Report error for malloc failure, and use zeroed allocation to initialize handler structure.
* cleanup: use proper activation_change_tZdenek Kabelac2012-08-234-4/+8
* cleanup: use static char[] arrayZdenek Kabelac2012-08-231-1/+1
* cleanup: cast to matching typeZdenek Kabelac2012-08-231-2/+2
* cleanup: use return_NULLZdenek Kabelac2012-08-231-1/+1
| | | | Function returns pointer, so use NULL.
* cleanup: ignore write/close outputZdenek Kabelac2012-08-231-2/+2
| | | | Intentionaly ignore write and close errors.
* cleanup: add va_endZdenek Kabelac2012-08-231-5/+7
| | | | Pair va_start with va_end.
* cleanup: uint64_t castsZdenek Kabelac2012-08-236-6/+6
* cleanup: keep MKNOD type cast cleanZdenek Kabelac2012-08-235-8/+8
| | | | Setup major already a dev_t type before it gets shifted.
* cleanup: add standard GPL file headerZdenek Kabelac2012-08-231-1/+25
| | | | Add FIXME about DEBUG define colission.
* cleanup: use <> for system header fileZdenek Kabelac2012-08-231-1/+1
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-2347-117/+0
| | | | | This headers were not resolving anything used for compiled .c files. Remove unused util.c file.
* cmirrord: check for result of chdirZdenek Kabelac2012-08-231-1/+5
| | | | Error exit if chdir fails.
* dmsetup: check if new_name is non NULLZdenek Kabelac2012-08-232-1/+2
* dmsetup: fix udev warning messageZdenek Kabelac2012-08-231-1/+1
| | | | Configure option is --enable-udev_sync.
* dmsetup: fix memleak in _get_split_nameZdenek Kabelac2012-08-232-1/+7
| | | | Free allocated buffer in _get_split_name error path.
* clvmd: release excl_uuid hashZdenek Kabelac2012-08-231-1/+2
| | | | Release allocated hash before exit.
* lvmetad: do not deref NULL pointerZdenek Kabelac2012-08-232-1/+4
| | | | Call log only for req.cft != NULL.