1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 03:27:58 +03:00
Commit Graph

690 Commits

Author SHA1 Message Date
Zdenek Kabelac
203affffc7 libdm: enhance thin transaction_id validation
Reuse _node_send_messages for just checking
for valid transaction_id with preload.

This allows earlier detection of incosistent thin pool.

Code does the same thing, except for sending messages.
2014-02-24 21:06:31 +01:00
Zdenek Kabelac
c7b7cb60e4 libdm: hardening transaction_id validation
Improve testing of transation_id to not allow other difference
then either kernel TID is equal or is lower by oned and there
are queued messages for transaction.

Mark messages as submitted if the transaction_id is already matching.

Do not try to deactivate node on failure here and leave it on
proper error path of the caller.
2014-02-24 21:04:50 +01:00
Zdenek Kabelac
1911c61639 libdm: call preload callback only when success
Do not call node's preload callback, if there is
any failure during preload.
2014-02-24 21:01:13 +01:00
Zdenek Kabelac
8346f106b4 libdm: internal is_selinux_enabled wrapper
There is no point to call this external function more then once.
(As suggested by selinux developer)
2014-02-24 20:58:41 +01:00
Zdenek Kabelac
7ec8e691c4 libdm: use 64bit type for raid index
Used properly signed 64bit constant for shifting.
2014-02-15 11:36:37 +01:00
Peter Rajnoha
290e58b0b6 WHATS_NEW: latest commits 2014-02-06 18:19:24 +01:00
Peter Rajnoha
34e6d59bba WHATS_NEW: be more specific about cryptsetup version that sets the udev flags 2014-01-22 15:48:40 +01:00
Peter Rajnoha
36a09cf463 udev: drop cryptsetup specific rules from 10-dm.rules
These udev flags are set directly in cryptsetup for some
time now so there's no need to have it in our rules then.

See also:
https://code.google.com/p/cryptsetup/source/detail?spec=svn4f14b43a3d3e7310465005c401f37e19f8cb85e6&r=4f14b43a3d3e7310465005c401f37e19f8cb85e6
2014-01-22 15:18:57 +01:00
Alasdair G Kergon
899a079c8f post-release 2014-01-20 19:41:30 +00:00
Alasdair G Kergon
aa21e79991 pre-release 2014-01-20 19:22:56 +00:00
Zdenek Kabelac
5f90353636 libdm: WHATSNEW 2014-01-17 11:02:29 +01:00
Zdenek Kabelac
7c5feaed3b dmeventd: prevent busy looping on CPU
Use usleep when looping on DM_WAIT_RETRY.
2013-12-12 13:40:55 +01:00
Zdenek Kabelac
b87c148499 dmeventd: change locking code
Ensure global lock is being hold when working with thread->.
2013-12-12 13:38:55 +01:00
Zdenek Kabelac
4fc97980b6 dmeventd: drop taking timeout mutex
Taking _timeout_mutex is not needed when registering and unregistering.
Global mutex is already being hold for this case.
2013-12-12 13:32:49 +01:00
Alasdair G Kergon
b6d3fd62fc libdm: prevent empty config file section names
Change c353949597 to use existing
_dup_string_tok().  alloca() doesn't fail cleanly (and needs
replacing.)
2013-12-05 01:09:03 +00:00
Zdenek Kabelac
b3679590df dmeventd: simplify error path
Use common 'bad:' label for exit error path where
fifo is closed before exit().
2013-11-28 12:45:02 +01:00
Zdenek Kabelac
6fa95d17ee dmeventd: move format text to printf
Instead of passing argument with format string to printf(),
put the string as arg directly.
Also move there remains args to make the code shorter.
2013-11-22 21:00:51 +01:00
Zdenek Kabelac
eb4b03768f libdm: catch wrongly reported values
Add internal error warning when string value is used
as sort value for numerical field.

Using log_warn since the function itself does not return error,
so we do not confuse log_error() checker.
2013-11-15 12:38:37 +01:00
Alasdair G Kergon
322e7b3060 post-release 2013-11-13 14:11:11 +00:00
Alasdair G Kergon
77a1efeb8e release 2.02.104
87 files changed, 1207 insertions(+), 294 deletions(-)
2013-11-13 14:02:34 +00:00
Zdenek Kabelac
52f41baedb dmsetup: report error on stderr
Send error message on stdout, since after _display_info_long()
command return errors.

