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

5714 Commits

Author SHA1 Message Date
Zdenek Kabelac
67d0232816 Add missing check for allocation failure
Static analyzer discovered missing check.
2011-08-04 17:56:11 +00:00
Zdenek Kabelac
b43795c364 Remove unused inconsistent_seqno
Last usage was removed in Petr's commit related to VG mda repair fix
where relaxed check starts to ignore inconsistencies coming from
PVs that are marked MISSING - thus removing unused variable.
2011-08-04 15:18:10 +00:00
Zdenek Kabelac
9f6098f724 Add 'empty' command
Using empty command ';' here makes the code look nicer.
2011-08-04 14:54:48 +00:00
Zdenek Kabelac
46d6fcc99a Remove meaningless const type qualifiers on cast type
Static analyzis noticed we do not really need them - so removing.
2011-08-04 14:30:51 +00:00
Zdenek Kabelac
63fe43c2f9 Remove self assigment which has no effect
Just a tiny code cleanup found by analyzer.
2011-08-04 14:11:28 +00:00
Zdenek Kabelac
45e96ab875 Minor memory leak fix
Defer the test of the function return value after the string memory is released.
Otherwise in this error path the string would present memory leak.
(Thought in this case we are already out of memory...)
2011-08-04 12:40:24 +00:00
Zdenek Kabelac
65073ca838 Add test for fcntl error in singlenode client code.
Static analyzer noticed this check could be handy.
2011-08-04 12:13:50 +00:00
Zdenek Kabelac
96854e8d35 Remove --force option from lvrename manpage. 2011-08-04 10:14:42 +00:00
Zdenek Kabelac
ced0c8cbd6 Add missing new line in lvrename help text. 2011-08-04 10:12:44 +00:00
Jonathan Earl Brassow
01d49d0e71 Add basic RAID segment type(s) support.
Implementation described in doc/lvm2-raid.txt.

Basic support includes:
- ability to create RAID 1/4/5/6 arrays
- ability to delete RAID arrays
- ability to display RAID arrays
Notable missing features (not included in this patch):
- ability to clean-up/repair failures
- ability to convert RAID segment types
- ability to monitor RAID segment types
2011-08-02 22:07:20 +00:00
Peter Rajnoha
801a1b1352 Change DEFAULT_UDEV_SYNC to 1 so udev_sync is used even without any config.
This should be set by default! Normally we have "activation/udev_sync = 1"
in lvm.conf (example.conf.in). But if we use lvm2 without any config file
(or without a definition within '--config' option) the DEFAULT_UDEV_SYNC
is used instead. Together with verify_udev_operations=0 (when we rely on
udev fully), this can cause races as the node could be missing when needed.

