1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

7083 Commits

Author SHA1 Message Date
Petr Rockai
f8e287cca2 TEST: Workaround for lvmetad vs inconsistent metadata. 2012-09-26 17:26:23 +02:00
Petr Rockai
9f96286c29 lvmetad: Initialise debug_config also if no -d is given. 2012-09-26 17:26:23 +02:00
Petr Rockai
1ff2245c23 lvmetad: Give inconsistent metadata warnings in pvscan --cache. 2012-09-26 17:26:23 +02:00
Petr Rockai
c731bb1ee1 lvmetad: Fix #845269: SEGV on corrupt lvmetad response. 2012-09-26 17:26:23 +02:00
Petr Rockai
d2d6663428 lvmetad: Clear metadata/PV cache before a token-triggered rescan. 2012-09-26 17:26:23 +02:00
Petr Rockai
e7d3553906 lvmetad: Make vgscan --cache an alias to pvscan --cache. 2012-09-26 17:26:23 +02:00
Petr Rockai
2d7a8b4531 TEST: Add LVM_VALGRIND_LVMETAD to testing options. 2012-09-26 17:26:23 +02:00
Petr Rockai
0a87fed794 Makefiles: Build libdaemonclient unconditionally. 2012-09-26 17:26:23 +02:00
Petr Rockai
ca0c8673b2 lib/cache/lvmetad: s/pvscan_lvmetad/lvmetad_pvscan/ in the API 2012-09-26 17:26:23 +02:00
Petr Rockai
c9f56d639b lvmetad: Use "%" PRId64 in place of "%d" for extra clarity. 2012-09-26 17:26:16 +02:00
Petr Rockai
c7b17836ea Implement devices/global_filter.
The global filter is applied first, and is also applied in pvscan --cache (which
is called from udev rules to keep lvmetad updated). Cf. example.conf.
2012-09-26 14:49:15 +02:00
Petr Rockai
ceb79c9a50 example.conf.in: The command to refresh lvmetad is pvscan --cache. 2012-09-26 14:49:15 +02:00
Petr Rockai
2276379a71 lib/cache/lvmetad: Refactor to use dm_config_tree in requests.
We were using daemon_send_simple until now, but it is no longer adequate, since
we need to manipulate requests in a generic way (adding a validity token to each
request), and the tree-based request interface is much more suitable for this.
2012-09-26 14:49:15 +02:00
Petr Rockai
ea14d5159c libdaemon: Extend and refactor APIs.
- move common dm_config_tree manipulation functions from lvmetad-core to
  daemon-shared
- add config-tree-based request manipulation APIs to daemon-client
- factor out _v (va_list) variants of most variadic functions in libdaemon
2012-09-26 14:49:09 +02:00
Petr Rockai
72d82e21d4 dev-cache: Make it possible to pass in a NULL filter. 2012-09-26 12:23:34 +02:00
Petr Rockai
012d273ede filters: Alwayz zalloc the filter struct.
Not all pointers need to be initialised explicitly that way.
2012-09-26 12:23:34 +02:00
Petr Rockai
376cb3fe64 TEST: Kill lvmetad early in teardown. 2012-09-26 12:23:34 +02:00
Marian Csontos
17901569da cleanup: remove unused variable 2012-09-20 07:40:11 +02:00
Marian Csontos
9d0dc63c8b Fix tests to accept extended attribute
attr field had a character (p)artial appended.
2012-09-20 07:30:24 +02:00
Jonathan Brassow
2e04681248 mirror: 'lvconvert --resync' should reset LV_NOTSYNCED on corelog mirror
When reformatting the 'lvchange_resync' code in commit
05131f5853, a '!' should have been removed
from the condition that checks for the LV_NOTSYNCED flag on a corelog
mirror LV.  The presence of this '!' caused the LV_NOTSYNCED flag to be
cleared when it wasn't present and left when it was present.

It is not allowed to add images to a 'mirror' or 'raid1' LV if the
LV_NOTSYNCED flag is set.  We add some up-convert tests to ensure this
behavior is being enforced and that the LV_NOTSYNCED flag is being
properly cleared by 'lvchange --resync'.

(Not updating WHATS_NEW because this is intrarelease.)
2012-09-19 11:16:45 -05:00
Alasdair G Kergon
290ae4791e lvs: add partial attribute 2012-09-19 12:49:40 +01:00
Alasdair G Kergon
b737ff01e4 discards: skip when removing LVs on missing PVs
Don't try to issue discards to a missing PV to avoid segfault.
Prevent lvremove from removing LVs that have any part missing.

https://bugzilla.redhat.com/857554
2012-09-19 12:48:56 +01:00
Jonathan Brassow
2a6712ddef RAID1: Clear the LV_NOTSYNCED flag when a RAID1 LV is converted to linear
Failing to clear the LV_NOTSYNCED flag when converting a RAID1 LV to
linear can result in the flag being present after an upconvert - even
if the sync is performed when upconverting.
2012-09-14 16:26:53 -05:00
Jonathan Brassow
116bcb3ea4 RAID1: Like mirrors, do not allow adding images to LV created w/ --nosync
Mirrors do not allow upconverting if the LV has been created with --nosync.
We will enforce the same rule for RAID1.  It isn't hugely critical, since
the portions that have been written will be copied over to the new device
identically from either of the existing images.  However, the unwritten
sections may be different, causing the added image to be a hybrid of the
existing images.

