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

1609 Commits

Author SHA1 Message Date
Zdenek Kabelac
73ef9a7eaa Log sys errors 2012-03-01 21:17:29 +00:00
Zdenek Kabelac
48073da2b8 Backtrace for failing drop_cached_metadata 2012-03-01 21:16:44 +00:00
Zdenek Kabelac
465fe71f6c Correct enum type
Using debug_t and some forgetten alloc_policy_t, force_t from past commit.
2012-03-01 21:14:43 +00:00
Zdenek Kabelac
0b60d3a05e Few more close and dev_close trace
Adding (void) where we cannot really report an error.
2012-03-01 21:12:37 +00:00
Alasdair Kergon
ba23f9e71f Reflect new file locations, include file updates etc. 2012-02-28 18:35:04 +00:00
Alasdair Kergon
b009e2235e Check return values after calling new lvmetad fns
(Haven't checked error path handling though)
2012-02-28 18:08:08 +00:00
Zdenek Kabelac
f2cbcb027e Using enum types for enums
alloc_policy_t, dm_string_mangling_t, percent_range_t, sign_t
2012-02-28 14:24:57 +00:00
Zdenek Kabelac
c3cb4bb872 Duplicate standard in/out descriptors for daemon
Addressing somewhat tricky bug here.
Since stdin,stdout,stderr were closed it's been occasionally possible to
see some unexpected messages to be flowing into a clvmd and generating some
randomly sized allocation of many megabytes. Since the message was not
being generated by standard send_message() construction, after some more
testing it apperead to be a debug log message - thus something has flown
to local socket opened on strandard out descriptor.

To fix the issue - use standard file descriptor duplication code for daemons.

For making easier debugging of polling daemon - developer might want to recompile
without modifition of standard file descriptors.
2012-02-28 10:06:53 +00:00
Zdenek Kabelac
125456bb3e Add some log_sys_errors to close() call 2012-02-27 11:28:47 +00:00
Zdenek Kabelac
b85b9ce4b7 Make force_t enum usage obvious 2012-02-27 10:06:58 +00:00
Zdenek Kabelac
61a6481305 Always check result of _set_vg_name() 2012-02-27 10:00:23 +00:00
Zdenek Kabelac
8411f22f43 Keep same sign for 's' counter 2012-02-23 22:36:56 +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
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
Jonathan Earl Brassow
3fc37a89e2 Allow 'lvconvert --repair' to operate on RAID 4/5/6.
The higher level RAIDs should be allowed for repair along with 'mirror' and
'raid1' segment types.
2012-02-22 17:18:49 +00:00
Jonathan Earl Brassow
16b40da2e7 Add some messages that indicate completion of RAID device replacement.
There were no messages printed upon completiion of RAID device replacement.
This could cause confusion/concern during automated recovery, because the
user sees the failure messages but no other messages indicating correction.
2012-02-22 16:03:55 +00:00
Jonathan Earl Brassow
65f96d99e5 Fix a bad return code in 'lvconvert_raid'
Functions at this level do return 0 or 1, not ECMD_* values.
2012-02-22 15:20:50 +00:00
Zdenek Kabelac
d6463f4890 Initialize dmeventd monitoring for every command
Read lvm.conf setting for monitoring for each command. So we should not
activate monitoring if the default compilation is set to monitor during
lvconvert commnads.

Patch also removes check for  clustered VG and allows to disable monitoring
for clustered VG with the assumption, the problem with monitoring and dmeventd
flag passing for INGNORE is already fixed.
2012-02-15 15:18:43 +00:00
Zdenek Kabelac
d11718e479 Simplify with dm_strdup 2012-02-15 14:27:53 +00:00
Peter Rajnoha
d7a47a354f Fix segfault in dmsetup when using table specification with --table.
Segfault introduced with the patch that added dm_free(_table) at the
end of dmsetup (in this release).
2012-02-15 14:20:59 +00:00
Petr Rockai
a872331404 Turn a warning to an error in vgreduce --removemissing, since we exit with a
failure status there.
2012-02-15 12:30:46 +00:00
Peter Rajnoha
7f024cf822 Add mangle command to dmsetup to provide renaming to correct mangled form. 2012-02-15 12:08:57 +00:00
Peter Rajnoha
f2e7993792 Add 'mangled_name' and 'unmangled_name' fields to dmsetup info -c -o. 2012-02-15 12:06:17 +00:00
Peter Rajnoha
5a923ff8ad Add --manglename option to dmsetup to select the name mangling mode. 2012-02-15 12:02:58 +00:00
Jonathan Earl Brassow
d6f91a013b Change confusing message that is printed when a RAID device fails.
s/Issue/Use/, otherwise it is easy to misread "Issue" as "Issuing" - causing
the user confusion as to whether the action was performed automatically or
whether they need to issue the command.
2012-02-13 18:38:36 +00:00
Jonathan Earl Brassow
7daa233e48 Fix possible NULL pointer dereferences when updating mirror log.
'_lv_update_log_type' takes a lvconvert_params argument so that it can pass
down the user's preference of 'region_size' and allocation_policy.  When
'mirror_remove_missing' was introduced (commit ID
95986e42a1) it didn't make sense to pass down
user preferences - so NULL was given instead.  While it may never happen in
practice, static analysis reveals that this argument could be dereferenced.
So, if the user preferences were not passed in, glean the necessary fields
from what is already set in the LV.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>

(Not updating WHATSNEW for this simple clean-up.)
2012-02-13 18:36:55 +00:00
Zdenek Kabelac
e975f85035 Handle all succefull values from open() 2012-02-13 12:07:51 +00:00
Zdenek Kabelac
c868f0ebf0 Ensure allocated device does not leak on error path
For unimplementd canonicalize_file_name set to NULL
2012-02-13 12:06:39 +00:00
Zdenek Kabelac
5a4638e22b Add internal error for unsupported code paths
Patch mainly helps static analyzers to better work with code paths
lvm code should never trigger.
2012-02-13 11:25:56 +00:00
Zdenek Kabelac
2833f81fb3 Add few missing allocation failures tests 2012-02-13 11:13:44 +00:00
Zdenek Kabelac
6890aea4ca Add free_orphan_vg
Move commod code to destroy orphan VG into free_orphan_vg() function.
Use orphan vgmem for creation of PV lists.
Remove some free_pv_fid() calls (FIXME: check all of them)
FIXME: Check whether we could merge release_vg back again for all VGs.
2012-02-13 11:03:59 +00:00
Petr Rockai
1a28df6bb4 Move lvmcache data structures behind an API (making the structures private to
lvmcache.c). No functional change.
2012-02-10 01:28:27 +00:00
Zdenek Kabelac
7ce534f911 Switch to return void
List delete cannot fail, so there is no reason to test for error.
2012-02-08 12:52:58 +00:00
Zdenek Kabelac
6bea32ccf2 Remove duplicate test
Tested condition has been already evaluated before
For strlen() code has already excluded <ID_LEN.
For repairing, already tested (!argc && !repairing) before.
2012-02-08 11:41:18 +00:00
Zdenek Kabelac
84facc4fa5 Replace snprintf with dm_snprintf
snprintf testing for negative is replaced with dm_snprintf where this
test really works.
Add missing test for result of dm_snprintf().
2012-02-08 11:40:02 +00:00
Zdenek Kabelac
7940545204 Remove unneeded assignments
Variables have (or will have) those values set.
2012-02-08 11:36:18 +00:00
Zdenek Kabelac
4443aa41cc Ensure strncpy() function always ends with '\0'
Since last character needs to be \0 for string,
pass buffer size smaller by 1 byte.
2012-02-08 11:05:04 +00:00
Zdenek Kabelac
24da0046d5 Set status for error path
Do not leave status unitialized, since in some cases, it's tested,
when the function returns error.
2012-02-08 10:56:17 +00:00
Alasdair Kergon
49fd0fef6b lp.pool may be (null) too 2012-02-01 01:54:20 +00:00
Zdenek Kabelac
808f1706c2 Cosmetic change use return macro with implicit stack 2012-01-25 22:38:40 +00:00
Zdenek Kabelac
a1f42a8e88 Set to a defined value vars used after error path
Static analyzer noticed this vars are used even when error is reported
back thus their state is undefined - set to 0 for this case.
2012-01-25 22:20:11 +00:00
Zdenek Kabelac
4343bc5e86 Limit alignment to 32bit values
to get the same behavior on 32/64 machines.
2012-01-25 21:52:53 +00:00
Mike Snitzer
27393d999c Allow removal of an invalid snapshot that was to be merged on next activation.
Don't allow a user to merge an invalid snapshot.
2012-01-20 22:03:48 +00:00
Mike Snitzer
c25ad6e873 Differentiate between snapshot status of "Invalid" and "Merge failed". 2012-01-20 22:02:04 +00:00
Zdenek Kabelac
8aa66458a3 Tiny cleanup
Just remove double braces from conditions when they are not really needed.
(So it doesn't look like an assignment and comparison).
2012-01-20 10:58:17 +00:00
Zdenek Kabelac
9fae965546 Thin updated support for thin pool percent
Support to check also for metadata percent
(By checking whether seg pointer is set)
2012-01-19 15:25:37 +00:00
Alasdair Kergon
5c9bebee8a Add dmsetup 'wipe_table' to replace table with one that uses error target. 2012-01-18 18:52:02 +00:00
Peter Rajnoha
8227bf45d1 Support different device name types on output of dmsetup deps, ls and info -c command.
Add 'blkdevname' and 'blkdevs_used' field to dmsetup info -c -o.
Add 'blkdevname' option to dmsetup ls --tree to see block device names.
Add '-o options' to dmsetup deps and ls to select device name type on output.
2012-01-11 12:46:19 +00:00
Zdenek Kabelac
7da3845926 Check for error code in _adjust_policy_params
If error is detected in _adjust_policy_params, break further command processing.
2012-01-09 12:31:52 +00:00
Zdenek Kabelac
51c8cf97af Support rounding of percentage upward
We want to keep this logic -
when LV is extend - extend the LV by at least given amount,
when LV is reduced - reduce the LV by at most given amount.

So for this the rounding needs to be used.
Current logic which seems to satisfy give rule is to round up all
extent values for LV resize upward except for values with '-' sign
that are round downward.

This patch also fixes the problem when  lvextend --use-polices tried
to extend LV the by i.e. 20% - but the resulting 20% were smaller
the extent size thus before this patch no extension happened.
2012-01-05 15:38:18 +00:00