Patch makes consistent behavior for command:

dmsetup info -c non-existing-dev
&
dmsetup info non-existing-dev

Now both commands report error on stderr when they return error status
for non-existing device.
2013-11-01 13:05:03 +01:00
Mikulas Patocka
ed30145f4a libdm: fix races with udev
On modern systems udev manages nodes in /dev/mapper directory.
It creates, deletes and renames the nodes according to the
state of the kernel driver.

When the dmsetup is compiled without udev support (--enable-udev_sync)
and runs on the system with running udevd it tries to manage nodes in
/dev/mapper too, so it can race with udev.
dmsetup checks if the node was created/deleted/renamed with the stat
syscall, and skips the operation if it was. However, if udev
creates/deletes/renames the node after the stat syscall and before the
mknod/unlink/rename syscall, dmsetup reports an error.

Since in the system everything happened as expected, skip reporting
error for such case.

These races can be easily provoked by inserting sleep at appropriate
places.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
2013-10-17 11:57:33 +02:00
Zdenek Kabelac
3ac7f927e1 libdm: do not show holders missing error
On older system this may not be present, so skip this error message.
2013-10-17 11:55:21 +02:00
mpatocka@redhat.com
efd1dc6bd3 headers: use __linux__ instead of linux
This file may be included by other programs, so it should be compliant
with the C standard.

* use __linux__ instead of linux - __linux__ is always defined, linux is
  not defined when gcc runs in standard-compliant mode (with -std=c89 or
  -std=c99) because the C standard doesn't allow polluting namespace
  with arbitrary defines.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
2013-10-17 11:54:44 +02:00
Alasdair G Kergon
761b524519 post-release 2013-10-04 14:41:32 +01:00
Alasdair G Kergon
04d9a52684 release 2.02.103
52 files changed, 598 insertions(+), 264 deletions(-)
2013-10-04 14:32:23 +01:00
Peter Rajnoha
23ce3352d7 libdm: export DM_UDEV_SUBSYSTEM_FLAG names for subystem udev flags
Just like we have symbolic names assigned to general DM udev flags
(DM_UDEV_* flags), we have the same for any subsystem flags now
(DM_SUBSYSTEM_UDEV_FLAG*), making it easier to use.
2013-09-30 11:19:09 +02:00
Peter Rajnoha
ec9b3dcecc udev: make subsystem rules responsible for importing subsystem flags
Each subsystem rule that needs to import any of DM_SUBSYSTEM_UDEV_FLAG*
flags is responsible for doing so. This simply moves control of these
flags from general 10-dm.rules to any subsystem rule using these flags
as each subsystem knows better how to handle these flags on its own.
2013-09-30 11:11:18 +02:00
Alasdair G Kergon
229e0752f1 post-release 2013-09-23 15:55:11 +01:00
Alasdair G Kergon
c8057aec36 release 2.02.102
18 files changed, 137 insertions(+), 203 deletions(-)
2013-09-23 15:43:37 +01:00
Alasdair G Kergon
bd75844024 release 2.02.101
112 files changed, 4131 insertions(+), 1312 deletions(-)
2013-09-20 13:56:29 +01:00
Alasdair G Kergon
68f841fcda dmsetup: Detect invalid sector supplied to message.
atoll doesn't check for errors, so invalid sector numbers were silently
accepted in the "dmsetup message" command.

(Mikulas)
2013-09-18 01:24:19 +01:00
Alasdair G Kergon
a0ca2c11ee libdm: avoid leak if dm_task_set_* fn called again
(Mikulas)
2013-09-18 01:13:06 +01:00
Zdenek Kabelac
350cf7968c libdm: new name can't be empty
Do not allow passing '' names to kernel.

This test was missing also in kernel, so it has allowed
to create device with '' name.  This then confused dmsetup tool,
since such name is unexpected and unsupported. To remove
such name from table, user has to use -j -m to specify which device
should be removed.

