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

5171 Commits

Author SHA1 Message Date
Zdenek Kabelac
262ff6e9d3 Fix include commit and switch to use DISTCLEAN_TARGETS
Fixing warning introduced by 'include make.tmpl' commit.
Produced this warning:

Makefile:29: warning: overriding commands for target `distclean'
../make.tmpl:366: warning: ignoring old commands for target `distclean'
2010-11-08 14:19:48 +00:00
Peter Rajnoha
968c382706 Clarify error messages when activation fails due to activation filter use. 2010-11-05 18:18:11 +00:00
Zdenek Kabelac
d99a0313a7 Add OCF support
Updated patch from Florian Haas from Linux-HA project.

User needs to 'configure --enable-ocf' to get file installed
by 'make install' target by default.
User can also use 'make install_ocf' to get only ocf files installed.
With disabled (default) ocf support - no ocf files are installed.

FIXME: ocf installation path needs to be kept in sync with pacemaker.
find better way and possible also better location.
2010-11-05 16:18:38 +00:00
Zdenek Kabelac
ad2a90ccc6 Add given user prefix to make target install_initscripts
Avoid files to be written into the live system if lvm was
configured with different --prefix.

Use initdir for install target path.
2010-11-05 16:13:18 +00:00
Zdenek Kabelac
64013278fb Use include make.tmpl
Makes easier to use recursive targets and simplifies Makefile.
2010-11-05 16:10:08 +00:00
Alasdair Kergon
86a974c3c3 lost line 2010-11-02 20:10:35 +00:00
Alasdair Kergon
f56361e29f Fix regex optimiser not to ignore RHS of OR nodes in _find_leftmost_common. 2010-11-02 19:56:33 +00:00
Zdenek Kabelac
b53badf298 Use new status code from fsadm check
Patch updates exec_cmd() and adds 3rd parameter with pointer for
status value, so caller might examine returned status code.
If the passed pointer is NULL, behavior is unmodified.

Patch allows to confinue with lvresize if the failure from fsadm check is
caused by mounted filesystem as many of filesystem resize tools do support
online filesystem resize. (originally user had to use flag '-n' to bypass
this filesystem check)
2010-11-01 14:17:35 +00:00
Zdenek Kabelac
93bd371b57 Add DIAGNOSTICS section to fsadm man page. 2010-11-01 14:10:46 +00:00
Zdenek Kabelac
3bb9c8e43e Return different status code for fsadm check of mounted filesystem
Return status code 3 for fsadm check of mounted filesystem - used later with
lvresize update patch to better support online filesystem resize.

Also makes a more consistent user interruption and returns status code 2
in this case.
2010-11-01 14:08:51 +00:00
Peter Rajnoha
09c6b90d76 Use dm_strdup/dm_free instead of strdup/free. 2010-11-01 13:50:51 +00:00
Peter Rajnoha
032a206a83 Allocate buffer for reporting functions dynamically to support long outputs.
Fix memory leak of field_id in _output_field function.

There's been a patch added recently to use dynamic allocation for metadata
tags buffer to remove the 4k limit (for writing metadata out). However, when
using reporting commands like vgs and lvs, we still need to fix libdm reporting
functions themselves to support such long outputs. So the buffer used in those
reporting functions is dynamic now.

The patch also includes a fix for field_id memory leak which was found in
the _output_field function.
2010-11-01 13:31:55 +00:00
Alasdair Kergon
735d51276c Update VG metadata only once in vgchange when making multiple changes.
Allow independent vgchange arguments to be used together.
(Still more inconsistencies to iron out here.)
2010-10-29 21:15:23 +00:00
Petr Rockai
bc91078978 Update WHATS_NEW. 2010-10-29 16:44:47 +00:00
Petr Rockai
8179a2dc9c Add code to the dmeventd snapshot plugin to automatically unmount snapshots
that have been invalidated.
2010-10-29 16:43:51 +00:00
Petr Rockai
ab98a1c5dc Alasdair correctly pointed out that if the two closes are concurrent (I haven't
checked, so they *might*), there is still a race possibility with the last
fix. This patch fixes that.
2010-10-27 11:40:14 +00:00
Petr Rockai
d9f958852c Add a missed test for dmeventd -R. 2010-10-27 09:16:31 +00:00
Petr Rockai
27b0895f6d Update WHATS_NEW. 2010-10-27 09:15:48 +00:00
Petr Rockai
fec4084b90 Fix a double close in clvmd.
The management threads (main_loop, the socket thread) could close a single fd
twice in a row sometimes. At least one other thread can be running at the same
time as the threads doing the double close. That one running thread also
happens to do some IO (namely, open /proc/devices, read from it, close it). If
there was enough "demand" for the local socket, this could happen:

