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

6772 Commits

Author SHA1 Message Date
Petr Rockai
dc5ba5c392 Fix an error path in daemon_open. 2012-02-24 00:02:54 +00:00
Petr Rockai
726cf41b80 Make the calls to pvscan --lvmetad in the testsuite slightly more civilised. 2012-02-23 23:58:42 +00:00
Petr Rockai
3f694b1265 Couple of improvements in the daemon (common + lvmetad) code:
- some client-side memory leak fixes
- announce and check protocols and protocol versions
2012-02-23 23:52:11 +00:00
Zdenek Kabelac
71f3bbd53f Limit sscanf params with size
Make sure parsed string fits given char buffer.
2012-02-23 22:50:50 +00:00
Zdenek Kabelac
d0a3aa04c8 Unit testing for some string libdm functions
TODO: more functions need to be unit tested.
2012-02-23 22:47:17 +00:00
Zdenek Kabelac
b3d10d7bf1 Introduce dm_strncpy
Should be faster then strncpy - since we could avoid clearing 4KB pages
with each strncpy(...,PATH_MAX).
Also it's easy to check whether string fit - and eventually avoid
to continue working we incomplete string.
2012-02-23 22:45:43 +00:00
Zdenek Kabelac
499a161640 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
980cf7959c Keep same sign for 's' counter 2012-02-23 22:36:56 +00:00
Zdenek Kabelac
b83e114008 Drop const modifier from fb
It's not useful here to use const - since we need non-const value for unmap.
Also remove now unneeded cast.
2012-02-23 22:36:21 +00:00
Zdenek Kabelac
2960604178 Add explicit cast for time() ret value
To keep all numbers with same sign
2012-02-23 22:31:23 +00:00
Zdenek Kabelac
c817e60796 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
Zdenek Kabelac
219e040062 Drop backtrace after log_error
Just a minor change to not give backtrace when log_error has been just
reported.
2012-02-23 22:24:47 +00:00
Zdenek Kabelac
ba337a5f3e Remaing code suffling
Move declaration to the front of function to follow coding rules.
2012-02-23 22:23:12 +00:00
Zdenek Kabelac
9cc66e6f8b Fix regression from cleanup commit
baton is being modified, so needs to be cleared before each use.
2012-02-23 19:03:48 +00:00
Alasdair Kergon
1a4b6136be post-release 2012-02-23 18:26:28 +00:00
Alasdair Kergon
f9fc7d8da4 pre-release 2012-02-23 18:22:09 +00:00
Zdenek Kabelac
b5184347b6 Missed dm_free in last commit 2012-02-23 18:19:32 +00:00
Zdenek Kabelac
f72b184e3e Limit number of mem allocs and copies
If we have good enough glibc to return number of needed chars, do not
loop try to reach good size, but use this size directly for allocation,
saving also last strdup.

