1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-23 21:35:29 +03:00
Commit Graph

6177 Commits

Author SHA1 Message Date
Zdenek Kabelac
ed6d3763da Remove unused file from tree 2011-10-20 13:23:52 +00:00
Zdenek Kabelac
5c796f3378 Just replace stack, return 0 with return_0 2011-10-20 10:39:07 +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
Zdenek Kabelac
e8c577fc2e Add last param 0 for thin-pool
So now the table suppression works for thin-pool.
2011-10-20 10:35:55 +00:00
Zdenek Kabelac
692d718d9d Ensure right activation order
Couple FIXMEs put into the code for parts of the code which may be
improved later, since we might be able to add 'lazy' device creation later.
For now require exclusive activation.
2011-10-20 10:35:14 +00:00
Zdenek Kabelac
bc8bfff5ff Adapt to thin kernel target API
Since kernel target uses low_water_mark - use this name in libdm as well.
2011-10-20 10:33:30 +00:00
Zdenek Kabelac
6e2fdfed67 Reindent code
Avoid 1 indent level and use check for empty list only for
add of transaction_id message.
2011-10-20 10:32:29 +00:00
Zdenek Kabelac
3f59f7e14f Use const pointers in thin API were appropriate 2011-10-20 10:31:27 +00:00
Zdenek Kabelac
8bf74e77c0 Print low_water_mark only when it has some value
Do not expose low_water_mark in mda yet, if it has no use.
We do not allow to be set via current lvm tool code.
Usage needs to be clarified first.
2011-10-20 10:30:39 +00:00
Zdenek Kabelac
79835da163 Add _BLOCK_ to define
Use DM_THIN_MIN_DATA_BLOCK_SIZE and
DM_THIN_MAX_DATA_BLOCK_SIZE to make it more obvious, for which
this define is useful in thin API.
2011-10-20 10:28:41 +00:00
Zdenek Kabelac
90f6336f85 Improve lvcreate man page
Split syntax for thin-pool since it cannot be fully matched with snapshot.
So to avoid more confusion - take thin support into separate line.

Though still significant updates are needed for thin provisioning.
2011-10-19 16:49:13 +00:00
Zdenek Kabelac
4f12b7ad6a Add few more protected names 2011-10-19 16:45:35 +00:00
Zdenek Kabelac
e610f31ca4 Use structure copy
Since the code evolved a bit with current structures we could use C to
copy struct members.
2011-10-19 16:45:02 +00:00
Zdenek Kabelac
0f220e5858 Update error message
Drop INTERNAL_ERROR from public API functions.
Improve some messages.
2011-10-19 16:42:14 +00:00
Zdenek Kabelac
7679ee9535 Use generic name for message sending function
Drop _thin_pool prefix for _node_send_message so it could be extended later.
Replace current_id with trans_id name.
2011-10-19 16:40:59 +00:00
Zdenek Kabelac
a374aed61c Simple validation of messages in mda
Check we do not combine multiple messages for same LV target
and switch to use  'delete_id' to make it clear for what this device_id
is being used.
2011-10-19 16:39:09 +00:00
Zdenek Kabelac
866b21532a Drop messages referencing deleted LV
lvremove may remove problematic LV for thin target.
2011-10-19 16:37:30 +00:00
Zdenek Kabelac
fc260f5bcb Just indent changes
Some tabs & spaces.
2011-10-19 16:36:39 +00:00
Zdenek Kabelac
c239c824f5 Add internal expected_errno dm_tast var
Certain errno codes could be expected in some situations thus
add experimental support for them.

When expected errno is set after ioctl error - function skips error
printing and exits succefully.

Currently only useful for thin pool messages.
2011-10-19 16:36:01 +00:00
Zdenek Kabelac
d1be6a0c37 Remove test for thin_pool
Since both functions are called during mda read - we don't have full LV info
at this moment.
2011-10-19 16:32:34 +00:00
Petr Rockai
9f4ef9fda6 Remove a redundant (and in some cases, misleading) message about snapshot
extension, in the snapshot dmeventd plugin. The reporting is done as needed by
the LVM command nowadays.
2011-10-19 14:31:49 +00:00
Petr Rockai
2a8662ce2e New. 2011-10-19 09:01:03 +00:00
Petr Rockai
6de64854a8 Keep the LVM-based dmeventd plugins from trying to manipulate the dmeventd
monitoring state of the logical volumes they are currently acting on.

Until now, every time a logical volume has been changed by a dmeventd plugin,
this plugin would have called back to dmeventd through the external FIFO
mechanism. I am fairly sure this was superfluous, inefficient and possibly even
dangerous.
2011-10-19 08:46:26 +00:00
Jonathan Earl Brassow
a4ddd21f8e Fix bad lvconvert help output.
The '--merge' option to lvconvert works on snapshots and RAID1.  The man
pages correctly reflect this, but the CLI help output still used the term,
'SnapshotLogicalVolume'.
2011-10-18 16:27:45 +00:00
Zdenek Kabelac
cd2eab0d10 Use zalloc for malloc,memset 2011-10-17 14:36:06 +00:00
Zdenek Kabelac
edb7aaf046 Drop messages from lvm app context
(revert)
Thinp target uses activation context.
2011-10-17 14:18:07 +00:00
Zdenek Kabelac
10c2510aaf Indent debug message 2011-10-17 14:17:30 +00:00
Zdenek Kabelac
f8690cf8d5 Message support for thin provisiong
lvm part of messaging.

Each message is now stored it's own thin pool section:

message1 {
	create = lv
}