(See also https://bugzilla.redhat.com/show_bug.cgi?id=723144)
2011-08-02 10:49:57 +00:00
Peter Rajnoha
b4c05c8519 Add support for systemd file descriptor handover in dmeventd.
Systemd preloads file descriptors for us and passes them in for
newly spawned daemon when using on-demand fifo (or socket)
based activation.

This patch adds checks for file descriptors preloaded by
systemd and uses them instead of opening the FIFOs again
to properly support on-demand FIFO-based activation.

(We'll change FIFOs to sockets soon - but still this
part of the code will stay almost the same.)
2011-07-28 13:06:50 +00:00
Peter Rajnoha
9482fdae35 Add support for new oom killer adjustment interface (oom_score_adj).
The filename to adjust the oom score was changed in 2.6.36.
We should use oom_score_adj instead of oom_adj (which is still
there under /proc, but it's scheduled for removal in August 2012).

New oom_score_adj uses a range from -1000 (OOM_SCORE_ADJ_MIN,
disable oom killing) to 1000 (OOM_SCORE_ADJ_MAX).
2011-07-28 13:03:37 +00:00
Peter Rajnoha
63019dc656 autoreconf 2011-07-28 12:59:44 +00:00
Peter Rajnoha
c3f5210734 Configure and makefile changes for newly added systemd unit files. 2011-07-28 12:57:26 +00:00
Peter Rajnoha
5c4c36b135 Add systemd unit files for dmeventd. 2011-07-28 12:54:28 +00:00
Petr Rockai
4b20b480b1 lvmetad: Edit the MISSING_PV flags only after making a "reply" copy of the
metadata, which is then serialised and discarded. This fixes a couple of
outstanding TODO items about handling the MISSING flags correctly.
2011-07-25 17:59:50 +00:00
Petr Rockai
0574adcaa1 lvmetad: Check integrity of multiple metadata copies, i.e. ensure that seqno
equality implies metadata equality. Signal error in response to any update
requests that try to overwrite metadata without providing a higher seqno.
2011-07-25 15:51:51 +00:00
Petr Rockai
c33c147c9b lvmetad: A couple of TODOs, and fix a few trivial memory leaks. 2011-07-25 15:33:04 +00:00
Zdenek Kabelac
95dd4eae53 Add simple test for read-only table reload suppression
Just a small test for previous libdm commit.
2011-07-25 08:41:52 +00:00
Alasdair Kergon
f2bf7a1cc0 Fix read-only identical table reload supression. 2011-07-24 23:59:03 +00:00
Zdenek Kabelac
a2146d6548 Compare also file size to detect changed config file
Clvmd detects modifed config file before it takes lv_lock.
If the config file is changed rapidly - the change was ignored within
a seocnd ranged.  This patch adds also compare of file size.
So change like some flag for 0 to 1 would pass unnoticed - but
it's quick fix for failing test suite.

FIXME: Implement inotify solution.
2011-07-21 13:23:48 +00:00
Petr Rockai
3082fa5d4c lvmetad: Obliterate vg_status by returning the same information from
update_pv_status, saving a dozen lines of code and execution time of one
walkthrough of the PV list.
2011-07-20 21:33:41 +00:00
Petr Rockai
7d6fed35c0 lvmetad: Fix a possible infinite loop in vg_status. 2011-07-20 21:27:28 +00:00
Petr Rockai
81535db537 lvmetad: Robustify update_pv_status and remove an useless lookup. 2011-07-20 21:26:18 +00:00
Petr Rockai
b33c9d313f First stab at making lvmetad-core threadsafe. The current design should allow
very reasonable amount of parallel access, although the hash tables may become
a point of contention under heavy loads. Nevertheless, there should be orders
of magnitude less contention on the hash table locks than we currently have on
block device scanning.
2011-07-20 21:23:43 +00:00
Petr Rockai
503190e499 lvmetad: Avoid stale PV -> VG mappings on metadata update. 2011-07-20 18:45:32 +00:00
Petr Rockai
fdbde27ed9 Optimise PV -> VG lookups by using a UUID (hash) map. 2011-07-20 18:34:57 +00:00
Petr Rockai
54350d68ce Free up allocated memory before exiting, in lvmetad. 2011-07-20 18:24:49 +00:00
Petr Rockai
f342b6a862 Fix two small (but eventually unbounded) leaks in daemon-server.c. 2011-07-20 18:23:33 +00:00
Petr Rockai
28b6842556 Can't have a global memory pool in lvmetad (that would constitute an ongoing
memory leak) => remove it (it's been unused anyway).
2011-07-20 16:49:21 +00:00
Petr Rockai
ecb4ee0b5a Make lvmetad also report VGID in reply when adding a PV without MDAs (this
obviously only works for VGs that already had at least some MDA discovered).
2011-07-20 16:46:40 +00:00
Petr Rockai
05e87b6b65 Add code to lvmetad's testclient that scans an actual physical device,
effectively emulating a future "pvscan --lvmetad" command.
2011-07-20 15:15:41 +00:00
Petr Rockai
9f228ea974 Make lvmetad report the VG ID and status (complete, partial) in reply to pv_add
requests.
2011-07-20 15:14:17 +00:00
Petr Rockai
e36cd89437 Towards MISSING (PV) flag management in lvmetad. 2011-07-19 19:15:22 +00:00
Petr Rockai
d8f02da1e4 Make it possible to represent type-correct single-item arrays in config trees. 2011-07-19 19:12:38 +00:00
Petr Rockai
789ed50712 Add an API to config.h for creating values in the config_tree mempool. 2011-07-19 19:11:24 +00:00
Petr Rockai
df4758d73b Work out some more details in metadata update in lvmetad. 2011-07-19 16:48:13 +00:00
Jonathan Earl Brassow
8cccdb25a9 Remove and unneeded parameter from build_parallel_areas_from_lv() 2011-07-19 16:37:42 +00:00
Jonathan Earl Brassow
e1154dd09e Fix potential null ptr deref in 'origin_from_cow'
return NULL rather than segfaulting if lv->snapshot is not set
2011-07-19 16:23:52 +00:00
Petr Rockai
8e5d1c93eb More work on cache maintenance code in lvmetad: keep track of PV status. 2011-07-19 14:13:59 +00:00
Petr Rockai
f20e649ad1 Start filling in the core LVMetaD functionality and the corresponding
testclient bits.
2011-07-18 14:48:30 +00:00
Petr Rockai
8e72b3d6d6 Various improvements to the daemon-common code, including automated response
formatting from config trees provided by the daemon implementation.
2011-07-18 14:46:54 +00:00
Petr Rockai
8970d1b895 Improve format_buffer in daemon-shared.c, adding block formatting in addition
to string/integer (this propagates to the *simple* family of request/response
functionality).
2011-07-18 14:42:44 +00:00
Petr Rockai
056828e039 Revert the #include changes. Need to fix this at the #include site for now, and
eventually refactor the way we structure #includes in the all of the library.
2011-07-18 14:34:33 +00:00
Petr Rockai
8e1761a804 Slightly refactor the config code to allow better reuse (no functional change). 2011-07-18 13:26:08 +00:00
Petr Rockai
4ac59193ee Add a missing libdevmapper.h #include to lvm-types.h (for dm_list). 2011-07-18 13:24:48 +00:00
Petr Rockai
668f986b05 Add a couple missing #includes in uuid.h. 2011-07-18 13:24:14 +00:00
Zdenek Kabelac
2d812dea99 Better version of failing 'should' test
where the naming is left completely on lvm.
(Commited code has been different version of test).
So here it should be able to figure out new free name and create a new LV.
2011-07-18 12:12:41 +00:00
Zdenek Kabelac
e0c9b24a6d Adding test for repair when confusing metadata are found 2011-07-18 12:04:42 +00:00