Since now we start with 16 bytes - skip buffer realloc for shorter string.
2012-02-23 18:05:12 +00:00
Zdenek Kabelac
b6c5ea358e Some reformating for lvmetad uddates
cleanup gcc warning,
use PRIu64
header cleanups
const pointer fixes.
2012-02-23 17:59:32 +00:00
Jonathan Earl Brassow
870762d8e3 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
Petr Rockai
d4836062ff Add a vgscan to lvcreate-repair.sh. The old test applied device filter hacks to
make devices invisible to lvm, but the behaviour of those is slightly different
than of actual missing devices. Running vgscan after re-enabling the device
triggers a metadata repair which is not done by vgremove -ff. This is not a
regression, merely an odd behaviour that has been around even before lvmetad.
2012-02-23 14:55:29 +00:00
Peter Rajnoha
f84d6048cf Use 'd' instead of 'D' in tmpfiles configuration to not overwrite any existing directory.
...that happens when systemd creates it first (e.g. based on a .socket unit)
before the tmpfiles.d content is executed.
2012-02-23 14:24:30 +00:00
Petr Rockai
edfff8a26a Kick out a debugging call to valgrind in lvmcache-exercise.sh. 2012-02-23 14:21:18 +00:00
Petr Rockai
52e8e908d6 Add a missed dependency that is required to pull in dameons/common in an early
part of the build.
2012-02-23 13:58:56 +00:00
Petr Rockai
ce700e70d2 We need daemons/common now even if the lvmetad server side is not built. 2012-02-23 13:41:11 +00:00
Peter Rajnoha
840bc23ee1 Remove the old systemd socket file, we're using the .in template now. 2012-02-23 13:39:08 +00:00
Peter Rajnoha
dac3c36feb Use DEFAULT_RUN_DIR instead of hardcoded value in lvmetad systemd units
and add ExecStartPost=vgscan to actually run the first scan that will
fill the metadata daemon with metadata information.
2012-02-23 13:31:49 +00:00
Petr Rockai
43a44a1e2a Add -ldaemon to make.tmpl.in. 2012-02-23 13:31:01 +00:00
Petr Rockai
f5b077a388 Missed update for include/.symlinks.in to include lvmetad.h. 2012-02-23 13:19:26 +00:00
Petr Rockai
dae0822698 The lvmetad client-side integration. Only active when use_lvmetad = 1 is set in
lvm.conf *and* lvmetad is running.
2012-02-23 13:11:07 +00:00
Petr Rockai
182d1f60d2 Also use DEFAULT_RUN_DIR for the lvmetad socket on the client side. 2012-02-23 11:40:24 +00:00
Peter Rajnoha
da532741c9 Add LVMetaD systemd units. 2012-02-23 11:24:07 +00:00
Peter Rajnoha
2c893455ad Install lvm2 monitoring init script and systemd units only if dmeventd is built. 2012-02-23 11:13:18 +00:00
Peter Rajnoha
7044863afc Clean intermediate files. 2012-02-23 10:01:12 +00:00
Jonathan Earl Brassow
9bdfb30720 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
d860272b00 Check all tags and LV names are in a valid form in vg_validate. 2012-02-23 00:11:01 +00:00
Peter Rajnoha
0da6c851bd Add lvm2 tmpfiles.d configuration file. 2012-02-22 18:02:31 +00:00
Peter Rajnoha
4417a8bd40 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
e8eb64c878 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
0e92b70f71 *** empty log message *** 2012-02-22 17:14:38 +00:00
Jonathan Earl Brassow
7a5a5cb06f Add some messages that indicate completion of RAID device replacement.
There were no messages printed upon completiion of RAID device replacement.
This could cause confusion/concern during automated recovery, because the
user sees the failure messages but no other messages indicating correction.
2012-02-22 16:03:55 +00:00
Jonathan Earl Brassow
972282bfbc Fix a bad return code in 'lvconvert_raid'
Functions at this level do return 0 or 1, not ECMD_* values.
2012-02-22 15:20:50 +00:00
Petr Rockai
daa0000a47 Tweak lvmetad a bit more:
- allow at most one PV on any given device
- allow PV lookup by device
- merge the pvmeta info into VG metadata when responding to vg_lookup
2012-02-21 09:19:08 +00:00
Alasdair Kergon
971248911b post-release 2012-02-20 21:11:06 +00:00
Peter Rajnoha
6dd70f472a Call built-in blkid conditionaly (udev version >= 176), call standard blkid
with full path otherwise.
2012-02-20 19:38:40 +00:00
Alasdair Kergon
815aa3555f pre-release 2012-02-20 19:38:19 +00:00
Peter Rajnoha
b559a1e6f0 Check whether udev supports built-in blkid.
Built-in blkid is supported since udev v176 - set the UDEV_HAS_BUILTIN_BLKID
variable appropriately so we can use it in the rules to call the built-in
blkid conditionaly.
2012-02-20 19:36:27 +00:00
Peter Rajnoha
36c90588fc Switch to using built-in blkid in 13-dm-disk.rules.
Available in udev since version 176.
2012-02-16 14:39:02 +00:00
Petr Rockai
64a20df41c Drop the now-redundant pvid_to_status hash. 2012-02-15 17:37:09 +00:00
Petr Rockai
ff455b1806 Update lvmetad: use device major/minor pair to track devices. Keep a pvmeta
config tree per PV which is mostly provided by the client, so it can be used to
keep track of things like label_sector, PV format, mda count / offsets and so
on.
2012-02-15 17:30:07 +00:00