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

65 Commits

Author SHA1 Message Date
Zdenek Kabelac
4dd8a94a20 Add fixmes
There is missing some proper reaction when update fails ?
2012-03-23 10:34:51 +00:00
Zdenek Kabelac
963ccfd981 Always free hash table
also in error path
2012-03-23 10:33:26 +00:00
Alasdair Kergon
598134b8e7 Pass struct device around internally rather than dev_t.
Add 3rd daemon return state "unknown" for lookups that are carried out
successfully but don't find the item requested.
Avoid issuing error messages when it's expected that a device that's
being looked up in lvmetad might not be there.
2012-03-02 20:46:36 +00:00
Zdenek Kabelac
526655301e Check allocated pointers
Test pointers from allocation against NULL.
Error paths should be checked, some of them probably need
some extesions.
2012-03-01 22:52:59 +00:00
Alasdair Kergon
ba23f9e71f Reflect new file locations, include file updates etc. 2012-02-28 18:35:04 +00:00
Zdenek Kabelac
6ddd3f5d4c Add assert for oldname
Code cannot proceed if oldname would be NULL.
Since lvmetad currently doesn't use logging mechanism of lvm to report
internal errors - stay with current code style of lvmetad which uses
plain asserts for cases like this.
2012-02-27 10:19:00 +00:00
Zdenek Kabelac
e2b77ed33c Move allocation after check for vgid
so there is no mem leak on this error path.
Also actually check if the hash exists.
2012-02-27 10:10:43 +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
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
0dd5bf2730 Some reformating for lvmetad uddates
cleanup gcc warning,
use PRIu64
header cleanups
const pointer fixes.
2012-02-23 17:59:32 +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
Petr Rockai
b1e320e5c4 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
Petr Rockai
b0fe3642c8 Drop the now-redundant pvid_to_status hash. 2012-02-15 17:37:09 +00:00
Petr Rockai
a0289c969f 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
Petr Rockai
351c6b96b8 (lvmetad) Remove unused variable. 2012-02-15 14:15:50 +00:00
Petr Rockai
cc3552f4a8 In lvmetad, also nuke VGs when all their PVs are stolen by another VG (vgmerge
& vgsplit do this).
2012-02-15 14:06:48 +00:00
Petr Rockai
4ec2657ac3 lvmetad server-side update:
- rename the hashes to be explicit about the mapping
- add VG/PV listing calls to the protocol
- cache slightly more of the per-PV state
- filter cached metadata
- compare the metadata upon metadata_update
2012-02-15 11:43:06 +00:00
Zdenek Kabelac
2b62c3ed69 Add some FIXME around allocation code
Remove also unreachable break..
2012-02-13 14:25:14 +00:00
Zdenek Kabelac
e152c0b9e6 Add breaks for cases 2012-01-25 21:42:09 +00:00
Zdenek Kabelac
93903e1edf Clean var declarations to the front of the function 2012-01-25 13:06:57 +00:00
Petr Rockai
693e6e76a9 Beef up the lvmetad code with more functionality and a bunch of bugfixes. There
used to be a few mis-ordered memory accesses (release and access in the next
block). Fix that set_flag could have sometimes corrupted the flags being
modified.

A few issues with metadata tracking are sorted out as well now, and there are
only a few problems remaining before we can integrate lvmetad, mostly on the
client side:

- metadata areas need to be tracked in lvmetad (most likely to be addressed
  through an extension of metadata, meaning no special support in lvmetad would
  be needed)
- non-udev scanning code needs to be taught about telling lvmetad about device
  disappearance (pvscan most importantly)
- this last item also needs to mesh with metadata inconsistencies and
  suddenly-incomplete volume groups (aux disable_dev in tests); udev-based
  scanning should address this separately and more elegantly
2012-01-16 08:25:32 +00:00
Petr Rockai
27949793ae Fix up lvmetad for the minor API change in dm_config_create. 2011-12-18 22:31:10 +00:00
Alasdair Kergon
721119a388 Only use built-in stack size in clvmd - ignore lvm.conf. 2011-12-08 21:24:08 +00:00
Zdenek Kabelac
9c5039d3e1 Cleanup for lvmetad passing uninit structure
Shown by clang analyzer.
2011-10-30 21:58:59 +00:00
Zdenek Kabelac
48b9cbab24 Use Makefile for daemmons/common library.
Next iteration for better fit of lvmetad compilation.

Move build of libdaemon.a into common subdir Makefile.
libdaemon.a is device-mapper target.

Build and install lvmetad as lvm2 target.
2011-09-24 20:57:49 +00:00
Zdenek Kabelac
fa6b41848e Few more updates to lvmetad build deps
It seem lvmetad deps must be expressed after the include.
Also adding lvmetad deps to device-mapper target in daemons dir.
2011-09-19 00:29:11 +00:00
Zdenek Kabelac
48f57c1cf0 Build fixes for lvmetad
Should now be giving better build order and install lvmetad.
2011-09-17 14:50:22 +00:00
Zdenek Kabelac
77bc50144c Fix for gcc compilation warnings
and put _XOPEN_SOURCE so pthread_mutexattr is properly defined.
2011-09-17 13:33:51 +00:00
Zdenek Kabelac
ccc01ce94b Compile fix
Reflecting change in dm_config_value  float r -> float f.
2011-09-02 11:04:12 +00:00
Petr Rockai
dbe351860e Fix warnings and constness handling in lvmetad-core (adjusting the
dm_config_find_node to give non-const node pointer, since that better reflects
the contract of that function).
2011-08-31 12:39:58 +00:00
Petr Rockai
2254b74598 Get rid of the old lvmetad Makefile. 2011-08-31 11:44:27 +00:00
Petr Rockai
c4d973530f A compromise integration of LVMetaD into the build: I have kept all the
daemon/common code in a single libdaemon.a, which is completely private. This
is currently linked into the lvmetad binary, and will be linked into LVM (the
client part, since static linking only picks up only symbols that are actually
used). I have also added --enable/disable-lvmetad to ./configure; although the
current default is off, I expect this to be flipped to on shortly. There's no
LVM-side support yet, but when there is, even when built, it'll still need to
be enabled by an lvm.conf option.
2011-08-31 11:31:57 +00:00
Petr Rockai
51e1300519 Adapt LVMetaD to use the new dm_config interfaces. 2011-08-30 15:44:01 +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
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
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