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

526 Commits

Author SHA1 Message Date
Zdenek Kabelac
6298758992 Add dm_config_find_str_allow_empty
Support empty string values.
2011-12-21 12:47:44 +00:00
Peter Rajnoha
999263f18d Fix lvm2-monitor init script to use normalized output when using vgs. 2011-12-07 12:29:41 +00:00
Zdenek Kabelac
108cfe0b0b Check target type name for DM_MAX_TYPE_NAME length
Avoid creation of target type name when it's longer then
DM_MAX_TYPE_NAME (noticed by static analyzer where the
sp.target_type might be missing '\0' at the end.)

Before patch:

$> dmsetup create long
0 1000 looooooooooooooooooooooooooong
^D
device-mapper: reload ioctl failed: Invalid argument

After patch:

$> dmsetup create xxx
0 1000 looooooooooooooooooooooooooong
Target type name looooooooooooooooooooooooooong is too long.
Command failed
2011-11-18 19:34:02 +00:00
Alasdair Kergon
dddf30e354 Include a copy of kernel DM documentation in doc/kernel 2011-11-15 13:54:20 +00:00
Zdenek Kabelac
eb668d8981 Update dmsetup man page
Use standard manpage style.
Keep options and commands in alphabetic order.
Added at least a very simply info about some other targets.
TODO: documenting targest needs far more work...
2011-11-12 22:48:44 +00:00
Mike Snitzer
d25d6d456f Fix _get_proc_number to be tolerant of malformed /proc/misc entries.
Fixes issue reported here: http://lkml.org/lkml/2011/11/8/190
2011-11-08 17:32:10 +00:00
Peter Rajnoha
2d603339f1 Add "ExecReload" to dm-event.service for systemd to reload dmeventd properly.
Normally, restart simply means "stop and start" for systemd. However, if
we're installing new versions of the dmeventd binary/libdevmapper, we need
to restart dmeventd. This fails if we have some devices monitored - we need
to call "dmeventd -R" instead.

The "ExecReload" did not work quite well in some old versions of systemd,
systemd assumed that only the configuration is reloaded on "ExecReload",
not the whole binary itself so it lost track of dmeventd daemon (it lost new
dmeventd PID). This is fixed and seems to be working fine now with recent
versions of dmeventd.
2011-10-31 12:22:49 +00:00
Zdenek Kabelac
f542af20e2 Add find_config_tree_str_allow_empty
Add function to allow read of empty strings as valid arguments.
Add a warning message if string argument has ignored value.
2011-10-28 20:06:49 +00:00
Zdenek Kabelac
48d03bb158 Fix usage of DEBUG_ENFORCE_POOL_LOCKING with DEBUG_MEM
Since DEBUG_MEM is storing own extra structure within returned memory chunk,
glibc free must be used directly for posix_memaling() allocated block.
2011-10-23 15:38:02 +00:00
Zdenek Kabelac
9709a27cb6 Aling structure chunk on default aling size
Since we use 8 bytes by default for the pool allocation,
keep the structure aligned with this size.
(Somehow it was not applied in previous commit.)
2011-10-20 14:43:33 +00:00
Zdenek Kabelac
04275a672a Mark chunk memory for free as defined again for valgrind
When DEBUG_MEM is used, the memory is trashed with extra pattern before real
free() is called, and as this memory was marked as non accessible when used with
valgrind, make it again usable.
2011-10-20 13:39:57 +00:00
Zdenek Kabelac
9c1f0f4aef Aling structure chunk on default aling size
Since we use 8 bytes by default for the pool allocation,
keep the structure aligned with this size.
2011-10-20 13:36:13 +00:00
Zdenek Kabelac
45e1399532 Simplify some pointer operations 2011-10-20 13:33:41 +00:00
Zdenek Kabelac
ed6d3763da Remove unused file from tree 2011-10-20 13:23:52 +00:00
Zdenek Kabelac
887c9834bb Cleanup backtraces
Make sure stacks are at the right places when something goes wrong here.
2011-10-20 10:38:04 +00:00
Milan Broz
c752c23d33 Fix alignment warning in bitcount calculation for raid segment. 2011-10-17 13:15:35 +00:00
Zdenek Kabelac
54e43fd3de Use pool for dm_tree allocation
Using the same pool allocation strategy as we use for vg,
so dm_tree structure is part of the pool itself.
2011-10-14 13:34:19 +00:00
Zdenek Kabelac
f8b4957694 Update error path tracing for _resume_node
dm_task_create & dm_task_set_name produces it's own log_error
Add missing stacks for dm_task_set_cookie, dm_task_run,
dm_task_get_info.
2011-10-03 18:28:25 +00:00
Zdenek Kabelac
222bbab442 Add supporting function for thinp
New dm_tree_node_add_thin_pool_target() and  dm_tree_node_add_thin_target()
This API is highly experimental and unstable for now.
2011-09-29 08:53:48 +00:00
Zdenek Kabelac
4da6e11c5a Use NULL for pointers 2011-09-25 19:38:59 +00:00
Zdenek Kabelac
d00941c9a4 Update dmsetup man page
While dmsetup command properly shows all dmsetup resume supported options,
man page missed to document it.
2011-09-23 09:51:37 +00:00
Zdenek Kabelac
373b717a5f Build all man pages
When running plain 'make' in man dir - do also those for device-mapper target.
2011-09-23 09:48:21 +00:00
Peter Rajnoha
3157f8e8fa Add dm_tree_retry_remove to use retry logic for device removal in a dm_tree. 2011-09-22 17:36:50 +00:00
Peter Rajnoha
def057522f Add dm_device_has_holders fn to to check use of the device by another device.
Add dm_device_has_mounted_fs fn to check mounted filesystem on a device.

