| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Setup major already a dev_t type before it gets shifted.
|
| |
|
|
|
|
|
| |
Auto mode can't deal with multiple mangled names. We can do that while working
in hex mode, but in auto mode, this would lead to device name ambiguity.
|
|
|
|
|
| |
In 'auto' and 'hex' mode, these names are already unmangled on ioctl return.
There's no point on trying to do that once again (actually it's a bug!).
|
|
|
|
|
|
|
| |
Be more strict when unmangling names on ioctl return - require the name to be
properly mangled in 'auto' and 'hex' mode. There really should not be any
blacklisted character since the names should be renamed already (by means of
renaming it directly or running 'dmsetup mangle' for automatic rename).
|
| |
|
|
|
|
| |
alloc_policy_t, dm_string_mangling_t, percent_range_t, sign_t
|
|
|
|
| |
Wrong variable was checked in _dm_task_set_name_from_path.
|
|
|
|
|
| |
Just in case of emergency when name mangling code causes any problems so
we can override the default value and switch off the mangling globally.
|
|
|
|
|
|
|
|
|
| |
dm_task_get_name_mangled will always return mangled form of the name while
the dm_task_get_name_unmangled will always return unmangled form of the name
irrespective of the global setting (dm_set/get_name_mangling_mode).
This is handy in situations where we need to detect whether the name is already
mangled or not. Also display functions make use of it.
|
|
|
|
|
|
|
|
|
|
| |
If dm_task_set_name/newname is called, the name provided will be
automatically translated to correct encoded form with the hex enconding
so any character not on udev whitelist will be mangled with \xNN
format where NN is hex value of the character used.
By default, the name mangling mode used is the one set during
configure with the '--with-default-name-mangling' option.
|
|
|
|
| |
In previous commit this was missing, also deallocate in reversed order.
|
|
|
|
|
|
|
|
|
|
| |
In case of zero bytes would be read from sysfs, it would store '\0' on
temp_buf[-1] address.
Simplify some buffer length calculation and use strcpy if we've just
checked string fits in give buffer.
Replace jump label error: with bad: commonly used in libdm.
|
|
|
|
| |
Use 'goto bad' to cleanup fd on error path.
|
|
|
|
|
| |
Since last character needs to be \0 for string,
pass buffer size smaller by 1 byte.
|
|
|
|
|
| |
Introduces when added dm_device_get_name.
Close file handle in all error paths.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is accomplished by reading associated sysfs information. For a dm device,
this is /sys/dev/block/major:minor/dm/name (supported in kernel version >= 2.6.29,
for older kernels, the behaviour is the same as for non-dm devices).
For a non-dm device, this is a readlink on /sys/dev/block/major:minor, e.g.
/sys/dev/block/253:0 --> ../../devices/virtual/block/dm-0.
The last component of the path is a proper kernel name (block device name).
One can request to read only kernel names by setting the 'prefer_kernel_name'
argument if needed.
|
|
|
|
|
|
|
| |
LVM- prefix.
Try harder not to leave stray empty devices around (locally or remotely) when
reverting changes after failures while there are inactive tables.
|
|
|
|
|
|
|
|
| |
If we know major:minor number of device (which is known after resume) we will
try to use sysfs to set/get read ahead parameters of device.
This avoid potential problem of blocking commands like 'dmsetup info' awaiting
for device being usable for open/close - i.e. overfilled thin pool may block
such command.
|
|
|
|
| |
the latter out of libdm.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
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!
|
|
|
|
| |
Add dm_sysfs_dir to libdevmapper to retrieve sysfs location thas is set.
|
| |
|
| |
|
|
|
|
|
|
| |
dmsetup --checks
libdevmapper: dm_task_enable_checks()
lvm.conf: activation/checks=1
|
| |
|
|
|
|
| |
trust udev; verify udev; perform dev node operations directly.
|
|
|
|
|
|
| |
(We still need to treat add+readhead+del as a no-op.)
Rename udev_fallback to verify_udev_operations.
Rename --udevfallback to --verifyudev
|
|
|
|
|
|
|
|
|
| |
and use this for the LVM critical section logic. Also report an error if
code tries to load a table while any device is known to be in the
suspended state.
(If the variety of problems these changes are showing up can't be fixed
before the next release, the error messages can be reduced to debug
level.)
|
|
|
|
|
| |
Old versions of libudev < 143 were experimental and unstable. Require recent
and stable versions only (version 143 is old enough anyway).
|
|
|
|
|
| |
Replace int with unsigned counter.
Replace snprintf with dm_snprintf.
|
|
|
|
|
| |
gcc suggested to add these attributes to instrumentat
printf arguments. Adding it for internal functions as well.
|
|
|
|
| |
dm_check_version reports log_error() - so use return_NULL.
|
| |
|
| |
|
|
|
|
| |
Include an implicit dm_task_update_nodes() within dm_udev_wait().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the ability to stack many operations in one udev transaction -
in same cases we are adding and removing same device at the same time
(i.e. deactivate followed by activate).
This leads to a problem of checking stacked operations:
i.e. remove /dev/node1 followed by create /dev/node1
If the node creation is handled with udev - there is a problem as
stacked operation gives warning about existing node1 and will try to
remove it - while next operation needs to recreate it.
Current code removes all previous stacked operation if the fs op is
FS_DEL - patch adds similar behavior for FS_ADD - it will try to
remove any 'delete' operation if udev is in use.
For FS_RENAME operation it seems to be more complex. But as we
are always stacking FS_READ_AHEAD after FS_ADD operation -
should be safe to remove all previous operation on the node
when udev is running.
Code does same checking for stacking libdm and liblvm operations.
As a very simple optimization counters were added for each stacked ops
type to avoid unneeded list scans if some operation does not exists in
the list.
Enable skipping of fs_unlock() (udev sync) if only DEL operations are staked.
as we do not use lv_info for already deleted nodes.
|
|
|
|
|
| |
It will be user for cryptsetup to ensure buffers are properly
wiped when sending sensitive data (key).
|
|
|
|
| |
Introduce sync_local_dev_names and CLVMD_CMD_SYNC_NAMES to issue fs_unlock.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Detect existence of new SELinux selabel interface during configure.
Use new dm_prepare_selinux_context instead of dm_set_selinux_context.
We should set the SELinux context before the actual file system object creation.
The new dm_prepare_selinux_context function sets this using the selabel_lookup
fn in conjuction with the setfscreatecon fn. If selinux/label.h interface
(that should be a part of the selinux library) is not found during configure,
we fallback to the original matchpathcon function instead.
|
|
|
|
| |
dm_free is testing NULL itself
|
|
|
|
| |
Add dm_task_set_newuuid to set uuid of mapped device post-creation. (pjones)
|
| |
|