1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
Commit Graph

6586 Commits

Author SHA1 Message Date
Zdenek Kabelac
42c3f42474 Just reindent with tabs 2012-02-27 09:51:31 +00:00
Peter Rajnoha
460605cf71 Use 'killproc' fn in lvmetad init script (fn provided by 'functions' init script library). 2012-02-27 08:56:46 +00:00
Petr Rockai
c401303ca2 Fix a possible SEGV in lvmetad client code, and a minor leak in pvscan
--lvmetad.
2012-02-26 13:42:50 +00:00
Petr Rockai
9656be3deb A bit of documentation for lvmetad_vg_lookup. 2012-02-26 08:50:13 +00:00
Petr Rockai
e91a7700eb - Improve error reporting on lvmetad connection failure.
- Fix a couple of memory leaks in the lvmetad client code.
- Avoid an error in lvmetad_pv_gone when we aren't using lvmetad.
2012-02-26 08:49:40 +00:00
Petr Rockai
50730ddd96 Improve error handling & reporting in common daemon code. 2012-02-26 08:46:28 +00:00
Petr Rockai
7ce18df26b Add tentative documentation of pvscan --lvmetad to the pvscan manpage. 2012-02-26 08:45:07 +00:00
Peter Rajnoha
be5d2c75f3 Also remove intermediate lvmetad init script file. 2012-02-24 15:07:00 +00:00
Peter Rajnoha
dc7d369ad8 Use '-p PID_FILE' for the status call since the pidfile is in its own lvm subdir and return proper status code. 2012-02-24 13:45:37 +00:00
Peter Rajnoha
9a3497dcfa The daemon as well as the first scan must be both executed properly, otherwise it's an error! 2012-02-24 13:11:57 +00:00
Peter Rajnoha
88a898d6cf Add LVMetaD init script. 2012-02-24 13:03:50 +00:00
Peter Rajnoha
a80e4e0d1f Add skeleton for lvmetad udev rules - 69-dm-lvm-metad.rules.
Why using the order 69:

  - Storage processing in general happens in 60-persistent-storage.rules,
    including the blkid call that adds some usable information we can use
    for filtering and speedup (these rules are part of upstream udev and
    the order is preserved on most distros)

  - There's still some other storage-related processing done after
    60-persistent-storage.rules in general. These might add some detailed
    storage-related information we might use to filter devices effectively
    (e.g. MD udev rules, ...).

  - We need lvmetad rules to be processed before any consumers can use the
    output - so the metadata cache is ready soon enough (e.g. udisks rules).

  - There's no official (upstream udev) document about assigning the order,
    so this number is chosen in best belief it will suit all scenarios.
2012-02-24 09:53:12 +00:00
Petr Rockai
7bc76e9c20 Fix server-side leaks in lvmetad. 2012-02-24 00:24:37 +00:00
Petr Rockai
1336a1cbf1 Clean up the lvmetad state more thoroughly upon shutdown. 2012-02-24 00:11:59 +00:00
Petr Rockai
6295e3ef1e Fix an error path in daemon_open. 2012-02-24 00:02:54 +00:00
Petr Rockai
e8681b8d42 Make the calls to pvscan --lvmetad in the testsuite slightly more civilised. 2012-02-23 23:58:42 +00:00
Petr Rockai
ed5d30f075 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
75ac0b638c Limit sscanf params with size
Make sure parsed string fits given char buffer.
2012-02-23 22:50:50 +00:00
Zdenek Kabelac
e3a47a9370 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
c2915dd1ed 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
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
8411f22f43 Keep same sign for 's' counter 2012-02-23 22:36:56 +00:00
Zdenek Kabelac
33f24144bd 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
751e17f17b Add explicit cast for time() ret value
To keep all numbers with same sign
2012-02-23 22:31:23 +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
Zdenek Kabelac
19fde08c6a 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
b2edbee763 Remaing code suffling
Move declaration to the front of function to follow coding rules.
2012-02-23 22:23:12 +00:00
Zdenek Kabelac
1e59596393 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
7a502785b0 post-release 2012-02-23 18:26:28 +00:00
Alasdair Kergon
2a0264eb7d pre-release 2012-02-23 18:22:09 +00:00
Zdenek Kabelac
17829d245c Missed dm_free in last commit 2012-02-23 18:19:32 +00:00
Zdenek Kabelac
de61ffd1b5 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
0dd5bf2730 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
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
Petr Rockai
30cc37b645 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
9d206272a5 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
af8b3ace37 Kick out a debugging call to valgrind in lvmcache-exercise.sh. 2012-02-23 14:21:18 +00:00
Petr Rockai
4c10334843 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
165a28a8a5 We need daemons/common now even if the lvmetad server side is not built. 2012-02-23 13:41:11 +00:00
Peter Rajnoha
0c7a75df32 Remove the old systemd socket file, we're using the .in template now. 2012-02-23 13:39:08 +00:00
Peter Rajnoha
38c2ccf7b8 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
becb604089 Add -ldaemon to make.tmpl.in. 2012-02-23 13:31:01 +00:00
Petr Rockai
c6101ffc0c Missed update for include/.symlinks.in to include lvmetad.h. 2012-02-23 13:19:26 +00:00
Petr Rockai
002f7a0ce2 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
fa73b2ee3d Also use DEFAULT_RUN_DIR for the lvmetad socket on the client side. 2012-02-23 11:40:24 +00:00
Peter Rajnoha
8acbf570b5 Add LVMetaD systemd units. 2012-02-23 11:24:07 +00:00
Peter Rajnoha
40f111e9b9 Install lvm2 monitoring init script and systemd units only if dmeventd is built. 2012-02-23 11:13:18 +00:00
Peter Rajnoha
7e61f1ef44 Clean intermediate files. 2012-02-23 10:01:12 +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