This requires sysfs directory to be correctly set via dm_set_sysfs_dir
(/sys by default). If sysfs dir is not used or it's set incorrectly,
dm_device_has_{holders,mounted_fs} will return 0!
2011-09-22 17:23:35 +00:00
Peter Rajnoha
1f92ab6e8a Add dm_set_sysfs_dir to libdevmapper to set sysfs location.
Add dm_sysfs_dir to libdevmapper to retrieve sysfs location thas is set.
2011-09-22 17:17:07 +00:00
Peter Rajnoha
2f64783850 Add --retry option for dmsetup remove to retry removal if not successful. 2011-09-22 17:12:28 +00:00
Peter Rajnoha
6b1629455a Add dm_task_retry_remove fn to use retry logic for device removal.
This call ensures that the dm device removal is retried several
times before failing.
2011-09-22 17:09:48 +00:00
Peter Rajnoha
40a234183c Retry DM_DEVICE_REMOVE ioctl if device is busy.
This is a workaround for long-lasting problem with using the WATCH udev
rule. When trying to remove a DM device, this one can still be opened
while processing the event in parallel (generated based on the WATCH
udev rule).

Let's use this until we have a proper solution.
2011-09-13 15:13:41 +00:00
Zdenek Kabelac
83ca5e6d5c Remove unused passed parameters 2011-09-07 08:37:48 +00:00
Alasdair Kergon
c147bbddb3 Comments, FIXMEs, name changes. 2011-09-01 21:04:14 +00:00
Zdenek Kabelac
fa784f6198 Mark unreleased memory pools as internal error 2011-09-01 10:19:01 +00:00
Alasdair Kergon
4c503ee2a6 post-release 2011-08-19 19:42:39 +00:00
Alasdair Kergon
ab52d127bb pre-release 2011-08-19 16:31:00 +00:00
Alasdair Kergon
6ab3b611c7 restrict dm_tree_node_add_null_area 2011-08-19 16:26:02 +00:00
Alasdair Kergon
927e33104a post-release 2011-08-12 02:34:08 +00:00
Alasdair Kergon
5fd6065e99 pre-release 2011-08-12 01:34:11 +00:00
Zdenek Kabelac
787fa3705d Fix memleak of geometry buffer
Looks like this function is not used too often - thus leak was discovered
by static analyzis (Coverity).
2011-08-11 20:49:33 +00:00
Zdenek Kabelac
64d62e1ded Add memory pool locking functions
Adding debuging functionality to lock and unlock memory pool.

2 ways to debug code:
crc - is default checksum/hash of the locked pool.
      It gets slower when the pool is larger - so the check is only
      made when VG is finaly released and it has been used more then
      once.Thus the result is rather informative.

mprotect - quite fast all the time - but requires more memory and
           currently it is using posix_memalign() - this could be
	   later modified to use dm_malloc() and align internally.
           Tool segfaults when locked memory is modified and core
	   could be examined for faulty code section (backtrace).

Only fast memory pools could use mprotect for now -
so such debug builds cannot be combined with DEBUG_POOL.
2011-08-11 17:29:04 +00:00
Milan Broz
cc2dcab096 Remove dev name prefix from dmsetup line output if major and minor is used. 2011-08-11 17:06:24 +00:00
Alasdair Kergon
bd7f41d83c Remove support for the original dm ioctl interface version 1.
Leave the basic support for multiple versions in case we have a new version
in future.
2011-08-09 17:56:47 +00:00
Zdenek Kabelac
67d0232816 Add missing check for allocation failure
Static analyzer discovered missing check.
2011-08-04 17:56:11 +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
5c4c36b135 Add systemd unit files for dmeventd. 2011-07-28 12:54:28 +00:00
Alasdair Kergon
f2bf7a1cc0 Fix read-only identical table reload supression. 2011-07-24 23:59:03 +00:00
Alasdair Kergon
841a541051 post-release 2011-07-08 19:57:32 +00:00
Alasdair Kergon
136c2e70dc pre-release 2011-07-08 19:19:44 +00:00
Alasdair Kergon
4ccc44282e Remove dev name prefix from dmsetup line output if exactly one dev requested. 2011-07-08 17:08:19 +00:00
Alasdair Kergon
4b22b81391 Report internal error if suspending a device using an already-suspended dev.
This catches the recent pvmove problem trapping I/O between layers.
2011-07-02 01:17:09 +00:00
Alasdair Kergon
0eee66e257 Add framework for validation of ioctls. Doesn't do any checks yet.
dmsetup --checks
libdevmapper: dm_task_enable_checks()
lvm.conf: activation/checks=1
2011-07-01 14:09:19 +00:00