Also, we are disallowing the addition of new images to a RAID1 LV that has
not completed the initial sync.  This may be different from mirroring, but
that is due to the fact that the 'mirror' segment type "stacks" when adding
a new image and RAID1 does not.  RAID1 will rebuild a newly added image
"inline" from the existant images, so they should be in-sync.
2012-09-14 16:12:52 -05:00
Jonathan Brassow
5cdd7848f4 TEST: Add missing test for RAID module version
RAID10 was added to dm-raid module version 1.3.0.  Omitted test for
this version is causing test suite to fail.
2012-09-12 06:27:37 -05:00
Peter Rajnoha
6d75ff138c systemd: depend on systemd-udev-settle unit in activation unit
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".
2012-09-12 11:30:13 +02:00
Peter Rajnoha
3127160626 vgchange: fix -aay to activate proper volumes
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!)
2012-09-12 09:47:40 +02:00
Jonathan Brassow
4ededc698f RAID: Properly handle resync of RAID LVs
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.
2012-09-11 13:09:35 -05:00
Jonathan Brassow
a2d9b1a7e9 cleanup: Restructure code that handles mirror resyncing
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.
2012-09-11 13:01:05 -05:00
Jonathan Brassow
05131f5853 cleanup: Reduce indentation by short-circuiting function
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.
2012-09-11 12:55:17 -05:00
Jonathan Brassow
cdb0339319 RAID: Disallow addition of RAID images while array is not in-sync
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.
2012-09-10 17:15:20 -05:00
Jonathan Brassow
b49b98d50c RAID: '--test' should not cause a valid create command to fail
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.
2012-09-05 14:32:06 -05:00
Jonathan Brassow
c3eb3a7687 cleanup: Use segtype->ops->name() instead of segtype->name where applicable
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.
2012-09-05 11:35:54 -05:00
Jonathan Brassow
1b01a2f65a TEST (lvresize-raid): Also test resizing of RAID10 2012-09-05 11:33:07 -05:00
Peter Rajnoha
967b5eb1f3 make: fix subdir order for distclean
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.
2012-08-27 15:39:08 +02:00
Peter Rajnoha
847e2856a2 config: require dm_config_create_value for dm_config_node's value
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.
2012-08-27 14:33:54 +02:00
Peter Rajnoha
2a70e98b05 test: snapshot_extend_threshold -> snapshot_autoextend_threshold
Missing the "auto" prefix in the config key name. The unknown
setting is silently ignored otherwise.
2012-08-27 14:04:21 +02:00
Peter Rajnoha
c68c157573 setvbuf: reopen only valid fd
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.
2012-08-27 13:07:07 +02:00
Zdenek Kabelac
5a3c597fd5 tests: testing lvm_lv_rename
Test stacking of rename operation within one udev transaction.
2012-08-27 13:03:15 +02:00
Zdenek Kabelac
e52d316751 lvm2api: extend lvm2api with lvm_lv_rename
Add support for LV rename.
2012-08-27 13:02:42 +02:00
Alasdair G Kergon
92330ba9c8 setvbuf: close and reopen stream before change
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.
2012-08-26 00:19:52 +01:00
Alasdair G Kergon
3acc85caa8 buffering: use unbuffered silent mode for liblvm
Disable private buffering when using liblvm.
When private stdin/stdout buffering is not used always use silent
mode.
2012-08-26 00:15:45 +01:00
Alasdair G Kergon
438e0050df config: add silent mode
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.
2012-08-25 20:35:48 +01:00
Jonathan Brassow
4047e4dfb1 RAID: Add support for RAID10
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.
2012-08-24 15:34:19 -05:00
Alasdair G Kergon
99d1e264a8 version: update 2012-08-24 18:51:24 +01:00
Zdenek Kabelac
329c46d36e clenaup: compatible definition for older gcc
Fixes previous commit, it seems older gcc compilers do not
recognize same typedef.

(Easiest would be probably to directly include proper header here).
2012-08-23 16:30:22 +02:00
Zdenek Kabelac
7b300a803c cleanup: add some missing stack backtraces 2012-08-23 14:38:48 +02:00
Zdenek Kabelac
109b3bb49b thin: discard 2012-08-23 14:38:48 +02:00
Zdenek Kabelac
0de57b98bf lvmapi: validate extents size for lvcreate 2012-08-23 14:38:48 +02:00
Zdenek Kabelac
eb08f86521 cleanup: initilize percent to INVALID
Always initialize percent to INVALID value, in case target
would have forget to setup this value somehow.
2012-08-23 14:38:48 +02:00