1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-06 17:18:29 +03:00
Commit Graph

2388 Commits

Author SHA1 Message Date
Alasdair Kergon
41b738c1e4 Scan all devices for lvmetad if 'pvscan --cache' used without device list. 2012-03-03 18:32:53 +00:00
Alasdair Kergon
eed642e0b3 post-release 2012-03-03 02:08:37 +00:00
Alasdair Kergon
eb706b3106 . 2012-03-03 01:28:15 +00:00
Alasdair Kergon
9a26228d28 pre-release 2012-03-03 01:00:49 +00:00
Zdenek Kabelac
00422596c1 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
6859106e2a 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
197d0d4af6 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
e922a85c51 Test alloc fail 2012-03-01 21:49:32 +00:00
Zdenek Kabelac
a75b0d4ee6 Check for alloc error
Simplify segtype_str usage and check for NULL segtype.
2012-03-01 21:21:54 +00:00
Zdenek Kabelac
6ebad37e9b Add _rimage as reserved suffix 2012-03-01 10:39:21 +00:00
Zdenek Kabelac
6732bedecb 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
c9ab8ce0a3 Check for allocation error
return ENOMEM when malloc fails.
2012-03-01 09:54:23 +00:00
Zdenek Kabelac
052269aa2c 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
50bdd70043 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
7ed8790301 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
a22be5e2e9 Test dm_hash_insert() failures mem failures 2012-02-28 11:12:58 +00:00
Zdenek Kabelac
77e9346a06 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
c998f7d27a Better detection of missing dmeventd fifo connection 2012-02-28 11:03:24 +00:00
Zdenek Kabelac
c3cb4bb872 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
da0f745cb6 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
Zdenek Kabelac
9ef8d6617e Do not send uninitilised bytes
Use struct initalizers to fill struct members and at the same time have
all unspecified members set to 0.
2012-02-28 09:53:55 +00:00
Zdenek Kabelac
cd1f056f20 Use unsigned type for bitmask
Using report_type_t for bitmask is not correct, since we have not defined types
for all  bit combinations - so switching to unsigned type, since values of
report_type_t enum are unsigned.
2012-02-27 11:45:05 +00:00
Zdenek Kabelac
e51cc452d2 Nicer cleanup of excl_uuid hash
Since it on exit path, it's not a big difference,
but makes less noise in analyzer and valgrind.
2012-02-27 11:26:25 +00:00
Zdenek Kabelac
4f443a0d0c Check for vg_name existance
Since vg_read() mda ops could be called with NULL vg_name,
check it before derefence also for pool and format1.
2012-02-27 11:23:15 +00:00
Zdenek Kabelac
0027de97c9 Fix missing break
Bug introduced with addition of internal error default case.
Seem like this code is not used.
TODO: add coverage test.
2012-02-27 11:13:48 +00:00
Zdenek Kabelac
061b3169f9 Test seg pointer for non-null
As the function accepts NULL for 'seg' parameter,
check for it before dereference.
2012-02-27 10:15:08 +00:00
Zdenek Kabelac
edb0de6539 Test result of _init_tags. 2012-02-27 10:05:35 +00:00
Zdenek Kabelac
61a6481305 Always check result of _set_vg_name() 2012-02-27 10:00:23 +00:00
Zdenek Kabelac
dc92528f10 Drop uname call, it's not used from gulm era. 2012-02-27 09:58:18 +00:00
Zdenek Kabelac
fe84afbbab Check allocation result 2012-02-27 09:56:27 +00:00
Zdenek Kabelac
75ac0b638c Limit sscanf params with size
Make sure parsed string fits given char buffer.
2012-02-23 22:50:50 +00:00
Zdenek Kabelac
aa558eaeb8 Use const for lv
lv_is_active doesn't needs modifiable LV struct so keep it const.

Remove lv_send_message() left bits from code -
they were never released in 2.02.89.
2012-02-23 22:41:57 +00:00
Zdenek Kabelac
2237e93169 Use same signed numbers
Keep unsigned aritmetic.

