1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 01:55:10 +03:00
Commit Graph

2368 Commits

Author SHA1 Message Date
Milan Broz
dcd90bc501 Do not allow pvmove if some affected LVs are activated
locally or on more nodes while others are activated exclusively.

Current pvmove code can either use local mirror (for exclusive
activation) or cmirror (for clustered LVs).

Because the whole intenal pvmove LV is just segmented LV containing
segments of several top-level LVs, code cannot properly handle
situation if some segment need to be activated exclusively.

Previously, it wrongly activated exclusive LV on all nodes
(locing code allowed it) but now this is no lnger possible.

If there is exclusively activated LV, pvmove is only
possible if all affected LVs are aslo activated exclusively.

(Note that in non-exclusive mode pvmove still activates LVs
on other nodes during move.)

# lvchange -aly vg_test/lv1
# lvchange -aey vg_test/lv2
# pvmove -i 1 /dev/sdc
   Error locking on node bar-01: Device or resource busy
   Error locking on node bar-03: Volume is busy on another node
...
   Failed to activate lv2
2012-03-26 20:32:58 +00:00
Milan Broz
62a40438ab Remove unused and wrongly set cluster VG flag from clvmd lock query command. 2012-03-26 20:29:45 +00:00
Milan Broz
7076d1439b Fix pvmove if LV is activated exclusively but cmirror is not running.
In this case we should allow to use local mirror, check for cmirror
should apply only for lvconvert/lvcreate.

Introduced in 2.02.86 by removing !(lv->status & ACTIVATE_EXCL).

(Partially workaround, it is minimalistic patch for now.)
2012-03-23 16:28:40 +00:00
Zdenek Kabelac
0fc9a3dce3 Always free hash table
also in error path
2012-03-23 10:33:26 +00:00
Zdenek Kabelac
2caa558e7c Update and fix monitoring of thin pool devices
Code adds better support for monitoring of thin pool devices.
update_pool_lv uses DMEVENTD_MONITOR_IGNORE to not manipulate with monitoring.
vgchange & lvchange are checking real thin pool device for existance
as we are using   _tpool  real device and visible LV pool device might not
be even active (_tpool is activated implicitely for any thin volume).
monitor_dev_for_events is another _lv_postorder like code it might be worth
to think about reusing it here - for now update the code to properly
monitory thin volume deps.
For unmonitoring add extra code to check the usage of thin pool - in case it's in use
unmonitoring of thin volume is skipped.
2012-03-23 09:58:04 +00:00
Zdenek Kabelac
5da4d94adc Return mem fail if hash insert fails 2012-03-23 09:48:17 +00:00
Zdenek Kabelac
fbd89d3a1a Fix typo in config option check 2012-03-23 09:42:36 +00:00
Zdenek Kabelac
1d6a2c7326 Update lcov target 2012-03-23 09:39:03 +00:00
Zdenek Kabelac
0b17a75f13 Fix regression in thin monitoring
Patch https://www.redhat.com/archives/lvm-devel/2012-February/msg00118.html
removed initilization of thin volume monitoring, leaving it only for
thin pool - but missed the code move part for monitoring of thin pools.
Effectively making thin pools not monitorable.
2012-03-20 17:42:19 +00:00
Zdenek Kabelac
37672e676d Support improperly formated device numbers
There are kernel drivers (smblk) which set '-1' as their device major number.
This number is listed in /proc/devices then - but the kernel itself is using
just 12 bits - thus device is accessible via 4095 - there is posted patch
for 3.4 to fix this behavior (0 for auto allocation was mean to be used).

However to still allow using such devices with older kernels add some code
to use same behavior - so cut 12 bits from the major number from /proc/devices.