- a connection to clvmd is about to finish, let's say the fd is 13 (it often
  happens to be in my test script, don't ask why)
- the local_sock thread calls close(13)
- the lvm thread calls open("/proc/devices"...) and gets 13
- the main_loop thread calls close(13) [OOPS!]
- new connection arrives, and is accept'd by a (new) local_sock thread
- the accept gives an fd of 13 (since it's the lowest free fd at this point)
- the lvm thread gets around to read from it's /proc/devices handle... 13,
  again
- the lvm thread hangs forever trying to read from the socket instead of
  /proc/devices

Signed-off-by: Petr Rockai <prockai@redhat.com>
Reviewed-by: Milan Broz <mbroz@redhat.com>
2010-10-27 09:13:37 +00:00
Petr Rockai
9a9d7c1c55 Use a more generous timeout for dmeventd in t-lvconvert-repair-dmeventd. 2010-10-26 12:53:07 +00:00
Petr Rockai
0f287ed3dd Let's rely on the exit code and do not test for empty output. 2010-10-26 12:52:25 +00:00
Zdenek Kabelac
cf048beade Add missing return for NULL passed buffer
Function pull_stateo() checks for NULL 'buf' - but return for this error
path was missing.  cmirror code never calls this function with NULL 'buf',
so this fix has no effect on current code base, but makes clang happier.
2010-10-26 10:14:41 +00:00
Zdenek Kabelac
558c22a454 Macro uninitialized_var gives warnings in static analysis
Deactivate uninitialized_var() macro for clang static analysis.
2010-10-26 10:04:34 +00:00
Zdenek Kabelac
683f33139e Hotfix usage of __builtin_unreachable()
It's quite new feature which is not supported by older compilers.
So until some better macros are introduced into LVM code - hotfix current
compilation problems and compile this code only for __clang__ defining compilers.
2010-10-26 09:57:03 +00:00
Zdenek Kabelac
810abed9ea Fix NULL pointer dereference for too large MDA error path
Replace dereference of NULL vg with passed vgname to the function
_vg_read_raw_area() in the error path for too large MDA.
2010-10-26 09:13:13 +00:00
Zdenek Kabelac
9bd893bbc7 Instrument compiler about code unreachability
Clang needs some instrumentation help for static code analysis.
It helps gcc and human reader as well.
2010-10-26 09:01:47 +00:00
Zdenek Kabelac
abf79b3678 Use static indentifier for internal functions
Functions _align_chunk() and  _new_chunk() are used only internally inside
pool-fast.c - so keep them static inside this object file.
2010-10-26 08:59:05 +00:00
Zdenek Kabelac
290d1d8c3f Update C declaration () -> (void) 2010-10-26 08:54:37 +00:00
Zdenek Kabelac
f1ec47e131 Remove bufused for calculation
As bufused is assigned 0 in preceding source line
clang Idempotent operation
2010-10-26 08:53:25 +00:00
Mike Snitzer
0e36229da2 Fix vgchange to process -a, --refresh, --monitor and --poll like lvchange.
Simultaneous -a and --refresh is not valid.
poll+monitor are valid together with or without -ay* (but not with -an*)

No longer print polling results summary if no LVs in the VG were polled.
2010-10-26 01:37:59 +00:00
Mike Snitzer
5d5d6e4d4a Explicitly have grep print the matching filenames (needed to
successfully determine scsi_debug device).
2010-10-26 01:25:46 +00:00
Dave Wysochanski
543f8e8cca Update WHATS_NEW for lvm2app property functions 2010-10-25 17:33:51 +00:00
Alasdair Kergon
d5f5a46b33 post-release 2010-10-25 16:38:20 +00:00
Dave Wysochanski
ac146fc759 Add interactive tests for lvm_{pv|vg|lv}_get_property(). 2010-10-25 14:09:19 +00:00
Dave Wysochanski
5b5c981c13 Add lvm_lv_get_property() generic function to obtain value of any lv propert
Add a generic LV property function to lvm2app, similar to VG function.
Return lvm_property_value and require caller to check 'is_valid' flag
and lvm_errno() for API error.
2010-10-25 14:09:08 +00:00
Dave Wysochanski
fbe2b85f22 Add lvm_pv_get_property() generic function to obtain value of any pv property.
Add a generic PV property function to lvm2app, similar to VG function.
Return lvm_property_value and require caller to check 'is_valid' flag
before using the value.  If 'is_valid' is not set, then lvm_errno()
should be used to obtain the specific error.
2010-10-25 14:08:55 +00:00
Dave Wysochanski
377a39fcaf Add lvm_vg_get_property() generic vg property function.
Add a generic VG property function to lvm2app.  Call the internal library
vg_get_property() function.  Strings are dup'd internally.
Rework lvm_vg_get_property to return lvm_property_value and require caller
to check 'is_valid' flag.  If !is_valid, the caller can check lvm_errno()
for the specific error.

Create a 'get_property' function, local to lvm2app, that factors out
most of the common code that copies the components of lvm_property_type
into lvm_property_value.  This allows for a 1-line function for each
of the generic property functions exported by lvm2app.
2010-10-25 14:08:43 +00:00
Dave Wysochanski
6674b9a66f Add 'is_integer' flag into internal lvm_property_type.
Add 'is_integer' flag similar to 'is_string'.
Suggested in review by Petr Rockai.
2010-10-25 14:08:32 +00:00
Alasdair Kergon
73ac1ba150 pre-release 2010-10-25 13:54:29 +00:00
Zdenek Kabelac
fa3bfb017b Use const config node 2010-10-25 13:38:11 +00:00
Zdenek Kabelac
c755772a23 Fix constness warning
Fix usage of const 'data' pointer and also assign void* directly without
uneeded cast for C.
2010-10-25 13:36:57 +00:00
Zdenek Kabelac
441a1d7ee2 Fix constness warning
Keep using const pointers.
2010-10-25 13:36:09 +00:00
Zdenek Kabelac
f6318121f4 Fix constness warning for _vg_read_by_vgid() uuid usage 2010-10-25 13:35:13 +00:00
Zdenek Kabelac
88943533dd Fix constness warnings
After update of device_from_pvid() API fix constness warnings
Also fix info_from_pvid() constness warning for char* usage.
2010-10-25 13:33:42 +00:00
Zdenek Kabelac
fba05d7ba1 Use const pointer for return value of dm_basename
Fix return pointer to const as it is created from passed input const pointer.
2010-10-25 13:13:53 +00:00
Zdenek Kabelac
d302389b9f ok this seems to be never ending story... 2010-10-25 13:10:13 +00:00
Zdenek Kabelac
14ccfd53b5 rom -> from 2010-10-25 13:04:23 +00:00
Zdenek Kabelac
e0256ba49a Use 'const' struct id *pvid for device_from_pvid()
Update interface for device_from_pvid and use const pointer.
2010-10-25 13:02:26 +00:00
Zdenek Kabelac
22f922671e Switch to char* arithmetic from void* 2010-10-25 13:00:35 +00:00
Zdenek Kabelac
589f03e91a Fix missing initilisation to 0
Add missing init value for variable 'found' which is later tested and may
have contained some garbage value.
2010-10-25 12:59:24 +00:00