TODO: we should probably switch dm_split_words() to return unsigned numbers.
(minor API libdm change mostly compatible)
2012-02-23 22:30:20 +00:00
Alasdair Kergon
7a502785b0 post-release 2012-02-23 18:26:28 +00:00
Alasdair Kergon
2a0264eb7d pre-release 2012-02-23 18:22:09 +00:00
Jonathan Earl Brassow
74d0a06513 Require number of stripes to be greater than parity devices in higher RAID.
Also, add some comments to code that I recently added that may be unclear
otherwise.
2012-02-23 17:36:35 +00:00
Peter Rajnoha
8acbf570b5 Add LVMetaD systemd units. 2012-02-23 11:24:07 +00:00
Jonathan Earl Brassow
e10e4a5134 Fix allocation code to allow replacement of single RAID 4/5/6 device.
The code fail to account for the case where we just need a single device
in a RAID 4/5/6 array.  There is no good way to tell the allocation functions
that we don't need parity devices when we are allocating just a single device.
So, I've used a bit of a hack.  If we are allocating an area_count that is <=
the parity count, then we can assume we are simply allocating a replacement
device (i.e. no need to include parity devices in the calculations).  This
should make sense in most cases.  If we need to allocate replacement devices
due to failure (or moving), we will never allocate more than the parity count;
or we would cause the array to become unusable.  If we are creating a new device,
we should always create more stripes than parity devices.
2012-02-23 03:57:23 +00:00
Alasdair Kergon
aa357b8f5d Check all tags and LV names are in a valid form in vg_validate. 2012-02-23 00:11:01 +00:00
Peter Rajnoha
73c46fa222 Add configure --with-tmpfilesdir and lvm2 tmpfiles.d configuration file itself.
/etc/tmpfiles.d directory holds configuration files for temporary/volatile
files and directories that should be automatically managed. For example,
if we have some parts of the fs hierarchy on tmpfs, we'd like to recreate
some files or directories on every boot so they're always prepared for use.

Systemd can read such configuration files. For now, the lock and run directory
are the ones that are most probably placed on tmpfs. If this is the case, we
can install the configuration by 'make install_tmpfiles_configuration'.
2012-02-22 17:55:10 +00:00
Jonathan Earl Brassow
3fc37a89e2 Allow 'lvconvert --repair' to operate on RAID 4/5/6.
The higher level RAIDs should be allowed for repair along with 'mirror' and
'raid1' segment types.
2012-02-22 17:18:49 +00:00
Jonathan Earl Brassow
fe81ba59e8 *** empty log message *** 2012-02-22 17:14:38 +00:00
Alasdair Kergon
6d4df258e4 post-release 2012-02-20 21:11:06 +00:00
Alasdair Kergon
a742ee8b37 pre-release 2012-02-20 19:38:19 +00:00
Zdenek Kabelac
d6463f4890 Initialize dmeventd monitoring for every command
Read lvm.conf setting for monitoring for each command. So we should not
activate monitoring if the default compilation is set to monitor during
lvconvert commnads.

Patch also removes check for  clustered VG and allows to disable monitoring
for clustered VG with the assumption, the problem with monitoring and dmeventd
flag passing for INGNORE is already fixed.
2012-02-15 15:18:43 +00:00
Zdenek Kabelac
397d2bfe89 Initialize monitoring support only for thin pools 2012-02-15 13:49:51 +00:00
Jonathan Earl Brassow
4847399243 Make conversion from a synced 'mirror' to 'raid1' not cause a full resync.
It was not possible to pass down the DM_[FORCE|NO]SYNC flags to
'dm_tree_node_add_raid_target'.  This meant that converting to 'raid1' from
'mirror' would cause a full resync.  (It also meant that '--nosync' was
ineffective when creating a 'raid1' LV.)