Messages are queued to thin pool dm target when this target
is going to be resumed or used through some dependency.

Currently  'delete' message are purely queued and processed
with next thin pool resume operation (i.e. create_thin).

WARNING - thin provisioning support is developmental code.
2011-10-17 14:17:09 +00:00
Zdenek Kabelac
49e3017e4a Add thin_pool dm message support
Experimental support for kernel message via resume sequence.
2011-10-17 14:16:25 +00:00
Zdenek Kabelac
5c5acddf01 Add _thin_validate_device_id 2011-10-17 14:15:26 +00:00
Zdenek Kabelac
f5dace2cb6 Swap parameters
Use metadata uuid first (match kernel target).
2011-10-17 14:15:01 +00:00
Zdenek Kabelac
783b4e1068 Drop old check for transaction_id
(revert)
2011-10-17 14:14:33 +00:00
Milan Broz
c752c23d33 Fix alignment warning in bitcount calculation for raid segment. 2011-10-17 13:15:35 +00:00
Jonathan Earl Brassow
2fd1acc4dd Use a more correct macro for 'seg_is_linear'
It is better to check 'seg->area_count == 1' than '!seg->stripe_size'.
2011-10-14 14:21:32 +00:00
Jonathan Earl Brassow
c954b73149 cmirrord now returns log name to kernel in CTR so it can be registered
Version 2 of the userspace log protocol accepts return information during the
DM_ULOG_CTR exchange.  The return information contains the name of the log
device that is being used (if there is one).  The kernel can then register the
device via 'dm_get_device'.  Amoung other things, this allows for userspace to
assemble a correct dependency tree of devices - critical for LVM handling of
suspend/resume calls.

Also, update dm-log-userspace.h to match the kernel header associated with
this protocol change.  (Includes a version inc.)
2011-10-14 14:18:49 +00:00
Jonathan Earl Brassow
681ceb16d8 Update stale libdm/misc/dm-log-userspace.h
The upstream kernel version that this file mirrors has changed, here is the
commit message:

commit 86a54a4802df10d23ccd655e2083e812fe990243
Author: Jonathan Brassow <jbrassow@redhat.com>
Date:   Thu Jan 13 19:59:52 2011 +0000

    dm log userspace: add version number to comms

    This patch adds a 'version' field to the 'dm_ulog_request'
    structure.

    The 'version' field is taken from a portion of the unused
    'padding' field in the 'dm_ulog_request' structure.  This
    was done to avoid changing the size of the structure and
    possibly disrupting backwards compatibility.

    The version number will help notify user-space daemons
    when a change has been made to the kernel/userspace
    log API.

    Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2011-10-14 14:04:05 +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
878960cdba Fix lv_info open_count test
When verify_udev_operations was disable, code for stacking fs operation for
lvm links was completely disable - but this code was also used for collecting
information, that a new node is being created.

Add a new flag which is set when a creation of lv symlinks is requested which
should restore old behaviour of lv_info function, that has called fs_sync()
before quere for open count on device.
2011-10-14 13:23:47 +00:00
Zdenek Kabelac
1ec22a4f73 Remove unused variables 2011-10-11 10:06:57 +00:00
Zdenek Kabelac
f4668058b4 Use constant for the repeated dlid size specification 2011-10-11 10:02:28 +00:00
Zdenek Kabelac
2e36a19e52 Add some fixme locking
Code here is using thread write protected variable without locking.
So add locking, for proper synchronization and a FIXME, since the
code needs closer look.
2011-10-11 09:56:44 +00:00
Zdenek Kabelac
e65626090b Simplify worker loop
Do not reacquire mutex several times without a real reason.
Code readability is also better.
2011-10-11 09:54:39 +00:00
Zdenek Kabelac
b39f294d02 Use barrier instead of mutex
Barrier is supposed to be used in situation like this
and replace tricky mutex usage, where mutex has been unlocked
by a different thread than the locking thread.
2011-10-11 09:26:04 +00:00
Zdenek Kabelac
0372454d07 Add FIXMEs for init_test
Usage of thread unprotected init_test is not correct and needs probably lvm lock
since it part of lvm library. Current implementation may probably fail with
test mode and actually create something unexpectedly (and vice versa).
2011-10-11 09:23:48 +00:00
Zdenek Kabelac
584a487461 Update 2011-10-11 09:20:17 +00:00
Zdenek Kabelac
e9bdc318fd Limit thread stack
Since default thread stack size is around 8MB and clvmd creates for now thread
for message, clvmd may easily reach multi GB size of in-memory locked pages
(runs with mlockall()).

This patch significantly reduces memory usage to just tens of MB,
and now different reasons are the cause of server overloading.
Now we are running out of free file descriptors mostly.
2011-10-11 09:18:49 +00:00
Zdenek Kabelac
d2cd3f4b76 Update whats new 2011-10-11 09:14:51 +00:00
Zdenek Kabelac
83b15720c0 Reduce preallocated stack size
Go with just 64KiB for stack.

Closer inspection should be made, whether we actually need to play with
settings at all.

Since default stack size is 8MB and gets mapped via page locking thus,
it seems there is no big help with preallocation of stack to some value.
2011-10-11 09:13:39 +00:00
Zdenek Kabelac
3701873dc9 Check for refresh_filter failure
Properly detect if the filters were refreshed properly.

(May needs few more fixes ??)

Filter refresh may fail because it may be out of free file descriptors
when clvmd gets overloaded.
2011-10-11 09:09:00 +00:00
Zdenek Kabelac
b105d7e207 Add missing log_error for alloc failure 2011-10-11 09:06:09 +00:00