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

6807 Commits

Author SHA1 Message Date
Zdenek Kabelac
faf8ad30f1 Just code move of hash initialization in front of function
Make sure both hash tables are initialized before _read_sections() call.
Presents no functional change (since PV scan phase was not adding LV hashes),
but makes the code easier to handle mem failing case, and static analyzer is
hapier as well.
2012-02-27 11:40:58 +00:00
Zdenek Kabelac
4960a3c7f3 Add stack traces for lock_vol failures
Adding at least stack traces with some FIXMEs for cases,
where we might want to do something cleaver - maybe fail command
or give user hints something is not going well ?

For remote_backup is stack probably 'good' enough for now.
2012-02-27 11:35:59 +00:00
Zdenek Kabelac
3b45ebe86b Check id_write_format result
Currently we never fail with 64byte uuid buffer,
but just stay consitent with rest of the code and check for result.
2012-02-27 11:32:48 +00:00
Zdenek Kabelac
d7bb0d77aa Explicitely ignore fail error on hash_insert
We cannot do anything better here anyway - we are already in logging function,
so just ignore this issue here - it will most likely stop application later.
2012-02-27 11:31:30 +00:00
Zdenek Kabelac
125456bb3e Add some log_sys_errors to close() call 2012-02-27 11:28:47 +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
Peter Rajnoha
7ed9336202 Systemd is linux-specific - move the supporting code under the 'ifdef linux'.
Some 'defines' used in this specific code were already under an ifdef so this
patch just completes it.
2012-02-27 11:13:51 +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
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
90f31fc31c A bit more safe version of sprintf
Use just buffer size limit (it's used for debug only)
2012-02-27 10:17:06 +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
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
Zdenek Kabelac
b85b9ce4b7 Make force_t enum usage obvious 2012-02-27 10:06:58 +00:00
Zdenek Kabelac
edb0de6539 Test result of _init_tags. 2012-02-27 10:05:35 +00:00
Zdenek Kabelac
1b197085b3 Explicitely ignore result from sync_unlock()
Make it obvious to analyzer - we can't do anything better here anyway.
2012-02-27 10:02:17 +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
9b0c352a57 Remove test for pvid
Since pvid is char buffer[] and not pointer,
there is no point to check it for NULL.
2012-02-27 09:54:25 +00:00
Zdenek Kabelac
c1a04f0fe3 Ignore result of unlock explicitely 2012-02-27 09:52:37 +00:00
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