I've taken the 'reserved' parameter in 'dm_tree_node_add_raid_target' and
used it for the "flags" parameter.  Now it is possible to pass the sync
flags and any other flags that may come up.
2012-02-13 20:13:39 +00:00
Zdenek Kabelac
cc05bde071 Never try to test character past given buffer
In case units[0] would be already '\0', do not check units[1].
2012-02-13 14:23:40 +00:00
Peter Rajnoha
07d54dd4a7 Add configure --with-systemdsystemunitdir. 2012-02-13 13:02:47 +00:00
Zdenek Kabelac
dab4bb3bdf Add check for allocation failure 2012-02-13 11:16:42 +00:00
Zdenek Kabelac
bbf912b644 Add check for rimage name allocation failure 2012-02-13 11:10:37 +00:00
Zdenek Kabelac
05e8ec79e0 Add check for mda_copy failure 2012-02-13 11:09:25 +00:00
Zdenek Kabelac
78188982d6 Add check for failure 2012-02-13 11:07:55 +00:00
Zdenek Kabelac
6890aea4ca Add free_orphan_vg
Move commod code to destroy orphan VG into free_orphan_vg() function.
Use orphan vgmem for creation of PV lists.
Remove some free_pv_fid() calls (FIXME: check all of them)
FIXME: Check whether we could merge release_vg back again for all VGs.
2012-02-13 11:03:59 +00:00
Zdenek Kabelac
b2b5a2268a If the same fid is already same avoid ref_counting 2012-02-13 11:01:34 +00:00
Zdenek Kabelac
5ca11ba420 Add missing test for failure of lvmcache_foreach_pv 2012-02-13 10:58:20 +00:00
Zdenek Kabelac
c227ad23cc Clean error paths for format instance
With updated orphan VG code this code needed some updates.
Add missing log_error for allocation failures.
2012-02-13 10:56:31 +00:00
Zdenek Kabelac
5dc08c01d3 Release_vg instead of plain free in error path 2012-02-13 10:53:31 +00:00
Zdenek Kabelac
ec6a14f40a Log error reporting for failing _alloc_pv
Drop unneeded zeroing of zalloced memory region.
2012-02-13 10:51:52 +00:00
Fabio M. Di Nitto
69b9a614c7 In the new corosync world, dlm is a standalone service.
Fix clvmd init script to Require dlm service when building for the
new corosync or clvmd will fail to start.
2012-02-13 05:24:57 +00:00
Alasdair Kergon
52fdced782 post-release 2012-02-13 00:23:21 +00:00
Alasdair Kergon
2a7e2fe2d3 pre-release 2012-02-12 23:02:52 +00:00
Alasdair Kergon
11b3b12336 FMT_INSTANCE_PV is no longer used 2012-02-12 22:37:24 +00:00
Petr Rockai
e8ada4a717 What's new. 2012-02-10 02:56:54 +00:00
Petr Rockai
395ee036d7 What's new: lvmcache. 2012-02-10 01:29:46 +00:00
Peter Rajnoha
2936951d94 Stop processing lvextend if trying to extend a mirror that is being recovered.
Missing correct return value in lv_extend fn.
2012-02-09 15:13:42 +00:00
Zdenek Kabelac
6d29fe0f33 Thin add pool_below_threshold
Test both data and metadata percent usage.
2012-02-08 13:05:38 +00:00
Zdenek Kabelac
70e3728446 Fix test for lv_snapshot_percent
Do not check for PERCENT_MERGE_FAILED if the lv_snapshot_percent() failed.
(test for snap_percent would be testing uninitialized value).
2012-02-08 13:02:07 +00:00
Zdenek Kabelac
74c7c69d34 Some fixmes
'len' calculation is unused ?
Unreachable code could be removed or moved upward ?
2012-02-08 12:57:15 +00:00
Zdenek Kabelac
7ce534f911 Switch to return void
List delete cannot fail, so there is no reason to test for error.
2012-02-08 12:52:58 +00:00
Zdenek Kabelac
f03f322f13 Use dm_snprintf and improve error handling
Add standard error reporting with error logging.
Use plain alloc instead of zalloc for string buffer.
Use dm_snprintf with valid test for <0.
2012-02-08 12:50:10 +00:00
Zdenek Kabelac
c929a0b3c8 Add range test for device number
Check the output of atoi is in valid range.
2012-02-08 12:48:14 +00:00
Zdenek Kabelac
cc525412f1 Keep page_size as signed number
Since it's return value from sysconf and is checked for <0.
2012-02-08 11:34:46 +00:00
Zdenek Kabelac
962fd76f26 Move done jump lower
Since before 'goto done' is bufused zeroed, it would otherwise write 1
byte in front of buffer.
2012-02-08 11:31:29 +00:00
Zdenek Kabelac
e6b610e8ed Check that whole locking_dir fits _lock_dir buffer 2012-02-08 11:17:34 +00:00
Zdenek Kabelac
e2d2f6c7b7 Use dm_list_iterate_items_safe
And avoid direct access to list member variables.
Inline _free_li().
2012-02-08 11:12:18 +00:00
Zdenek Kabelac
4443aa41cc Ensure strncpy() function always ends with '\0'
Since last character needs to be \0 for string,
pass buffer size smaller by 1 byte.
2012-02-08 11:05:04 +00:00
Zdenek Kabelac
24da0046d5 Set status for error path
Do not leave status unitialized, since in some cases, it's tested,
when the function returns error.
2012-02-08 10:56:17 +00:00
Zdenek Kabelac
8d9b4b0133 Add missing deps for lvm2api
Hmm, wasted some time because of this missing deps....
2012-02-08 10:52:45 +00:00
Zdenek Kabelac
328ed80160 Fix resource leaks for failing allocation
In case, something would fail during format initialization,
return allocated memory.
2012-02-08 10:49:36 +00:00
Zdenek Kabelac
582c94aa21 Release allocated resources in error path
If composite_filter_create() fails, release filters.
2012-02-08 10:46:24 +00:00
Zdenek Kabelac
38188ff8aa Check result of lstat
If lstat returns errno different from ENOENT, do not use the content of
struct stat 'buf'.
2012-02-08 10:43:42 +00:00
Petr Rockai
c84c7ee034 What's new. 2012-02-01 20:13:44 +00:00
Alasdair Kergon
b93aa9eac4 post-release 2012-02-01 18:46:57 +00:00
Alasdair Kergon
d8e7d0e2bd pre-release 2012-02-01 15:17:04 +00:00
Zdenek Kabelac
433c583cd7 Add synchornization point in mirror log init.
Put extra sync point when mirror log is deactivated and before
it's activated for the second time.
2012-02-01 13:50:36 +00:00
Zdenek Kabelac
02f6f4902f Disable partial activation for thin LVs and LVs with all missing segments
Count number of error and existing areas and if there is no existing area
for the LV avoid its activation.