For now use log_warn() - maybe the severity of the message could be lowered
to just verbose level.
2012-03-20 10:47:02 +00:00
Zdenek Kabelac
a9382908ae Fix string parsing
Fix propagation of -e option - pass it via internal shell variable.
Fix parsing of /proc/mounts files (don't check for substrings).
 as reported by O.Mangold with suggested patch:
 https://www.redhat.com/archives/linux-lvm/2012-February/msg00030.html
Properly pass arguments with spaces ("$@")
Add validation for YES and EXTOFF variable content.
2012-03-16 12:53:05 +00:00
Petr Rockai
f1d117f9f9 It's new. 2012-03-16 10:46:25 +00:00
Jonathan Earl Brassow
dc7b1640ed Fix name conflicts that prevent down-converting RAID1 when specifying a device
When down-converting a RAID1 device, it is the last device that is extracted
and removed when the user does not specify a particular device.  However,
when a device is specified (and it is not the last), the device is removed and
the remaining sub-LVs are "shifted down" to fill the hole.  This cause problems
when resuming the LV because if the shifted devices were resumed (and thus
renamed) before the sub-LV being extracted, there would be a name conflict.
The solution is to resume the extracted sub-LVs first so that they can be
properly renamed preventing a possible conflict.

This addresses bug 801967.
2012-03-15 20:00:54 +00:00
Zdenek Kabelac
e866931169 Improve thin_check option passing
Update a way we handle option passing - so we now support path and options
with space inside.
Fix dm name usage for thin pools with '-' in name.
Use new lvm.conf option thin_check_options to pass in options as string array.
2012-03-14 17:12:05 +00:00
Zdenek Kabelac
f61cacad16 Add --with-thin-check configure option
If specified - use given path without test (Path could be empty)
If autodetection is in use - check for command in available PATH.
2012-03-14 17:09:00 +00:00
Peter Rajnoha
88bba90e6e WHATS_NEW 2012-03-14 12:12:21 +00:00
Alasdair Kergon
bba1e4d11f Fix error message when pvmove LV activation fails with name already in use. 2012-03-13 20:21:26 +00:00
Zdenek Kabelac
0d3ce181e1 Better structure layout for device_info
Save some relocation entries and use directly char[].
Since we do not need yes more then 127 partitions per device, use just int8_t.
Move lvm_type_filter_destroy into local static function.
2012-03-12 14:40:41 +00:00
Zdenek Kabelac
aa9ebf4494 Switch to normal log_verbose message
Here it's not an error case - so do not push this message to stderr.
2012-03-12 14:18:28 +00:00
Zdenek Kabelac
f6632c1ef4 Fix error path for create_toolcontext
Never return unfinished toolcontext - since error path is hit on
various stages of initialization we cannot leave it partially uninitialized,
since we would need to spread many more test across the code for config_valid.
Instead return NULL and properly release udev library resources as well.
2012-03-12 14:15:04 +00:00
Zdenek Kabelac
34a45b0029 Fix warn message and update man page
Fix regression in man page. The chunk size is in kilobyte units on command line
input though in the source code we work with sector size unit
so make it clear in the man page.

Update chunksize for thin pool in man page - it's max value is 1024M == 1G.

Fix warning range message to show proper max value.
2012-03-06 09:22:02 +00:00
Alasdair Kergon
a17ac481ab post-release 2012-03-06 04:47:37 +00:00
Alasdair Kergon
ce05af1d32 pre-release 2012-03-06 02:50:40 +00:00
Alasdair Kergon
b343d75a5a Switch pvscan --cache major:minor to --major --minor. 2012-03-06 02:30:49 +00:00
Zdenek Kabelac
aeaec150c0 Some more missing supposedly 64bit operations.
Avoid use 32bit math for extent_size.
2012-03-05 15:05:24 +00:00
Zdenek Kabelac
90423c1200 Fit thin pool metadata into 128MB
If the lvcreate may decide some automagical values for a user,
try to keep the pool metadata size into 128MB range for optimal
perfomance (as suggested by Joe).

So if the pool metadata size and chunk_size were not specified,
try to select such values they would fit into 128MB size.
2012-03-05 14:19:13 +00:00
Zdenek Kabelac
975b5b42d2 Improve warning
Use thin_dump --repair suggestion in log error message
and use just warning on  deactivation path without repair info
(since node has been deactivated).

Also check whether there is not 16 args for thin_check configured.
2012-03-05 14:15:50 +00:00
Zdenek Kabelac
20c40a0807 Use 64bit math
Prevent 32bit overflow and resulting weird error reports when working
with TB sizes..
2012-03-05 14:12:57 +00:00
Zdenek Kabelac
d18c70b4df Validate udev structures
Avoid using NULL pointers from udev. It seems like some older versions of udev
were improperly returning NULL in some case, so do not silently break here,
and give at least a warning to the user.
2012-03-04 17:40:59 +00:00
Zdenek Kabelac
462de06d96 Return success for deactivation of thin pool
if the thin_check fail on thin pool - still return successful deactivation,
since lvremove would currently fail.

TODO: find some way to not run check with lvremove.
2012-03-04 17:36:23 +00:00
Alasdair Kergon
35216ca66c Scan all devices for lvmetad if 'pvscan --cache' used without device list. 2012-03-03 18:32:53 +00:00
Alasdair Kergon
37160ef249 post-release 2012-03-03 02:08:37 +00:00
Alasdair Kergon
05babeeef5 . 2012-03-03 01:28:15 +00:00
Alasdair Kergon
02b351ad95 pre-release 2012-03-03 01:00:49 +00:00
Zdenek Kabelac
0438b15353 List _thread_registry missed mutex
Operation on _thread_registry needs to be covered by mutex.
Cosmetic move a die code after free for valgind short leak list.
2012-03-02 22:57:25 +00:00
Zdenek Kabelac
6c7a6c07ee Add support for thin check
Use libdm callback to execute thin_check before activation
thin pool and after deactivation as well.

Supporting thin_check_executable which may pass in extra options for
the tool.
2012-03-02 21:49:43 +00:00
Zdenek Kabelac
1babf24949 Fix estimation of pool metadata device size
If no size was give the later added minimal size check efectively
disable this code. Also the argument for size now must be kept
in sector_size, so adding division by SECTOR_SIZE (moved into
a const expression)
2012-03-02 17:25:21 +00:00
Zdenek Kabelac
52f76a7682 Test alloc fail 2012-03-01 21:49:32 +00:00
Zdenek Kabelac
1281a5e3d5 Check for alloc error
Simplify segtype_str usage and check for NULL segtype.
2012-03-01 21:21:54 +00:00
Zdenek Kabelac
c219934a87 Add _rimage as reserved suffix 2012-03-01 10:39:21 +00:00
Zdenek Kabelac
3bd9048854 Improve error logging
Log errors instead of plain return 0.
Check for f->private strdup result.
2012-03-01 10:30:48 +00:00
Zdenek Kabelac
f9467799c1 Check for allocation error
return ENOMEM when malloc fails.
2012-03-01 09:54:23 +00:00
Zdenek Kabelac
24ab6328f7 Wipe initial 4KiB for non-zeroed thin volumes
If the thin pool has disabled zeroing  (created with -Zn), we at least
clear initial 4KiB of such thin volume (provisions 1st block).

If lvcreate is executed with '-an' command will abort (same way like we for
normal LV - however for normal LV option -Zn may skip clearing completely,
for thin volumes this option is not supported (applies only for pools).
2012-02-29 22:08:57 +00:00
Jonathan Earl Brassow
62e38da133 Allow cluster mirrors to handle the absence of the checkpoint lib (libSaCkpt).
The OpenAIS checkpoint library is going away; therefore, cmirrord must
operate without it.  The algorithms the handle the timing of when to send
a checkpoint, the determination of what to send, and which ongoing cluster
requests are relevent with respect to the checkpoints are unaffected.  We
need only replace the functions that actually perform the storing/transmitting
and retrieving/receiving of the checkpoint data.  Rather than store the
checkpoint data in an OpenAIS checkpoint file, we simply transmit it along
with the message that notifies the incoming node that the checkpoint is
ready.
2012-02-29 21:15:34 +00:00
Zdenek Kabelac
54b2aadf40 Revert free of allocated segtype
lvm_register_segtype takes ownership of segtype and call destructor
for it in error path.
2012-02-28 14:23:41 +00:00
Zdenek Kabelac
0650d875e8 Test dm_hash_insert() failures mem failures 2012-02-28 11:12:58 +00:00
Zdenek Kabelac
bd046f0201 Ensure clvmd message is always \0 terminated
Drop whole buffer clearing (most messages at <100 bytes).
Just make sure we have always \0 terminated string for strlen() operations.
(before for PIPE_BUF sized messages this was not set).
2012-02-28 11:06:56 +00:00
Zdenek Kabelac
c19d86338d Better detection of missing dmeventd fifo connection 2012-02-28 11:03:24 +00:00
Zdenek Kabelac
6f8bd07b40 Duplicate standard in/out descriptors for daemon
Addressing somewhat tricky bug here.
Since stdin,stdout,stderr were closed it's been occasionally possible to
see some unexpected messages to be flowing into a clvmd and generating some
randomly sized allocation of many megabytes. Since the message was not
being generated by standard send_message() construction, after some more
testing it apperead to be a debug log message - thus something has flown
to local socket opened on strandard out descriptor.

To fix the issue - use standard file descriptor duplication code for daemons.

For making easier debugging of polling daemon - developer might want to recompile
without modifition of standard file descriptors.
2012-02-28 10:06:53 +00:00
Zdenek Kabelac
696052b78e Limit max size of clvmd message
This could be seen as some sort of simple validation - it's not easy to
recognize a valid message for now - but we definitely do not want to
allocate a lot of megabytes in  clvmd memory locked daemon when broken
message gets in.

Size of 8000 is just selected for now - possibly there could be much
lower value put in.
2012-02-28 09:58:19 +00:00