This patch fixes the posibility to run this operation:

dmsetup rename existingdev ''

after this operation commands like  'dmsetup table' are failing.
This patch prohibits to use such name.
2013-08-31 21:40:28 +02:00
Alasdair G Kergon
d8b781e8ab dmsetup: display any message output from kernel
Recent kernels allow messages to respond with a string.
Add dm_task_get_message_response() to libdevmapper to perform some
basic sanity checks and return this.
Have 'dmsetup message' display any response.

DM statistics will make extensive use of this.

(From Mikulas.)
2013-08-16 15:25:39 +01:00
Alasdair G Kergon
32148369d1 post-release 2013-08-13 11:54:48 +01:00
Alasdair G Kergon
297907899c release 2.02.100
84 files changed, 1540 insertions(+), 442 deletions(-)

Mostly bug fixes this time.

Also note:
  md raid replaces dm mirroring as the default implementation.
  Can call out to thin_repair to fix thin metadata.
  Improved clvmd error detection/debugging information.
2013-08-13 11:29:21 +01:00
Peter Rajnoha
1cdd563b6c WHATS_NEW: move line to WHATS_NEW_DM 2013-08-06 11:42:01 +02:00
Zdenek Kabelac
5d9628475e libdm: add DM_ABORT_ON_INTERNAL_ERRORS
Support tests with abort when libdm encounters internal
error - i.e. for dmsetup tool.

Code execution will be aborted when
env var DM_ABORT_ON_INTERNAL_ERRORS is set to 1
2013-07-31 15:27:34 +02:00
Alasdair G Kergon
06dce7d539 post-release 2013-07-25 00:38:53 +01:00
Alasdair G Kergon
76e617b158 release 2.02.99
363 files changed, 19863 insertions(+), 9055 deletions(-)

This is a very large release - so expect bugs!

Please treat this release like a release candidate.
Changes to the external interfaces since 2.02.98 are not yet frozen.

Updated releases will follow quickly (days not weeks) as any problems
are handled.
2013-07-24 23:59:03 +01:00
Zdenek Kabelac
5658ec2bdc libdm: thin pool target sends messages once
Clear send_messages flag when they have been delivered successfully.
There is no need to validate it for all other activations of the same
node in the dm_tree.

Also add extra debug message which shows the reason for skipping
sending of messages because the transaction_id has already the matching
value.
2013-07-15 15:45:28 +02:00
Zdenek Kabelac
e5c30061fc libdm: remove unneeded read_ahead settings
Skip settings are read_ahead value which is already set in kernel.
2013-07-15 15:43:28 +02:00
Zdenek Kabelac
1b4f888bc5 libdm: add DM_ARRAY_SIZE
Add macro for reading detecting size of array.
2013-07-08 14:00:17 +02:00
Zdenek Kabelac
fd399d52a9 dmeventd: move code from signal handler
Instead of calling syslog() from signal event handler,
run all logging code in the main loop.

Also it needs to take the lock and check for list
only when really needed.
2013-07-01 23:06:11 +02:00
Alasdair G Kergon
c2dc21d89f text: miscellaneous comments & message tweaks 2013-06-15 01:28:54 +01:00
Zdenek Kabelac
c5c452a137 libdm: add public macro DM_TO_STRING
Since this stringifying macro is usable in more places,
move it to the public header with DM_ prefix.
2013-05-30 16:53:59 +02:00
Peter Rajnoha
798ed9ea1c WHATS_NEW: return success on dmeventd -V 2013-05-29 13:24:16 +02:00
Zdenek Kabelac
e992cb253c dmeventd: use dm_get_status_snapshot()
Switch to use libdm dm_get_status_snapshot() function for
reading status info.
This fixes bug, where the code was using 32bit integers,
while the snapshot target is able to return 64bit sizes.
However this also means, someone is using >1TB snapshot
cow devices, which is actually very bad idea anyway, since the
perfomance and memory usage in this case is very bad.
2013-05-27 10:33:06 +02:00
Zdenek Kabelac
4707ac7200 libdm: add dm_get_status_snapshot
Add dm_get_status_snapshot() for parsing snapshot status.
2013-05-27 10:30:51 +02:00