Always disable partial activatio for thin volumes.

For mirrors currently put in hack to let it pass with a special name
since current mirror code needs to activate such LV during some operations.
2012-02-01 13:47:27 +00:00
Zdenek Kabelac
90fd0f5b42 Avoid warning for small pv_min_size
Do not print warning for pv_min_size set in range between 512KB and 2MB.
2012-02-01 13:42:18 +00:00
Peter Rajnoha
56f6e9310d Clean up systemd unit ordering and requirements. 2012-02-01 13:08:39 +00:00
Zdenek Kabelac
f00a162500 User correct base dir for lcov reports
Fix problem when srcdir != builddir.
2012-02-01 10:46:45 +00:00
Alasdair Kergon
b94b757e1e Track unreserved space for all alloc policies and then permit NORMAL to place
log and data on same single PV.
2012-02-01 02:10:45 +00:00
Alasdair Kergon
8416129244 Automatically detect whether corosync clvmd needs to use confdb or cmap. (fabio) 2012-01-31 21:21:53 +00:00
Zdenek Kabelac
b329581e8e Fix data% reporting
For reading % of mapped size of thin volume use as origin for
old style snapshot '-real' device needs to be queried.
Fix log_error report given for lvs -a in this case.
2012-01-28 20:12:26 +00:00
Alasdair Kergon
09e8d81a53 post-release 2012-01-27 01:23:40 +00:00
Alasdair Kergon
f47f37485e pre-release 2012-01-26 14:02:42 +00:00
Zdenek Kabelac
baffb459d8 Test for uname result
in fail path initialize to 0.
2012-01-25 22:17:57 +00:00
Zdenek Kabelac
381deeed8f Fix missing dmt destructor
Also always initialize maj,min,patchlevel when success is returned.
2012-01-25 22:16:04 +00:00
Zdenek Kabelac
4343bc5e86 Limit alignment to 32bit values
to get the same behavior on 32/64 machines.
2012-01-25 21:52:53 +00:00
Zdenek Kabelac
5d1d269f45 Check for correctness of uint64 value if exists 2012-01-25 21:43:51 +00:00
Zdenek Kabelac
ec2012f736 Rename origin_only to more generic use_layer flag
Since now we have more layered devices i.e. thin volumes - support
selection of layer via flag.
2012-01-25 13:10:26 +00:00