mirror of
git://sourceware.org/git/lvm2.git
synced 2025-11-23 04:23:49 +03:00
Compare commits
34 Commits
dev-dct-de
...
dev-mcsont
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09fc3a985d | ||
|
|
c30881fd95 | ||
|
|
64ba9e4eca | ||
|
|
a30013ff4f | ||
|
|
6d1e894a86 | ||
|
|
9aa3ea1c98 | ||
|
|
7ec0726ce3 | ||
|
|
ff6022d400 | ||
|
|
5e060b8fa7 | ||
|
|
dd28460017 | ||
|
|
494372b4ee | ||
|
|
5c50590b22 | ||
|
|
bee575d678 | ||
|
|
d14245c724 | ||
|
|
99f9bb28c9 | ||
|
|
6cb0b44cd2 | ||
|
|
fb7698b0ce | ||
|
|
151ce8b276 | ||
|
|
f840dbb320 | ||
|
|
8db3b11e4e | ||
|
|
23a9bd549a | ||
|
|
6e22be20c6 | ||
|
|
0937113146 | ||
|
|
86a0a652a9 | ||
|
|
f1578b4a5d | ||
|
|
72f0b637d2 | ||
|
|
c7a5b5cca0 | ||
|
|
bef1363c00 | ||
|
|
cc73d99886 | ||
|
|
7b1a857d5a | ||
|
|
4eb04c8c05 | ||
|
|
00c3069872 | ||
|
|
7e70041e32 | ||
|
|
1126be8f8d |
@@ -1 +1 @@
|
||||
1.02.185-git (2022-02-07)
|
||||
1.02.187-git (2022-05-18)
|
||||
|
||||
16
WHATS_NEW
16
WHATS_NEW
@@ -1,5 +1,17 @@
|
||||
Version 2.03.16 -
|
||||
====================================
|
||||
Version 2.03.17 -
|
||||
===============================
|
||||
|
||||
Version 2.03.16 - 18th May 2022
|
||||
===============================
|
||||
Fix segfault when handling selection with historical LVs.
|
||||
Add support --vdosettings with lvcreate, lvconvert, lvchange.
|
||||
Filtering multipath devices respects blacklist setting from multipath
|
||||
configuration.
|
||||
lvmdevices support for removing by device id using --deviceidtype and
|
||||
--deldev.
|
||||
Display writecache block size with lvs -o writecache_block_size.
|
||||
Improve cachesettings description in man lvmcache.
|
||||
Fix lossing of delete message on thin-pool extension.
|
||||
|
||||
Version 2.03.15 - 07th February 2022
|
||||
====================================
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
Version 1.02.185 -
|
||||
=====================================
|
||||
Version 1.02.187 -
|
||||
================================
|
||||
|
||||
Version 1.02.185 - 18th May 2022
|
||||
================================
|
||||
|
||||
Version 1.02.183 - 07th February 2022
|
||||
=====================================
|
||||
|
||||
@@ -684,10 +684,10 @@ int lm_init_vg_sanlock(char *ls_name, char *vg_name, uint32_t flags, char *vg_ar
|
||||
break;
|
||||
}
|
||||
|
||||
if (rv) {
|
||||
if (rv < 0) {
|
||||
log_error("clear lv resource area %llu error %d",
|
||||
(unsigned long long)offset, rv);
|
||||
break;
|
||||
return rv;
|
||||
}
|
||||
offset += align_size;
|
||||
}
|
||||
|
||||
@@ -77,8 +77,10 @@ enum dm_vdo_write_policy {
|
||||
struct dm_vdo_target_params {
|
||||
uint32_t minimum_io_size; // in sectors
|
||||
uint32_t block_map_cache_size_mb;
|
||||
uint32_t block_map_era_length; // format period
|
||||
|
||||
union {
|
||||
uint32_t block_map_era_length; // format period
|
||||
uint32_t block_map_period; // supported alias
|
||||
};
|
||||
uint32_t check_point_frequency;
|
||||
uint32_t index_memory_size_mb; // format
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ SOURCES =\
|
||||
filters/filter-partitioned.c \
|
||||
filters/filter-type.c \
|
||||
filters/filter-usable.c \
|
||||
filters/filter-internal.c \
|
||||
filters/filter-signature.c \
|
||||
filters/filter-deviceid.c \
|
||||
format_text/archive.c \
|
||||
|
||||
@@ -1128,7 +1128,7 @@ static int _init_dev_cache(struct cmd_context *cmd)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define MAX_FILTERS 11
|
||||
#define MAX_FILTERS 10
|
||||
|
||||
static struct dev_filter *_init_filter_chain(struct cmd_context *cmd)
|
||||
{
|
||||
@@ -1143,13 +1143,6 @@ static struct dev_filter *_init_filter_chain(struct cmd_context *cmd)
|
||||
* Update MAX_FILTERS definition above when adding new filters.
|
||||
*/
|
||||
|
||||
/* internal filter used by command processing. */
|
||||
if (!(filters[nr_filt] = internal_filter_create())) {
|
||||
log_error("Failed to create internal device filter");
|
||||
goto bad;
|
||||
}
|
||||
nr_filt++;
|
||||
|
||||
/* global regex filter. Optional. */
|
||||
if ((cn = find_config_tree_node(cmd, devices_global_filter_CFG, NULL))) {
|
||||
if (!(filters[nr_filt] = regex_filter_create(cn->v, 0, 1))) {
|
||||
|
||||
@@ -1410,7 +1410,7 @@ static void _remove_alias(struct device *dev, const char *name)
|
||||
* deactivated LV. Those old paths are all invalid and are dropped here.
|
||||
*/
|
||||
|
||||
static void _verify_aliases(struct device *dev)
|
||||
void dev_cache_verify_aliases(struct device *dev)
|
||||
{
|
||||
struct dm_str_list *strl, *strl2;
|
||||
struct stat st;
|
||||
@@ -1459,7 +1459,7 @@ static struct device *_dev_cache_get(struct cmd_context *cmd, const char *name,
|
||||
_remove_alias(dev, name);
|
||||
|
||||
/* Remove any other names in dev->aliases that are incorrect. */
|
||||
_verify_aliases(dev);
|
||||
dev_cache_verify_aliases(dev);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -1606,18 +1606,6 @@ static struct device *_dev_cache_get(struct cmd_context *cmd, const char *name,
|
||||
return dev;
|
||||
|
||||
ret = f->passes_filter(cmd, f, dev, NULL);
|
||||
|
||||
/*
|
||||
* This might happen if this function is called before
|
||||
* filters can do i/o. I don't think this will happen
|
||||
* any longer and this EAGAIN case can be removed.
|
||||
*/
|
||||
if (ret == -EAGAIN) {
|
||||
log_debug_devs("dev_cache_get filter deferred %s", dev_name(dev));
|
||||
dev->flags |= DEV_FILTER_AFTER_SCAN;
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
if (!ret) {
|
||||
log_debug_devs("dev_cache_get filter excludes %s", dev_name(dev));
|
||||
return NULL;
|
||||
@@ -1688,16 +1676,9 @@ struct device *dev_iter_get(struct cmd_context *cmd, struct dev_iter *iter)
|
||||
|
||||
f = iter->filter;
|
||||
|
||||
if (f && !(d->flags & DEV_REGULAR)) {
|
||||
if (f && !(d->flags & DEV_REGULAR))
|
||||
ret = f->passes_filter(cmd, f, d, NULL);
|
||||
|
||||
if (ret == -EAGAIN) {
|
||||
log_debug_devs("get device by iter defer filter %s", dev_name(d));
|
||||
d->flags |= DEV_FILTER_AFTER_SCAN;
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!f || (d->flags & DEV_REGULAR) || ret)
|
||||
return d;
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ int dev_cache_add_dir(const char *path);
|
||||
struct device *dev_cache_get(struct cmd_context *cmd, const char *name, struct dev_filter *f);
|
||||
struct device *dev_cache_get_existing(struct cmd_context *cmd, const char *name, struct dev_filter *f);
|
||||
struct device *dev_cache_get_by_devt(struct cmd_context *cmd, dev_t devt);
|
||||
void dev_cache_verify_aliases(struct device *dev);
|
||||
|
||||
struct device *dev_hash_get(const char *name);
|
||||
|
||||
|
||||
@@ -23,9 +23,6 @@ int dev_is_luks(struct cmd_context *cmd, struct device *dev, uint64_t *offset_fo
|
||||
char buf[LUKS_SIGNATURE_SIZE];
|
||||
int ret = -1;
|
||||
|
||||
if (!scan_bcache)
|
||||
return -EAGAIN;
|
||||
|
||||
if (offset_found)
|
||||
*offset_found = 0;
|
||||
|
||||
|
||||
@@ -178,12 +178,6 @@ static int _dev_is_md_component_native(struct device *dev, uint64_t *offset_foun
|
||||
uint64_t size, sb_offset = 0;
|
||||
int ret;
|
||||
|
||||
/* i/o layer has not been set up */
|
||||
if (!scan_bcache) {
|
||||
log_error(INTERNAL_ERROR "dev_is_md_component_native requires io layer.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!dev_get_size(dev, &size)) {
|
||||
stack;
|
||||
return -1;
|
||||
|
||||
@@ -17,12 +17,14 @@
|
||||
#include "lib/activate/activate.h"
|
||||
#include "lib/commands/toolcontext.h"
|
||||
#include "lib/device/device_id.h"
|
||||
#include "lib/datastruct/str_list.h"
|
||||
#ifdef UDEV_SYNC_SUPPORT
|
||||
#include <libudev.h>
|
||||
#include "lib/device/dev-ext-udev-constants.h"
|
||||
#endif
|
||||
|
||||
#include <dirent.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#define MPATH_PREFIX "mpath-"
|
||||
|
||||
@@ -35,15 +37,167 @@
|
||||
* If dm-3 is not an mpath device, then the constant "1" is stored in
|
||||
* the hash table with the key of the dm minor number.
|
||||
*/
|
||||
static struct dm_pool *_hash_mem;
|
||||
static struct dm_pool *_wwid_mem;
|
||||
static struct dm_hash_table *_minor_hash_tab;
|
||||
static struct dm_hash_table *_wwid_hash_tab;
|
||||
static struct dm_list _ignored;
|
||||
static struct dm_list _ignored_exceptions;
|
||||
|
||||
#define MAX_WWID_LINE 512
|
||||
|
||||
/*
|
||||
* do we need to check the multipath.conf blacklist?
|
||||
*/
|
||||
static void _read_blacklist_file(const char *path)
|
||||
{
|
||||
FILE *fp;
|
||||
char line[MAX_WWID_LINE];
|
||||
char wwid[MAX_WWID_LINE];
|
||||
char *word, *p;
|
||||
int section_black = 0;
|
||||
int section_exceptions = 0;
|
||||
int found_quote;
|
||||
int found_three;
|
||||
int i, j;
|
||||
|
||||
if (!(fp = fopen(path, "r")))
|
||||
return;
|
||||
|
||||
while (fgets(line, sizeof(line), fp)) {
|
||||
word = NULL;
|
||||
|
||||
/* skip initial white space on the line */
|
||||
for (i = 0; i < MAX_WWID_LINE; i++) {
|
||||
if ((line[i] == '\n') || (line[i] == '\0'))
|
||||
break;
|
||||
if (isspace(line[i]))
|
||||
continue;
|
||||
word = &line[i];
|
||||
break;
|
||||
}
|
||||
|
||||
if (!word || word[0] == '#')
|
||||
continue;
|
||||
|
||||
/* identify the start of the section we want to read */
|
||||
if (strchr(word, '{')) {
|
||||
if (!strncmp(word, "blacklist_exceptions", 20))
|
||||
section_exceptions = 1;
|
||||
else if (!strncmp(word, "blacklist", 9))
|
||||
section_black = 1;
|
||||
continue;
|
||||
}
|
||||
/* identify the end of the section we've been reading */
|
||||
if (strchr(word, '}')) {
|
||||
section_exceptions = 0;
|
||||
section_black = 0;
|
||||
continue;
|
||||
}
|
||||
/* skip lines that are not in a section we want */
|
||||
if (!section_black && !section_exceptions)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* read a wwid from the blacklist{_exceptions} section.
|
||||
* does not recognize other non-wwid entries in the
|
||||
* section, and skips those (should the entire mp
|
||||
* config filtering be disabled if non-wwids are seen?
|
||||
*/
|
||||
if (!(p = strstr(word, "wwid")))
|
||||
continue;
|
||||
|
||||
i += 4; /* skip "wwid" */
|
||||
|
||||
/*
|
||||
* copy wwid value from the line.
|
||||
* the wwids copied here need to match the
|
||||
* wwids read from /etc/multipath/wwids,
|
||||
* which are matched to wwids from sysfs.
|
||||
*/
|
||||
|
||||
memset(wwid, 0, sizeof(wwid));
|
||||
found_quote = 0;
|
||||
found_three = 0;
|
||||
j = 0;
|
||||
|
||||
for (; i < MAX_WWID_LINE; i++) {
|
||||
if ((line[i] == '\n') || (line[i] == '\0'))
|
||||
break;
|
||||
if (!j && isspace(line[i]))
|
||||
continue;
|
||||
if (isspace(line[i]))
|
||||
break;
|
||||
/* quotes around wwid are optional */
|
||||
if ((line[i] == '"') && !found_quote) {
|
||||
found_quote = 1;
|
||||
continue;
|
||||
}
|
||||
/* second quote is end of wwid */
|
||||
if ((line[i] == '"') && found_quote)
|
||||
break;
|
||||
/* ignore first "3" in wwid */
|
||||
if ((line[i] == '3') && !found_three) {
|
||||
found_three = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
wwid[j] = line[i];
|
||||
j++;
|
||||
}
|
||||
|
||||
if (j < 8)
|
||||
continue;
|
||||
|
||||
log_debug("multipath wwid %s in %s %s",
|
||||
wwid, section_exceptions ? "blacklist_exceptions" : "blacklist", path);
|
||||
|
||||
if (section_exceptions) {
|
||||
if (!str_list_add(_wwid_mem, &_ignored_exceptions, dm_pool_strdup(_wwid_mem, wwid)))
|
||||
stack;
|
||||
} else {
|
||||
if (!str_list_add(_wwid_mem, &_ignored, dm_pool_strdup(_wwid_mem, wwid)))
|
||||
stack;
|
||||
}
|
||||
}
|
||||
|
||||
if (fclose(fp))
|
||||
stack;
|
||||
}
|
||||
|
||||
static void _read_wwid_exclusions(void)
|
||||
{
|
||||
char path[PATH_MAX] = { 0 };
|
||||
DIR *dir;
|
||||
struct dirent *de;
|
||||
struct dm_str_list *sl, *sl2;
|
||||
int rem_count = 0;
|
||||
|
||||
_read_blacklist_file("/etc/multipath.conf");
|
||||
|
||||
if ((dir = opendir("/etc/multipath/conf.d"))) {
|
||||
while ((de = readdir(dir))) {
|
||||
if (de->d_name[0] == '.')
|
||||
continue;
|
||||
snprintf(path, PATH_MAX-1, "/etc/multipath/conf.d/%s", de->d_name);
|
||||
_read_blacklist_file(path);
|
||||
}
|
||||
closedir(dir);
|
||||
}
|
||||
|
||||
/* for each wwid in ignored_exceptions, remove it from ignored */
|
||||
|
||||
dm_list_iterate_items_safe(sl, sl2, &_ignored) {
|
||||
if (str_list_match_item(&_ignored_exceptions, sl->str))
|
||||
str_list_del(&_ignored, sl->str);
|
||||
}
|
||||
|
||||
/* for each wwid in ignored, remove it from wwid_hash */
|
||||
|
||||
dm_list_iterate_items(sl, &_ignored) {
|
||||
dm_hash_remove_binary(_wwid_hash_tab, sl->str, strlen(sl->str));
|
||||
rem_count++;
|
||||
}
|
||||
|
||||
if (rem_count)
|
||||
log_debug("multipath config ignored %d wwids", rem_count);
|
||||
}
|
||||
|
||||
static void _read_wwid_file(const char *config_wwids_file)
|
||||
{
|
||||
@@ -93,6 +247,9 @@ int dev_mpath_init(const char *config_wwids_file)
|
||||
struct dm_hash_table *minor_tab;
|
||||
struct dm_hash_table *wwid_tab;
|
||||
|
||||
dm_list_init(&_ignored);
|
||||
dm_list_init(&_ignored_exceptions);
|
||||
|
||||
if (!(mem = dm_pool_create("mpath", 256))) {
|
||||
log_error("mpath pool creation failed.");
|
||||
return 0;
|
||||
@@ -104,7 +261,7 @@ int dev_mpath_init(const char *config_wwids_file)
|
||||
return 0;
|
||||
}
|
||||
|
||||
_hash_mem = mem;
|
||||
_wwid_mem = mem;
|
||||
_minor_hash_tab = minor_tab;
|
||||
|
||||
/* multipath_wwids_file="" disables the use of the file */
|
||||
@@ -116,16 +273,18 @@ int dev_mpath_init(const char *config_wwids_file)
|
||||
if (!(wwid_tab = dm_hash_create(110))) {
|
||||
log_error("mpath hash table creation failed.");
|
||||
dm_hash_destroy(_minor_hash_tab);
|
||||
dm_pool_destroy(_hash_mem);
|
||||
dm_pool_destroy(_wwid_mem);
|
||||
_minor_hash_tab = NULL;
|
||||
_hash_mem = NULL;
|
||||
_wwid_mem = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
_wwid_hash_tab = wwid_tab;
|
||||
|
||||
if (config_wwids_file)
|
||||
if (config_wwids_file) {
|
||||
_read_wwid_file(config_wwids_file);
|
||||
_read_wwid_exclusions();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -136,12 +295,12 @@ void dev_mpath_exit(void)
|
||||
dm_hash_destroy(_minor_hash_tab);
|
||||
if (_wwid_hash_tab)
|
||||
dm_hash_destroy(_wwid_hash_tab);
|
||||
if (_hash_mem)
|
||||
dm_pool_destroy(_hash_mem);
|
||||
if (_wwid_mem)
|
||||
dm_pool_destroy(_wwid_mem);
|
||||
|
||||
_minor_hash_tab = NULL;
|
||||
_wwid_hash_tab = NULL;
|
||||
_hash_mem = NULL;
|
||||
_wwid_mem = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -272,7 +431,9 @@ static int _dev_is_mpath_component_udev(struct device *dev)
|
||||
}
|
||||
#endif
|
||||
|
||||
static int _dev_is_mpath_component_sysfs(struct cmd_context *cmd, struct device *dev)
|
||||
/* mpath_devno is major:minor of the dm multipath device currently using the component dev. */
|
||||
|
||||
static int _dev_is_mpath_component_sysfs(struct cmd_context *cmd, struct device *dev, dev_t *mpath_devno)
|
||||
{
|
||||
struct dev_types *dt = cmd->dev_types;
|
||||
const char *part_name;
|
||||
@@ -426,6 +587,8 @@ static int _dev_is_mpath_component_sysfs(struct cmd_context *cmd, struct device
|
||||
if (closedir(dr))
|
||||
stack;
|
||||
|
||||
if (is_mpath_component)
|
||||
*mpath_devno = MKDEV(dm_dev_major, dm_dev_minor);
|
||||
return is_mpath_component;
|
||||
}
|
||||
|
||||
@@ -464,9 +627,9 @@ static int _dev_in_wwid_file(struct cmd_context *cmd, struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dev_is_mpath_component(struct cmd_context *cmd, struct device *dev)
|
||||
int dev_is_mpath_component(struct cmd_context *cmd, struct device *dev, dev_t *holder_devno)
|
||||
{
|
||||
if (_dev_is_mpath_component_sysfs(cmd, dev) == 1)
|
||||
if (_dev_is_mpath_component_sysfs(cmd, dev, holder_devno) == 1)
|
||||
goto found;
|
||||
|
||||
if (_dev_in_wwid_file(cmd, dev))
|
||||
|
||||
@@ -42,9 +42,6 @@ int dev_is_swap(struct cmd_context *cmd, struct device *dev, uint64_t *offset_fo
|
||||
unsigned page;
|
||||
int ret = 0;
|
||||
|
||||
if (!scan_bcache)
|
||||
return -EAGAIN;
|
||||
|
||||
if (!dev_get_size(dev, &size)) {
|
||||
stack;
|
||||
return -1;
|
||||
|
||||
@@ -674,11 +674,6 @@ static int _dev_is_partitioned_native(struct dev_types *dt, struct device *dev)
|
||||
{
|
||||
int r;
|
||||
|
||||
if (!scan_bcache) {
|
||||
log_error(INTERNAL_ERROR "dev_is_partitioned_native requires i/o.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Unpartitioned DASD devices are not supported. */
|
||||
if ((MAJOR(dev->dev) == dt->dasd_major) && dasd_is_cdl_formatted(dev))
|
||||
return 1;
|
||||
|
||||
@@ -58,7 +58,7 @@ int major_is_scsi_device(struct dev_types *dt, int major);
|
||||
|
||||
/* Signature/superblock recognition with position returned where found. */
|
||||
int dev_is_md_component(struct cmd_context *cmd, struct device *dev, uint64_t *sb, int full);
|
||||
int dev_is_mpath_component(struct cmd_context *cmd, struct device *dev);
|
||||
int dev_is_mpath_component(struct cmd_context *cmd, struct device *dev, dev_t *mpath_devno);
|
||||
int dev_is_swap(struct cmd_context *cmd, struct device *dev, uint64_t *signature, int full);
|
||||
int dev_is_luks(struct cmd_context *cmd, struct device *dev, uint64_t *signature, int full);
|
||||
int dasd_is_cdl_formatted(struct device *dev);
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
#define DEV_NOT_O_NOATIME 0x00000400 /* Don't use O_NOATIME */
|
||||
#define DEV_IN_BCACHE 0x00000800 /* dev fd is open and used in bcache */
|
||||
#define DEV_BCACHE_EXCL 0x00001000 /* bcache_fd should be open EXCL */
|
||||
#define DEV_FILTER_AFTER_SCAN 0x00002000 /* apply filter after bcache has data */
|
||||
#define DEV_FILTER_OUT_SCAN 0x00004000 /* filtered out during label scan */
|
||||
/* unused 0x00002000 */
|
||||
/* unused 0x00004000 */
|
||||
#define DEV_BCACHE_WRITE 0x00008000 /* bcache_fd is open with RDWR */
|
||||
#define DEV_SCAN_FOUND_LABEL 0x00010000 /* label scan read dev and found label */
|
||||
#define DEV_IS_MD_COMPONENT 0x00020000 /* device is an md component */
|
||||
|
||||
@@ -887,6 +887,17 @@ static int _device_ids_use_lvmlv(struct cmd_context *cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct dev_use *get_du_for_devno(struct cmd_context *cmd, dev_t devno)
|
||||
{
|
||||
struct dev_use *du;
|
||||
|
||||
dm_list_iterate_items(du, &cmd->use_devices) {
|
||||
if (du->dev && du->dev->dev == devno)
|
||||
return du;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct dev_use *get_du_for_dev(struct cmd_context *cmd, struct device *dev)
|
||||
{
|
||||
struct dev_use *du;
|
||||
@@ -924,7 +935,7 @@ struct dev_use *get_du_for_devname(struct cmd_context *cmd, const char *devname)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct dev_use *_get_du_for_device_id(struct cmd_context *cmd, uint16_t idtype, const char *idname)
|
||||
struct dev_use *get_du_for_device_id(struct cmd_context *cmd, uint16_t idtype, const char *idname)
|
||||
{
|
||||
struct dev_use *du;
|
||||
|
||||
@@ -1117,7 +1128,7 @@ id_done:
|
||||
du_devname = get_du_for_devname(cmd, dev_name(dev));
|
||||
|
||||
/* Is there already an entry using the device_id for this device? */
|
||||
du_devid = _get_du_for_device_id(cmd, id->idtype, id->idname);
|
||||
du_devid = get_du_for_device_id(cmd, id->idtype, id->idname);
|
||||
|
||||
if (du_dev)
|
||||
log_debug("device_id_add %s pvid %s matches entry %p dev %s",
|
||||
@@ -1287,15 +1298,15 @@ void device_id_update_vg_uuid(struct cmd_context *cmd, struct volume_group *vg,
|
||||
int update = 0;
|
||||
|
||||
if (!cmd->enable_devices_file)
|
||||
goto out;
|
||||
return;
|
||||
|
||||
/* Without this setting there is no stacking LVs on PVs. */
|
||||
if (!cmd->scan_lvs)
|
||||
goto out;
|
||||
return;
|
||||
|
||||
/* Check if any devices file entries are stacked on LVs. */
|
||||
if (!_device_ids_use_lvmlv(cmd))
|
||||
goto out;
|
||||
return;
|
||||
|
||||
memcpy(old_vgid, old_vg_id, ID_LEN);
|
||||
memcpy(new_vgid, &vg->id, ID_LEN);
|
||||
@@ -1311,7 +1322,7 @@ void device_id_update_vg_uuid(struct cmd_context *cmd, struct volume_group *vg,
|
||||
memcpy(old_idname+4, old_vgid, ID_LEN);
|
||||
memcpy(old_idname+4+ID_LEN, &lvl->lv->lvid.id[1], ID_LEN);
|
||||
|
||||
if ((du = _get_du_for_device_id(cmd, DEV_ID_TYPE_LVMLV_UUID, old_idname))) {
|
||||
if ((du = get_du_for_device_id(cmd, DEV_ID_TYPE_LVMLV_UUID, old_idname))) {
|
||||
log_debug("device_id update %s pvid %s vgid %s to %s",
|
||||
du->devname ?: ".", du->pvid ?: ".", old_vgid, new_vgid);
|
||||
memcpy(du->idname+4, new_vgid, ID_LEN);
|
||||
@@ -1325,7 +1336,6 @@ void device_id_update_vg_uuid(struct cmd_context *cmd, struct volume_group *vg,
|
||||
if (update &&
|
||||
!device_ids_write(cmd))
|
||||
stack;
|
||||
out:
|
||||
unlock_devices_file(cmd);
|
||||
}
|
||||
|
||||
@@ -1766,7 +1776,7 @@ void device_ids_validate(struct cmd_context *cmd, struct dm_list *scanned_devs,
|
||||
* probably wants to do something about it.
|
||||
*/
|
||||
if (!cmd->filter->passes_filter(cmd, cmd->filter, dev, "persistent")) {
|
||||
log_warn("Devices file %s is excluded by filter: %s.",
|
||||
log_warn("Devices file %s is excluded: %s.",
|
||||
dev_name(dev), dev_filtered_reason(dev));
|
||||
continue;
|
||||
}
|
||||
@@ -1852,7 +1862,7 @@ void device_ids_validate(struct cmd_context *cmd, struct dm_list *scanned_devs,
|
||||
continue;
|
||||
|
||||
if (!cmd->filter->passes_filter(cmd, cmd->filter, dev, "persistent")) {
|
||||
log_warn("Devices file %s is excluded by filter: %s.",
|
||||
log_warn("Devices file %s is excluded: %s.",
|
||||
dev_name(dev), dev_filtered_reason(dev));
|
||||
/* FIXME: what if this dev is wrongly matched and should be checked below? */
|
||||
continue;
|
||||
@@ -2294,7 +2304,7 @@ void device_ids_find_renamed_devs(struct cmd_context *cmd, struct dm_list *dev_l
|
||||
|
||||
if (!cmd->filter->passes_filter(cmd, cmd->filter, dev, NULL)) {
|
||||
/* I don't think this would happen */
|
||||
log_warn("WARNING: new device %s for PVID %s does not pass filter %s.",
|
||||
log_warn("WARNING: new device %s for PVID %s is excluded: %s.",
|
||||
dev_name(dev), dil->pvid, dev_filtered_reason(dev));
|
||||
if (du) /* Should not happen 'du' is NULL */
|
||||
du->dev = NULL;
|
||||
|
||||
@@ -39,9 +39,11 @@ void device_ids_find_renamed_devs(struct cmd_context *cmd, struct dm_list *dev_l
|
||||
const char *device_id_system_read(struct cmd_context *cmd, struct device *dev, uint16_t idtype);
|
||||
void device_id_update_vg_uuid(struct cmd_context *cmd, struct volume_group *vg, struct id *old_vg_id);
|
||||
|
||||
struct dev_use *get_du_for_devno(struct cmd_context *cmd, dev_t devno);
|
||||
struct dev_use *get_du_for_dev(struct cmd_context *cmd, struct device *dev);
|
||||
struct dev_use *get_du_for_pvid(struct cmd_context *cmd, const char *pvid);
|
||||
struct dev_use *get_du_for_devname(struct cmd_context *cmd, const char *devname);
|
||||
struct dev_use *get_du_for_device_id(struct cmd_context *cmd, uint16_t idtype, const char *idname);
|
||||
|
||||
char *devices_file_version(void);
|
||||
int devices_file_exists(struct cmd_context *cmd);
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2006 Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This file is part of LVM2.
|
||||
*
|
||||
* This copyrighted material is made available to anyone wishing to use,
|
||||
* modify, copy, or redistribute it subject to the terms and conditions
|
||||
* of the GNU Lesser General Public License v.2.1.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "base/memory/zalloc.h"
|
||||
#include "lib/misc/lib.h"
|
||||
#include "lib/filters/filter.h"
|
||||
|
||||
static DM_LIST_INIT(_allow_devs);
|
||||
|
||||
int internal_filter_allow(struct dm_pool *mem, struct device *dev)
|
||||
{
|
||||
struct device_list *devl;
|
||||
|
||||
if (!(devl = dm_pool_alloc(mem, sizeof(*devl)))) {
|
||||
log_error("device_list element allocation failed");
|
||||
return 0;
|
||||
}
|
||||
devl->dev = dev;
|
||||
|
||||
dm_list_add(&_allow_devs, &devl->list);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void internal_filter_clear(void)
|
||||
{
|
||||
dm_list_init(&_allow_devs);
|
||||
}
|
||||
|
||||
static int _passes_internal(struct cmd_context *cmd, struct dev_filter *f __attribute__((unused)),
|
||||
struct device *dev, const char *use_filter_name)
|
||||
{
|
||||
struct device_list *devl;
|
||||
|
||||
dev->filtered_flags &= ~DEV_FILTERED_INTERNAL;
|
||||
|
||||
if (!internal_filtering())
|
||||
return 1;
|
||||
|
||||
dm_list_iterate_items(devl, &_allow_devs) {
|
||||
if (devl->dev == dev)
|
||||
return 1;
|
||||
}
|
||||
|
||||
dev->filtered_flags |= DEV_FILTERED_INTERNAL;
|
||||
log_debug_devs("%s: Skipping for internal filtering.", dev_name(dev));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void _destroy(struct dev_filter *f)
|
||||
{
|
||||
if (f->use_count)
|
||||
log_error(INTERNAL_ERROR "Destroying internal filter while in use %u times.", f->use_count);
|
||||
|
||||
free(f);
|
||||
}
|
||||
|
||||
struct dev_filter *internal_filter_create(void)
|
||||
{
|
||||
struct dev_filter *f;
|
||||
|
||||
if (!(f = zalloc(sizeof(*f)))) {
|
||||
log_error("md filter allocation failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
f->passes_filter = _passes_internal;
|
||||
f->destroy = _destroy;
|
||||
f->use_count = 0;
|
||||
f->name = "internal";
|
||||
|
||||
log_debug_devs("Internal filter initialised.");
|
||||
|
||||
return f;
|
||||
}
|
||||
|
||||
@@ -99,14 +99,6 @@ static int _passes_md_filter(struct cmd_context *cmd, struct dev_filter *f __att
|
||||
return 1;
|
||||
|
||||
ret = dev_is_md_component(cmd, dev, NULL, cmd->use_full_md_check);
|
||||
|
||||
if (ret == -EAGAIN) {
|
||||
/* let pass, call again after scan */
|
||||
dev->flags |= DEV_FILTER_AFTER_SCAN;
|
||||
log_debug_devs("filter md deferred %s", dev_name(dev));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
return 1;
|
||||
|
||||
|
||||
@@ -15,18 +15,41 @@
|
||||
#include "base/memory/zalloc.h"
|
||||
#include "lib/misc/lib.h"
|
||||
#include "lib/filters/filter.h"
|
||||
#include "lib/device/device_id.h"
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
static int _lvmdevices_update_msg;
|
||||
|
||||
static int _ignore_mpath_component(struct cmd_context *cmd, struct dev_filter *f, struct device *dev, const char *use_filter_name)
|
||||
{
|
||||
dev_t mpath_devno = 0;
|
||||
|
||||
dev->filtered_flags &= ~DEV_FILTERED_MPATH_COMPONENT;
|
||||
|
||||
if (dev_is_mpath_component(cmd, dev)) {
|
||||
if (dev_is_mpath_component(cmd, dev, &mpath_devno)) {
|
||||
log_debug_devs("%s: Skipping mpath component device", dev_name(dev));
|
||||
dev->filtered_flags |= DEV_FILTERED_MPATH_COMPONENT;
|
||||
|
||||
/*
|
||||
* Warn about misconfig where an mpath component is
|
||||
* in the devices file, but its mpath device is not.
|
||||
*/
|
||||
if ((dev->flags & DEV_MATCHED_USE_ID) && mpath_devno) {
|
||||
if (!get_du_for_devno(cmd, mpath_devno)) {
|
||||
struct device *mpath_dev = dev_cache_get_by_devt(cmd, mpath_devno);
|
||||
log_warn("WARNING: devices file is missing %s (%d:%d) using multipath component %s.",
|
||||
mpath_dev ? dev_name(mpath_dev) : "unknown",
|
||||
(int)MAJOR(mpath_devno), (int)MINOR(mpath_devno), dev_name(dev));
|
||||
if (!_lvmdevices_update_msg && strcmp(get_cmd_name(), "lvmdevices")) {
|
||||
log_warn("See lvmdevices --update for devices file update.");
|
||||
_lvmdevices_update_msg = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,14 +30,6 @@ static int _passes_partitioned_filter(struct cmd_context *cmd, struct dev_filter
|
||||
dev->filtered_flags &= ~DEV_FILTERED_PARTITIONED;
|
||||
|
||||
ret = dev_is_partitioned(cmd, dev);
|
||||
|
||||
if (ret == -EAGAIN) {
|
||||
/* let pass, call again after scan */
|
||||
log_debug_devs("filter partitioned deferred %s", dev_name(dev));
|
||||
dev->flags |= DEV_FILTER_AFTER_SCAN;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
if (dev->ext.src == DEV_EXT_NONE)
|
||||
log_debug_devs(MSG_SKIPPING, dev_name(dev));
|
||||
|
||||
@@ -109,8 +109,6 @@ static int _lookup_p(struct cmd_context *cmd, struct dev_filter *f, struct devic
|
||||
|
||||
/* Uncached, check filters and cache the result */
|
||||
if (!l) {
|
||||
dev->flags &= ~DEV_FILTER_AFTER_SCAN;
|
||||
|
||||
pass = pf->real->passes_filter(cmd, pf->real, dev, use_filter_name);
|
||||
|
||||
if (!pass) {
|
||||
@@ -120,21 +118,13 @@ static int _lookup_p(struct cmd_context *cmd, struct dev_filter *f, struct devic
|
||||
* because the deferred result won't change the exclude.
|
||||
*/
|
||||
l = PF_BAD_DEVICE;
|
||||
|
||||
} else if ((pass == -EAGAIN) || (dev->flags & DEV_FILTER_AFTER_SCAN)) {
|
||||
/*
|
||||
* When the filter result is deferred, we let the device
|
||||
* pass for now, but do not cache the result. We need to
|
||||
* rerun the filters later. At that point the final result
|
||||
* will be cached.
|
||||
*/
|
||||
log_debug_devs("filter cache deferred %s", dev_name(dev));
|
||||
dev->flags |= DEV_FILTER_AFTER_SCAN;
|
||||
pass = 1;
|
||||
goto out;
|
||||
|
||||
} else if (pass) {
|
||||
} else if (pass == 1) {
|
||||
l = PF_GOOD_DEVICE;
|
||||
} else {
|
||||
log_error("Ignore invalid filter result %d %s", pass, dev_name(dev));
|
||||
pass = 1;
|
||||
/* don't cache invalid result */
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!dev->filtered_flags) /* skipping reason already logged by filter */
|
||||
|
||||
@@ -33,13 +33,6 @@ static int _ignore_signature(struct cmd_context *cmd, struct dev_filter *f __att
|
||||
|
||||
dev->filtered_flags &= ~DEV_FILTERED_SIGNATURE;
|
||||
|
||||
if (!scan_bcache) {
|
||||
/* let pass, call again after scan */
|
||||
log_debug_devs("filter signature deferred %s", dev_name(dev));
|
||||
dev->flags |= DEV_FILTER_AFTER_SCAN;
|
||||
return 1;
|
||||
}
|
||||
|
||||
memset(buf, 0, BUFSIZE);
|
||||
|
||||
if (!dev_read_bytes(dev, 0, BUFSIZE, buf)) {
|
||||
|
||||
@@ -32,10 +32,6 @@ struct dev_filter *sysfs_filter_create(void);
|
||||
struct dev_filter *signature_filter_create(struct dev_types *dt);
|
||||
struct dev_filter *deviceid_filter_create(struct cmd_context *cmd);
|
||||
|
||||
struct dev_filter *internal_filter_create(void);
|
||||
int internal_filter_allow(struct dm_pool *mem, struct device *dev);
|
||||
void internal_filter_clear(void);
|
||||
|
||||
/*
|
||||
* patterns must be an array of strings of the form:
|
||||
* [ra]<sep><regex><sep>, eg,
|
||||
|
||||
@@ -459,7 +459,6 @@ static int _scan_dev_open(struct device *dev)
|
||||
const char *name;
|
||||
const char *modestr;
|
||||
struct stat sbuf;
|
||||
int retried = 0;
|
||||
int flags = 0;
|
||||
int fd, di;
|
||||
|
||||
@@ -479,14 +478,23 @@ static int _scan_dev_open(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
next_name:
|
||||
/*
|
||||
* All the names for this device (major:minor) are kept on
|
||||
* dev->aliases, the first one is the primary/preferred name.
|
||||
*
|
||||
* The default name preferences in dev-cache mean that the first
|
||||
* name in dev->aliases is not a symlink for scsi devices, but is
|
||||
* the /dev/mapper/ symlink for mpath devices.
|
||||
*
|
||||
* If preferred names are set to symlinks, should this
|
||||
* first attempt to open using a non-symlink?
|
||||
*
|
||||
* dm_list_first() returns NULL if the list is empty.
|
||||
*/
|
||||
if (!(name_list = dm_list_first(&dev->aliases))) {
|
||||
/* Shouldn't happen */
|
||||
log_error("Device open %s %d:%d has no path names.",
|
||||
dev_name(dev), (int)MAJOR(dev->dev), (int)MINOR(dev->dev));
|
||||
log_error("Device open %d:%d has no path names.",
|
||||
(int)MAJOR(dev->dev), (int)MINOR(dev->dev));
|
||||
return 0;
|
||||
}
|
||||
name_sl = dm_list_item(name_list, struct dm_str_list);
|
||||
@@ -514,50 +522,34 @@ static int _scan_dev_open(struct device *dev)
|
||||
modestr = "ro";
|
||||
}
|
||||
|
||||
retry_open:
|
||||
|
||||
fd = open(name, flags, 0777);
|
||||
|
||||
if (fd < 0) {
|
||||
if ((errno == EBUSY) && (flags & O_EXCL)) {
|
||||
log_error("Can't open %s exclusively. Mounted filesystem?",
|
||||
dev_name(dev));
|
||||
return 0;
|
||||
} else {
|
||||
int major, minor;
|
||||
|
||||
/*
|
||||
* Shouldn't happen, if it does, print stat info to help figure
|
||||
* out what's wrong.
|
||||
* drop name from dev->aliases and use verify_aliases to
|
||||
* drop any other invalid aliases before retrying open with
|
||||
* any remaining valid paths.
|
||||
*/
|
||||
|
||||
major = (int)MAJOR(dev->dev);
|
||||
minor = (int)MINOR(dev->dev);
|
||||
|
||||
log_error("Device open %s %d:%d failed errno %d", name, major, minor, errno);
|
||||
|
||||
if (stat(name, &sbuf)) {
|
||||
log_debug_devs("Device open %s %d:%d stat failed errno %d",
|
||||
name, major, minor, errno);
|
||||
} else if (sbuf.st_rdev != dev->dev) {
|
||||
log_debug_devs("Device open %s %d:%d stat %d:%d does not match.",
|
||||
name, major, minor,
|
||||
(int)MAJOR(sbuf.st_rdev), (int)MINOR(sbuf.st_rdev));
|
||||
}
|
||||
|
||||
if (!retried) {
|
||||
/*
|
||||
* FIXME: remove this, the theory for this retry is that
|
||||
* there may be a udev race that we can sometimes mask by
|
||||
* retrying. This is here until we can figure out if it's
|
||||
* needed and if so fix the real problem.
|
||||
*/
|
||||
usleep(5000);
|
||||
log_debug_devs("Device open %s retry", dev_name(dev));
|
||||
retried = 1;
|
||||
goto retry_open;
|
||||
}
|
||||
log_debug("Drop alias for %d:%d failed open %s (%d)",
|
||||
(int)MAJOR(dev->dev), (int)MINOR(dev->dev), name, errno);
|
||||
dev_cache_failed_path(dev, name);
|
||||
dev_cache_verify_aliases(dev);
|
||||
goto next_name;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Verify that major:minor from the path still match dev. */
|
||||
if ((fstat(fd, &sbuf) < 0) || (sbuf.st_rdev != dev->dev)) {
|
||||
log_warn("Invalid path %s for device %d:%d, trying different path.",
|
||||
name, (int)MAJOR(dev->dev), (int)MINOR(dev->dev));
|
||||
(void)close(fd);
|
||||
dev_cache_failed_path(dev, name);
|
||||
dev_cache_verify_aliases(dev);
|
||||
goto next_name;
|
||||
}
|
||||
|
||||
dev->flags |= DEV_IN_BCACHE;
|
||||
@@ -605,37 +597,6 @@ static int _scan_dev_close(struct device *dev)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void _drop_bad_aliases(struct device *dev)
|
||||
{
|
||||
struct dm_str_list *strl, *strl2;
|
||||
const char *name;
|
||||
struct stat sbuf;
|
||||
int major = (int)MAJOR(dev->dev);
|
||||
int minor = (int)MINOR(dev->dev);
|
||||
int bad;
|
||||
|
||||
dm_list_iterate_items_safe(strl, strl2, &dev->aliases) {
|
||||
name = strl->str;
|
||||
bad = 0;
|
||||
|
||||
if (stat(name, &sbuf)) {
|
||||
bad = 1;
|
||||
log_debug_devs("Device path check %d:%d %s stat failed errno %d",
|
||||
major, minor, name, errno);
|
||||
} else if (sbuf.st_rdev != dev->dev) {
|
||||
bad = 1;
|
||||
log_debug_devs("Device path check %d:%d %s stat %d:%d does not match.",
|
||||
major, minor, name,
|
||||
(int)MAJOR(sbuf.st_rdev), (int)MINOR(sbuf.st_rdev));
|
||||
}
|
||||
|
||||
if (bad) {
|
||||
log_debug_devs("Device path check %d:%d dropping path %s.", major, minor, name);
|
||||
dev_cache_failed_path(dev, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Like bcache_invalidate, only it throws any dirty data away if the
|
||||
// write fails.
|
||||
static void _invalidate_di(struct bcache *cache, int di)
|
||||
@@ -663,10 +624,8 @@ static int _scan_list(struct cmd_context *cmd, struct dev_filter *f,
|
||||
char headers_buf[HEADERS_BUF_SIZE];
|
||||
struct dm_list wait_devs;
|
||||
struct dm_list done_devs;
|
||||
struct dm_list reopen_devs;
|
||||
struct device_list *devl, *devl2;
|
||||
struct block *bb;
|
||||
int retried_open = 0;
|
||||
int scan_read_errors = 0;
|
||||
int scan_process_errors = 0;
|
||||
int scan_failed_count = 0;
|
||||
@@ -677,7 +636,6 @@ static int _scan_list(struct cmd_context *cmd, struct dev_filter *f,
|
||||
|
||||
dm_list_init(&wait_devs);
|
||||
dm_list_init(&done_devs);
|
||||
dm_list_init(&reopen_devs);
|
||||
|
||||
log_debug_devs("Scanning %d devices for VG info", dm_list_size(devs));
|
||||
|
||||
@@ -701,9 +659,9 @@ static int _scan_list(struct cmd_context *cmd, struct dev_filter *f,
|
||||
|
||||
if (!_in_bcache(devl->dev)) {
|
||||
if (!_scan_dev_open(devl->dev)) {
|
||||
log_debug_devs("Scan failed to open %s.", dev_name(devl->dev));
|
||||
log_debug_devs("Scan failed to open %d:%d %s.",
|
||||
(int)MAJOR(devl->dev->dev), (int)MINOR(devl->dev->dev), dev_name(devl->dev));
|
||||
dm_list_del(&devl->list);
|
||||
dm_list_add(&reopen_devs, &devl->list);
|
||||
devl->dev->flags |= DEV_SCAN_NOT_READ;
|
||||
continue;
|
||||
}
|
||||
@@ -787,41 +745,6 @@ static int _scan_list(struct cmd_context *cmd, struct dev_filter *f,
|
||||
if (!dm_list_empty(devs))
|
||||
goto scan_more;
|
||||
|
||||
/*
|
||||
* We're done scanning all the devs. If we failed to open any of them
|
||||
* the first time through, refresh device paths and retry. We failed
|
||||
* to open the devs on the reopen_devs list.
|
||||
*
|
||||
* FIXME: it's not clear if or why this helps.
|
||||
*/
|
||||
if (!dm_list_empty(&reopen_devs)) {
|
||||
if (retried_open) {
|
||||
/* Don't try again. */
|
||||
scan_failed_count += dm_list_size(&reopen_devs);
|
||||
dm_list_splice(&done_devs, &reopen_devs);
|
||||
goto out;
|
||||
}
|
||||
retried_open = 1;
|
||||
|
||||
dm_list_iterate_items_safe(devl, devl2, &reopen_devs) {
|
||||
_drop_bad_aliases(devl->dev);
|
||||
|
||||
if (dm_list_empty(&devl->dev->aliases)) {
|
||||
log_warn("WARNING: Scan ignoring device %d:%d with no paths.",
|
||||
(int)MAJOR(devl->dev->dev),
|
||||
(int)MINOR(devl->dev->dev));
|
||||
|
||||
dm_list_del(&devl->list);
|
||||
lvmcache_del_dev(devl->dev);
|
||||
scan_failed_count++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Put devs that failed to open back on the original list to retry. */
|
||||
dm_list_splice(devs, &reopen_devs);
|
||||
goto scan_more;
|
||||
}
|
||||
out:
|
||||
log_debug_devs("Scanned devices: read errors %d process errors %d failed %d",
|
||||
scan_read_errors, scan_process_errors, scan_failed_count);
|
||||
|
||||
@@ -1180,7 +1103,7 @@ int label_scan_vg_online(struct cmd_context *cmd, const char *vgname,
|
||||
|
||||
dm_list_iterate_items_safe(devl, devl2, &devs) {
|
||||
if (!cmd->filter->passes_filter(cmd, cmd->filter, devl->dev, NULL)) {
|
||||
log_print("%s excluded by filters: %s.",
|
||||
log_print("%s excluded: %s.",
|
||||
dev_name(devl->dev), dev_filtered_reason(devl->dev));
|
||||
dm_list_del(&devl->list);
|
||||
dm_list_add(&devs_drop, &devl->list);
|
||||
@@ -1246,7 +1169,7 @@ int label_scan_vg_online(struct cmd_context *cmd, const char *vgname,
|
||||
|
||||
/* Applies all filters, including those that need data from dev. */
|
||||
if (!cmd->filter->passes_filter(cmd, cmd->filter, devl->dev, NULL)) {
|
||||
log_print("%s excluded by filters: %s.",
|
||||
log_print("%s excluded: %s.",
|
||||
dev_name(devl->dev), dev_filtered_reason(devl->dev));
|
||||
dm_list_del(&devl->list);
|
||||
dm_list_add(&devs_drop, &devl->list);
|
||||
@@ -1738,9 +1661,11 @@ void label_scan_invalidate_lvs(struct cmd_context *cmd, struct dm_list *lvs)
|
||||
dev_t devt;
|
||||
|
||||
/*
|
||||
* FIXME: this is all unnecessary unless there are PVs stacked on LVs,
|
||||
* so we can skip all of this if scan_lvs=0.
|
||||
* This is only needed when the command sees PVs stacked on LVs which
|
||||
* will only happen with scan_lvs=1.
|
||||
*/
|
||||
if (!cmd->scan_lvs)
|
||||
return;
|
||||
log_debug("invalidating devs for any pvs on lvs");
|
||||
|
||||
if (get_device_list(NULL, &devs, &devs_features)) {
|
||||
|
||||
@@ -6179,7 +6179,7 @@ int lv_resize(struct logical_volume *lv,
|
||||
|
||||
if (lv_is_thin_pool(lock_lv)) {
|
||||
/* Update lvm pool metadata (drop messages). */
|
||||
if (!update_pool_lv(lock_lv, 0))
|
||||
if (!update_pool_lv(lock_lv, 1))
|
||||
goto_bad;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,6 +126,8 @@ lvchange \(em Change the attributes of logical volume(s)
|
||||
\fB--sysinit\fP
|
||||
.br
|
||||
\fB-t\fP|\fB--test\fP
|
||||
.br
|
||||
\fB--vdosettings\fP \fIString\fP
|
||||
.br
|
||||
\fB-v\fP|\fB--verbose\fP
|
||||
.br
|
||||
@@ -202,6 +204,8 @@ required, after which the others are optional.
|
||||
\fB--\fP[\fBraid\fP]\fBminrecoveryrate\fP \fISize\fP[k|UNIT]
|
||||
.br
|
||||
\fB--\fP[\fBraid\fP]\fBmaxrecoveryrate\fP \fISize\fP[k|UNIT]
|
||||
.br
|
||||
\fB--vdosettings\fP \fIString\fP
|
||||
.br
|
||||
\fB--\fP[\fBraid\fP]\fBwritebehind\fP \fINumber\fP
|
||||
.br
|
||||
@@ -545,12 +549,13 @@ See \fBlvmcache\fP(7) for more information.
|
||||
.HP
|
||||
\fB--cachesettings\fP \fIString\fP
|
||||
.br
|
||||
Specifies tunable values for a cache LV in "Key = Value" form.
|
||||
Repeat this option to specify multiple values.
|
||||
(The default values should usually be adequate.)
|
||||
The special string value \fBdefault\fP switches
|
||||
settings back to their default kernel values and removes
|
||||
them from the list of settings stored in LVM metadata.
|
||||
Specifies tunable kernel options for dm-cache or dm-writecache LVs.
|
||||
Use the form 'option=value' or 'option1=value option2=value', or
|
||||
repeat --cachesettings for each option being set.
|
||||
These settings override the default kernel behaviors which are
|
||||
usually adequate. To remove cachesettings and revert to the default
|
||||
kernel behaviors, use --cachesettings 'default' for dm-cache or
|
||||
an empty string --cachesettings '' for dm-writecache.
|
||||
See \fBlvmcache\fP(7) for more information.
|
||||
.
|
||||
.HP
|
||||
@@ -609,8 +614,9 @@ See \fBlvm.conf\fP(5) for more information about profiles.
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -752,7 +758,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--noudevsync\fP
|
||||
@@ -927,6 +934,17 @@ error messages in multi-stage operations if a tool relies on reading
|
||||
back metadata it believes has changed but hasn't.
|
||||
.
|
||||
.HP
|
||||
\fB--vdosettings\fP \fIString\fP
|
||||
.br
|
||||
Specifies tunable VDO options for VDO LVs.
|
||||
Use the form 'option=value' or 'option1=value option2=value', or
|
||||
repeat --vdosettings for each option being set.
|
||||
These settings override the default VDO behaviors.
|
||||
To remove vdosettings and revert to the default
|
||||
VDO behaviors, use --vdosettings 'default'.
|
||||
See \fBlvmvdo\fP(7) for more information.
|
||||
.
|
||||
.HP
|
||||
\fB-v\fP|\fB--verbose\fP ...
|
||||
.br
|
||||
Set verbose level. Repeat from 1 to 4 times to increase the detail
|
||||
|
||||
@@ -155,6 +155,8 @@ lvconvert \(em Change logical volume layout
|
||||
\fB--usepolicies\fP
|
||||
.br
|
||||
\fB--vdopool\fP \fILV\fP
|
||||
.br
|
||||
\fB--vdosettings\fP \fIString\fP
|
||||
.br
|
||||
\fB-v\fP|\fB--verbose\fP
|
||||
.br
|
||||
@@ -742,6 +744,8 @@ Convert LV to type vdopool.
|
||||
.br
|
||||
[ \fB--deduplication\fP \fBy\fP|\fBn\fP ]
|
||||
.br
|
||||
[ \fB--vdosettings\fP \fIString\fP ]
|
||||
.br
|
||||
[ COMMON_OPTIONS ]
|
||||
.ad b
|
||||
.RE
|
||||
@@ -1064,12 +1068,13 @@ The name of a cache pool.
|
||||
.HP
|
||||
\fB--cachesettings\fP \fIString\fP
|
||||
.br
|
||||
Specifies tunable values for a cache LV in "Key = Value" form.
|
||||
Repeat this option to specify multiple values.
|
||||
(The default values should usually be adequate.)
|
||||
The special string value \fBdefault\fP switches
|
||||
settings back to their default kernel values and removes
|
||||
them from the list of settings stored in LVM metadata.
|
||||
Specifies tunable kernel options for dm-cache or dm-writecache LVs.
|
||||
Use the form 'option=value' or 'option1=value option2=value', or
|
||||
repeat --cachesettings for each option being set.
|
||||
These settings override the default kernel behaviors which are
|
||||
usually adequate. To remove cachesettings and revert to the default
|
||||
kernel behaviors, use --cachesettings 'default' for dm-cache or
|
||||
an empty string --cachesettings '' for dm-writecache.
|
||||
See \fBlvmcache\fP(7) for more information.
|
||||
.
|
||||
.HP
|
||||
@@ -1131,8 +1136,9 @@ See \fBlvmvdo\fP(7) for more information about VDO usage.
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -1303,7 +1309,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--noudevsync\fP
|
||||
@@ -1535,6 +1542,17 @@ The name of a VDO pool LV.
|
||||
See \fBlvmvdo\fP(7) for more information about VDO usage.
|
||||
.
|
||||
.HP
|
||||
\fB--vdosettings\fP \fIString\fP
|
||||
.br
|
||||
Specifies tunable VDO options for VDO LVs.
|
||||
Use the form 'option=value' or 'option1=value option2=value', or
|
||||
repeat --vdosettings for each option being set.
|
||||
These settings override the default VDO behaviors.
|
||||
To remove vdosettings and revert to the default
|
||||
VDO behaviors, use --vdosettings 'default'.
|
||||
See \fBlvmvdo\fP(7) for more information.
|
||||
.
|
||||
.HP
|
||||
\fB-v\fP|\fB--verbose\fP ...
|
||||
.br
|
||||
Set verbose level. Repeat from 1 to 4 times to increase the detail
|
||||
@@ -1808,6 +1826,8 @@ Convert LV to type vdopool.
|
||||
.br
|
||||
[ \fB--deduplication\fP \fBy\fP|\fBn\fP ]
|
||||
.br
|
||||
[ \fB--vdosettings\fP \fIString\fP ]
|
||||
.br
|
||||
[ COMMON_OPTIONS ]
|
||||
.ad b
|
||||
.RE
|
||||
|
||||
@@ -157,6 +157,8 @@ lvcreate \(em Create a logical volume
|
||||
\fB--vdo\fP
|
||||
.br
|
||||
\fB--vdopool\fP \fILV\fP
|
||||
.br
|
||||
\fB--vdosettings\fP \fIString\fP
|
||||
.br
|
||||
\fB-v\fP|\fB--verbose\fP
|
||||
.br
|
||||
@@ -537,6 +539,8 @@ Create a LV that returns VDO when used.
|
||||
.br
|
||||
[ \fB--deduplication\fP \fBy\fP|\fBn\fP ]
|
||||
.br
|
||||
[ \fB--vdosettings\fP \fIString\fP ]
|
||||
.br
|
||||
[ COMMON_OPTIONS ]
|
||||
.ad b
|
||||
.RE
|
||||
@@ -927,12 +931,13 @@ The name of a cache pool.
|
||||
.HP
|
||||
\fB--cachesettings\fP \fIString\fP
|
||||
.br
|
||||
Specifies tunable values for a cache LV in "Key = Value" form.
|
||||
Repeat this option to specify multiple values.
|
||||
(The default values should usually be adequate.)
|
||||
The special string value \fBdefault\fP switches
|
||||
settings back to their default kernel values and removes
|
||||
them from the list of settings stored in LVM metadata.
|
||||
Specifies tunable kernel options for dm-cache or dm-writecache LVs.
|
||||
Use the form 'option=value' or 'option1=value option2=value', or
|
||||
repeat --cachesettings for each option being set.
|
||||
These settings override the default kernel behaviors which are
|
||||
usually adequate. To remove cachesettings and revert to the default
|
||||
kernel behaviors, use --cachesettings 'default' for dm-cache or
|
||||
an empty string --cachesettings '' for dm-writecache.
|
||||
See \fBlvmcache\fP(7) for more information.
|
||||
.
|
||||
.HP
|
||||
@@ -1003,8 +1008,9 @@ See \fBlvmvdo\fP(7) for more information about VDO usage.
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -1190,7 +1196,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--nosync\fP
|
||||
@@ -1438,6 +1445,17 @@ The name of a VDO pool LV.
|
||||
See \fBlvmvdo\fP(7) for more information about VDO usage.
|
||||
.
|
||||
.HP
|
||||
\fB--vdosettings\fP \fIString\fP
|
||||
.br
|
||||
Specifies tunable VDO options for VDO LVs.
|
||||
Use the form 'option=value' or 'option1=value option2=value', or
|
||||
repeat --vdosettings for each option being set.
|
||||
These settings override the default VDO behaviors.
|
||||
To remove vdosettings and revert to the default
|
||||
VDO behaviors, use --vdosettings 'default'.
|
||||
See \fBlvmvdo\fP(7) for more information.
|
||||
.
|
||||
.HP
|
||||
\fB-v\fP|\fB--verbose\fP ...
|
||||
.br
|
||||
Set verbose level. Repeat from 1 to 4 times to increase the detail
|
||||
@@ -1966,6 +1984,8 @@ Create a VDO LV with VDO pool.
|
||||
.br
|
||||
[ \fB--deduplication\fP \fBy\fP|\fBn\fP ]
|
||||
.br
|
||||
[ \fB--vdosettings\fP \fIString\fP ]
|
||||
.br
|
||||
[ COMMON_OPTIONS ]
|
||||
.ad b
|
||||
.RE
|
||||
@@ -1996,6 +2016,8 @@ Create a VDO LV with VDO pool.
|
||||
.br
|
||||
[ \fB--deduplication\fP \fBy\fP|\fBn\fP ]
|
||||
.br
|
||||
[ \fB--vdosettings\fP \fIString\fP ]
|
||||
.br
|
||||
[ COMMON_OPTIONS ]
|
||||
.ad b
|
||||
.RE
|
||||
|
||||
@@ -186,8 +186,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -278,7 +279,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--nosuffix\fP
|
||||
|
||||
@@ -328,8 +328,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -423,7 +424,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--nosync\fP
|
||||
|
||||
@@ -169,8 +169,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -254,7 +255,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--nosuffix\fP
|
||||
|
||||
@@ -115,8 +115,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -181,7 +182,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--polloperation\fP \fBpvmove\fP|\fBconvert\fP|\fBmerge\fP|\fBmerge_thin\fP
|
||||
|
||||
@@ -156,8 +156,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -261,7 +262,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -85,6 +85,7 @@ is used for dm crypt devices, reported by sysfs.
|
||||
.IP \[bu] 2
|
||||
.B md_uuid
|
||||
is used for md devices, reported by sysfs.
|
||||
.IP \[bu] 2
|
||||
.B lvmlv_uuid
|
||||
is used if a PV is placed on top of an lvm LV, reported by sysfs.
|
||||
.IP \[bu] 2
|
||||
|
||||
@@ -24,7 +24,7 @@ lvmdevices \(em Manage the devices file
|
||||
.br
|
||||
\fB-d\fP|\fB--debug\fP
|
||||
.br
|
||||
\fB--deldev\fP \fIPV\fP
|
||||
\fB--deldev\fP \fIString\fP
|
||||
.br
|
||||
\fB--delpvid\fP \fIString\fP
|
||||
.br
|
||||
@@ -152,6 +152,7 @@ is used for dm crypt devices, reported by sysfs.
|
||||
.IP \[bu] 2
|
||||
.B md_uuid
|
||||
is used for md devices, reported by sysfs.
|
||||
.IP \[bu] 2
|
||||
.B lvmlv_uuid
|
||||
is used if a PV is placed on top of an lvm LV, reported by sysfs.
|
||||
.IP \[bu] 2
|
||||
@@ -226,10 +227,12 @@ Add a device to the devices file.
|
||||
Remove a device from the devices file.
|
||||
.br
|
||||
.P
|
||||
\fBlvmdevices\fP \fB--deldev\fP \fIPV\fP
|
||||
\fBlvmdevices\fP \fB--deldev\fP \fIString\fP|\fIPV\fP
|
||||
.br
|
||||
.RS 4
|
||||
.ad l
|
||||
[ \fB--deviceidtype\fP \fIString\fP ]
|
||||
.br
|
||||
[ COMMON_OPTIONS ]
|
||||
.ad b
|
||||
.RE
|
||||
@@ -346,9 +349,11 @@ Set debug level. Repeat from 1 to 6 times to increase the detail of
|
||||
messages sent to the log file and/or syslog (if configured).
|
||||
.
|
||||
.HP
|
||||
\fB--deldev\fP \fIPV\fP
|
||||
\fB--deldev\fP \fIString\fP
|
||||
.br
|
||||
Remove a device from the devices file.
|
||||
When used alone, --deldev specifies a device name.
|
||||
When used with --deviceidtype, --deldev specifies a device id.
|
||||
.
|
||||
.HP
|
||||
\fB--delpvid\fP \fIString\fP
|
||||
@@ -365,8 +370,9 @@ then it will override the default type that lvm would use.
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -420,7 +426,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -102,8 +102,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -162,7 +163,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -132,6 +132,19 @@ that can keep 100% incompressible data there.
|
||||
# lvconvert --type vdo-pool -n vdo0 -V10G vg/ExistingLV
|
||||
.fi
|
||||
.
|
||||
.SS \n+[step]. Change the compression and deduplication of a VDOPoolLV
|
||||
.
|
||||
Disable or enable the compression and deduplication for VDOPoolLV
|
||||
(the volume that maintains all VDO LV(s) associated with it).
|
||||
.P
|
||||
.B lvchange --compression y|n --deduplication y|n VG/VDOPoolLV
|
||||
.P
|
||||
.I Example
|
||||
.nf
|
||||
# lvchange --compression n vg/vdopool0
|
||||
# lvchange --deduplication y vg/vdopool1
|
||||
.fi
|
||||
.
|
||||
.SS \n+[step]. Change the default settings used for creating a VDOPoolLV
|
||||
.
|
||||
VDO allows to set a large variety of options. Lots of these settings
|
||||
@@ -173,17 +186,27 @@ EOF
|
||||
# lvcreate --vdo -L10G --config 'allocation/vdo_cpu_threads=4' vg/vdopool1
|
||||
.fi
|
||||
.
|
||||
.SS \n+[step]. Change the compression and deduplication of a VDOPoolLV
|
||||
.SS \n+[step]. Set or change VDO settings with option --vdosettings
|
||||
.
|
||||
Disable or enable the compression and deduplication for VDOPoolLV
|
||||
(the volume that maintains all VDO LV(s) associated with it).
|
||||
.P
|
||||
.B lvchange --compression y|n --deduplication y|n VG/VDOPoolLV
|
||||
Use the form 'option=value' or 'option1=value option2=value',
|
||||
or repeat --vdosettings for each option being set.
|
||||
Options are listed in the Example section above, for the full description see
|
||||
.BR lvm.conf (5).
|
||||
Options can omit 'vdo_' and 'vdo_use_' prefixes and all its underscores.
|
||||
So i.e. vdo_use_metadata_hints=1 and metadatahints=1 are equivalent.
|
||||
To change the option for an already existing VDOPoolLV use
|
||||
.BR lvchange (8)
|
||||
command. However not all option can be changed.
|
||||
Only compression and deduplication options can be also changed for an active VDO LV.
|
||||
Lowest priority options are specified with configuration file,
|
||||
then with --vdosettings and highest are expliction option --compression
|
||||
and --deduplication.
|
||||
.P
|
||||
.I Example
|
||||
.P
|
||||
.nf
|
||||
# lvchange --compression n vg/vdopool0
|
||||
# lvchange --deduplication y vg/vdopool1
|
||||
# lvcreate --vdo -L10G --vdosettings 'ack_threads=1 hash_zone_threads=2' vg/vdopool0
|
||||
# lvchange --vdosettings 'bio_threads=2 deduplication=1' vg/vdopool0
|
||||
.fi
|
||||
.
|
||||
.SS \n+[step]. Checking the usage of VDOPoolLV
|
||||
|
||||
@@ -130,8 +130,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -220,7 +221,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--noudevsync\fP
|
||||
|
||||
@@ -136,8 +136,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -204,7 +205,8 @@ metadata/record_lvs_history is enabled.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--noudevsync\fP
|
||||
|
||||
@@ -120,8 +120,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -175,7 +176,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--noudevsync\fP
|
||||
|
||||
@@ -286,8 +286,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -376,7 +377,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--nosync\fP
|
||||
|
||||
@@ -172,8 +172,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -264,7 +265,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--nosuffix\fP
|
||||
|
||||
@@ -119,8 +119,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -180,7 +181,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -179,8 +179,9 @@ multiple tags at once. See \fBlvm\fP(8) for information about tags.
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -248,7 +249,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -351,8 +351,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -435,7 +436,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -229,8 +229,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -319,7 +320,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--norestorefile\fP
|
||||
|
||||
@@ -183,8 +183,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -266,7 +267,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--nosuffix\fP
|
||||
|
||||
@@ -206,8 +206,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -271,7 +272,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--noudevsync\fP
|
||||
|
||||
@@ -103,8 +103,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -164,7 +165,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -98,8 +98,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -153,7 +154,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -169,8 +169,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -254,7 +255,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--nosuffix\fP
|
||||
|
||||
@@ -383,8 +383,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -469,7 +470,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--noudevsync\fP
|
||||
|
||||
@@ -123,8 +123,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -197,7 +198,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -208,8 +208,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -291,7 +292,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -568,8 +568,9 @@ See \fBlvm.conf\fP(5) for more information about profiles.
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -694,7 +695,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--noudevsync\fP
|
||||
|
||||
@@ -114,8 +114,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -169,7 +170,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -124,8 +124,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -206,7 +207,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -206,8 +206,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -313,7 +314,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB-s\fP|\fB--physicalextentsize\fP \fISize\fP[m|UNIT]
|
||||
|
||||
@@ -180,8 +180,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -258,7 +259,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--nosuffix\fP
|
||||
|
||||
@@ -139,8 +139,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -194,7 +195,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -147,8 +147,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -237,7 +238,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -128,8 +128,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -189,7 +190,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -113,8 +113,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -179,7 +180,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -132,8 +132,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -193,7 +194,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -107,8 +107,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -167,7 +168,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--poolmetadataspare\fP \fBy\fP|\fBn\fP
|
||||
|
||||
@@ -108,8 +108,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -169,7 +170,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -199,8 +199,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -265,7 +266,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -109,8 +109,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -170,7 +171,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--noudevsync\fP
|
||||
|
||||
@@ -133,8 +133,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -194,7 +195,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--profile\fP \fIString\fP
|
||||
|
||||
@@ -166,8 +166,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -251,7 +252,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--nosuffix\fP
|
||||
|
||||
@@ -101,8 +101,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -168,7 +169,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--notifydbus\fP
|
||||
|
||||
@@ -175,8 +175,9 @@ messages sent to the log file and/or syslog (if configured).
|
||||
.HP
|
||||
\fB--devices\fP \fIPV\fP
|
||||
.br
|
||||
Devices that the command can use. This option can be repeated
|
||||
or accepts a comma separated list of devices. This overrides
|
||||
Restricts the devices that are visible and accessible to the command.
|
||||
Devices not listed will appear to be missing. This option can be
|
||||
repeated, or accepts a comma separated list of devices. This overrides
|
||||
the devices file.
|
||||
.
|
||||
.HP
|
||||
@@ -255,7 +256,8 @@ perform standard hint file invalidation where appropriate.
|
||||
.HP
|
||||
\fB--nolocking\fP
|
||||
.br
|
||||
Disable locking.
|
||||
Disable locking. Use with caution, concurrent commands may produce
|
||||
incorrect results.
|
||||
.
|
||||
.HP
|
||||
\fB--poolmetadataspare\fP \fBy\fP|\fBn\fP
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
%enableif %{enable_dbusd} dbus-service
|
||||
%enableif %{enable_dbusd} notify-dbus
|
||||
%enableif %{enable_dmfilemapd} dmfilemapd
|
||||
%enableif %{enable_readline} readline
|
||||
%enableif %{enable_editline} editline
|
||||
|
||||
%build
|
||||
|
||||
|
||||
@@ -47,6 +47,14 @@
|
||||
%global req_udev udev >= 181-1
|
||||
|
||||
|
||||
%if %{fedora} >= 35 || %{rhel} >= 9
|
||||
%global enable_readline 0
|
||||
%global enable_editline 1
|
||||
%else
|
||||
%global enable_readline 1
|
||||
%global enable_editline 0
|
||||
%endif
|
||||
|
||||
%if %{fedora} >= 24 || %{rhel} >= 7
|
||||
%service lvmlockd 1
|
||||
%global sanlock_version 3.3.0-1
|
||||
@@ -154,7 +162,12 @@ Source94: macros.inc
|
||||
|
||||
BuildRequires: libselinux-devel >= 1.30.19-4, libsepol-devel
|
||||
BuildRequires: ncurses-devel
|
||||
%if %{enable_readline}
|
||||
BuildRequires: readline-devel
|
||||
%endif
|
||||
%if %{enable_editline}
|
||||
BuildRequires: libedit-devel
|
||||
%endif
|
||||
BuildRequires: module-init-tools
|
||||
BuildRequires: pkgconfig
|
||||
|
||||
|
||||
@@ -188,6 +188,12 @@ if test -n "$LVM_TEST_LVMLOCKD_TEST" ; then
|
||||
aux prepare_lvmlockd
|
||||
fi
|
||||
|
||||
echo "<======== Processing test: \"$TESTNAME\" ========>"
|
||||
(
|
||||
MSG="<======== Processing test: \"$TESTNAME\" ========>"
|
||||
echo "$MSG"
|
||||
echo "$MSG" > /dev/console 2>/dev/null
|
||||
logger -p user.notice "$MSG" 2>/dev/null
|
||||
true
|
||||
)
|
||||
|
||||
set -vx
|
||||
|
||||
@@ -135,6 +135,24 @@ lvmdevices --deldev "$LOOP1"
|
||||
not grep "$LOOP1" $DF
|
||||
lvmdevices --deldev "$LOOP2"
|
||||
not grep "$LOOP2" $DF
|
||||
rm $DF
|
||||
|
||||
# deldev using idname
|
||||
lvmdevices --adddev "$LOOP1"
|
||||
lvmdevices --adddev "$LOOP2"
|
||||
vgcreate $vg "$LOOP1" "$LOOP2"
|
||||
IDNAME1=`pvs "$LOOP1" --noheading -o deviceid | awk '{print $1}'`
|
||||
IDNAME2=`pvs "$LOOP2" --noheading -o deviceid | awk '{print $1}'`
|
||||
lvmdevices --deldev "$IDNAME2" --deviceidtype loop_file
|
||||
not grep "$IDNAME2" $DF
|
||||
not grep "$LOOP2" $DF
|
||||
lvmdevices --deldev "$IDNAME1" --deviceidtype loop_file
|
||||
not grep "$IDNAME1" $DF
|
||||
not grep "$LOOP1" $DF
|
||||
lvmdevices --adddev "$LOOP1"
|
||||
lvmdevices --adddev "$LOOP2"
|
||||
vgremove $vg
|
||||
rm $DF
|
||||
|
||||
# add/delpvid with default idtype loop_file
|
||||
lvmdevices --addpvid "$PVID1"
|
||||
@@ -151,6 +169,7 @@ not grep "$PVID1" $DF
|
||||
lvmdevices --delpvid "$PVID2"
|
||||
not grep "$LOOP2" $DF
|
||||
not grep "$PVID2" $DF
|
||||
rm $DF
|
||||
|
||||
# add/deldev with non-default idtype devname
|
||||
lvmdevices --adddev "$LOOP1" --deviceidtype devname
|
||||
@@ -165,6 +184,7 @@ lvmdevices --deldev "$LOOP1"
|
||||
not grep "$LOOP1" $DF
|
||||
lvmdevices --deldev "$LOOP2"
|
||||
not grep "$LOOP2" $DF
|
||||
rm $DF
|
||||
|
||||
# add/delpvid with non-default idtype devname
|
||||
lvmdevices --addpvid "$PVID1" --deviceidtype devname
|
||||
@@ -179,6 +199,7 @@ lvmdevices --deldev "$LOOP1"
|
||||
not grep "$LOOP1" $DF
|
||||
lvmdevices --deldev "$LOOP2"
|
||||
not grep "$LOOP2" $DF
|
||||
rm $DF
|
||||
|
||||
# add/deldev when dev is missing, using default idtype
|
||||
lvmdevices --adddev "$LOOP1"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
test_description='udev rule and systemd unit run vgchange'
|
||||
test_description='duplicate pv detection of mpath components using wwid'
|
||||
|
||||
SKIP_WITH_LVMPOLLD=1
|
||||
SKIP_WITH_LVMLOCKD=1
|
||||
|
||||
@@ -48,9 +48,17 @@ check grep_dmsetup status $vg-vdopool-vpool " online online "
|
||||
lvchange --compression n --deduplication n $vg/vdopool
|
||||
check grep_dmsetup status $vg-vdopool-vpool " offline offline "
|
||||
|
||||
# --vdosettings needs inactive LV
|
||||
not lvchange --vdosettings 'ack_threads=8' $vg/vdopool
|
||||
|
||||
lvchange -an $vg/$lv1
|
||||
|
||||
# With inactive vdo-pool changes are applied
|
||||
# explicit option --compression has highest priority
|
||||
lvchange --vdosettings 'ack_threads=5 compression=0' --compression y $vg/vdopool
|
||||
check lv_field $vg/$lv1 vdo_ack_threads "5"
|
||||
check lv_field $vg/$lv1 vdo_compression "enabled"
|
||||
|
||||
# Test activation
|
||||
lvchange -aly $vg/$lv1
|
||||
check active $vg $lv1
|
||||
|
||||
@@ -28,12 +28,12 @@ lvcreate -L5G -n $lv1 $vg
|
||||
not lvconvert --type vdo-pool $vg/$lv1 |& tee out
|
||||
grep "WARNING" out
|
||||
|
||||
|
||||
lvconvert -y --type vdo-pool $vg/$lv1
|
||||
# Check --vdosettings is also applied to converted vdo-pool
|
||||
lvconvert -y --type vdo-pool --vdosettings 'ack_threads=5' $vg/$lv1
|
||||
check lv_field $vg/$lv1 vdo_ack_threads "5"
|
||||
lvremove -f $vg
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
lvcreate -L5G -n $lv1 $vg
|
||||
lvconvert -y --vdopool $vg/$lv1
|
||||
lvremove -f $vg
|
||||
|
||||
@@ -79,8 +79,12 @@ not fsck -n "$DM_DEV_DIR/mapper/$vg-${lv2}"
|
||||
|
||||
lvremove -ff $vg
|
||||
|
||||
# Unknown settings does not pass
|
||||
# TODO: try to catch this in parser and 'fail'
|
||||
not lvcreate --type vdo --vdosettings 'ack_Xthreads=4' -L10G -V1T -ky -n $lv1 $vg
|
||||
|
||||
lvcreate --type vdo -L10G -V1T -ky -n $lv1 $vg
|
||||
lvcreate --type vdo --vdosettings 'ack_threads=4' -L10G -V1T -ky -n $lv1 $vg
|
||||
check lv_field $vg/$lv1 vdo_ack_threads "4"
|
||||
lvs -a $vg
|
||||
lvremove -ff $vg
|
||||
|
||||
|
||||
78
test/shell/lvextend-thin-adddel.sh
Normal file
78
test/shell/lvextend-thin-adddel.sh
Normal file
@@ -0,0 +1,78 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (C) 2022 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing to use,
|
||||
# modify, copy, or redistribute it subject to the terms and conditions
|
||||
# of the GNU General Public License v.2.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#
|
||||
# Play with thin-pool and thin removal and creation in corner cases
|
||||
#
|
||||
|
||||
SKIP_WITH_LVMLOCKD=1
|
||||
SKIP_WITH_LVMPOLLD=1
|
||||
|
||||
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
|
||||
|
||||
. lib/inittest
|
||||
|
||||
aux have_thin 1 0 0 || skip
|
||||
|
||||
test -n "$LVM_TEST_THIN_RESTORE_CMD" || LVM_TEST_THIN_RESTORE_CMD=$(which thin_restore) || skip
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -V || skip
|
||||
|
||||
aux have_thin 1 10 0 || skip
|
||||
|
||||
aux prepare_vg 2
|
||||
|
||||
lvcreate -V10 -n $lv1 -L10 -T $vg/pool
|
||||
lvcreate -V10 -n $lv2 $vg/pool
|
||||
|
||||
# Forcibly 'error' _tmeta thin-pool metadata device
|
||||
not dmsetup remove -f $vg-pool_tmeta
|
||||
|
||||
# Now try to schedule removal of thin volume id 1
|
||||
# that will fail with errored meta device
|
||||
not lvremove -y $vg/$lv1
|
||||
|
||||
# Check we have queued 'message'
|
||||
vgcfgbackup -f out0 $vg
|
||||
grep "message1" out0
|
||||
|
||||
vgchange -an $vg || true
|
||||
|
||||
not dmsetup table ${vg}-pool-tpool
|
||||
|
||||
# Reactivate thin-pool
|
||||
vgchange -ay $vg
|
||||
|
||||
# Check message is still queued there
|
||||
vgcfgbackup -f out1 $vg
|
||||
grep "message1" out1
|
||||
|
||||
lvchange -an $vg
|
||||
|
||||
lvextend -L+10 $vg/pool
|
||||
|
||||
# Messages should be now processed and gone
|
||||
vgcfgbackup -f out2 $vg
|
||||
not grep "message1" out2
|
||||
|
||||
lvchange -an $vg
|
||||
|
||||
lvchange -y -ay $vg/pool_tmeta
|
||||
|
||||
# Kernel metadata must not see dev_id 1 either
|
||||
thin_dump $DM_DEV_DIR/$vg/pool_tmeta | tee meta
|
||||
not grep 'dev_id="1"' meta
|
||||
|
||||
lvremove -ff $vg
|
||||
|
||||
lvs -a $vg
|
||||
|
||||
vgremove -ff $vg
|
||||
171
test/shell/multipath-config.sh
Normal file
171
test/shell/multipath-config.sh
Normal file
@@ -0,0 +1,171 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (C) 2021 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing to use,
|
||||
# modify, copy, or redistribute it subject to the terms and conditions
|
||||
# of the GNU General Public License v.2.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
test_description='using multipath blacklist'
|
||||
|
||||
SKIP_WITH_LVMPOLLD=1
|
||||
SKIP_WITH_LVMLOCKD=1
|
||||
|
||||
. lib/inittest
|
||||
|
||||
# FIXME: don't run this test by default because it destroys the
|
||||
# local multipath config, the timing of multipath/dm/lvm interactions
|
||||
# is fragile, and there's insufficient cleanup after a test fails.
|
||||
skip
|
||||
|
||||
systemctl stop multipathd
|
||||
multipath -F || true
|
||||
rm /etc/multipath/wwids || true
|
||||
rmmod scsi_debug || true
|
||||
rm /etc/multipath/conf.d/lvmtest.conf || true
|
||||
|
||||
modprobe --dry-run scsi_debug || skip
|
||||
multipath -l || skip
|
||||
multipath -l | grep scsi_debug && skip
|
||||
ls /etc/multipath/wwids && skip
|
||||
|
||||
# Need to use /dev/mapper/mpath
|
||||
aux lvmconf 'devices/dir = "/dev"'
|
||||
aux lvmconf 'devices/scan = "/dev"'
|
||||
# Could set filter to $MP and the component /dev/sd devs
|
||||
aux lvmconf "devices/filter = [ \"a|.*|\" ]"
|
||||
aux lvmconf "devices/global_filter = [ \"a|.*|\" ]"
|
||||
|
||||
modprobe scsi_debug dev_size_mb=16 num_tgts=1
|
||||
sleep 2
|
||||
|
||||
# Get scsi device name created by scsi_debug.
|
||||
# SD = sdh
|
||||
# SD_DEV = /dev/sdh
|
||||
|
||||
SD=$(grep -H scsi_debug /sys/block/sd*/device/model | cut -f4 -d /);
|
||||
echo $SD
|
||||
SD_DEV=/dev/$SD
|
||||
echo $SD_DEV
|
||||
|
||||
# if multipath claimed SD, then io will fail
|
||||
#dd if=$SD_DEV of=/dev/null bs=4k count=1 iflag=direct
|
||||
#dd if=/dev/zero of=$SD_DEV bs=4k count=1 oflag=direct
|
||||
|
||||
# check if multipathd claimed the scsi dev when it appears and create mp dm device
|
||||
sleep 2
|
||||
multipath -l
|
||||
# create the mp dm device
|
||||
multipath $SD_DEV
|
||||
|
||||
# Get mpath device name created by multipath.
|
||||
# MP = mpatha
|
||||
# MP_DEV = /dev/maper/mpatha
|
||||
|
||||
MP=$(multipath -l | grep scsi_debug | cut -f1 -d ' ')
|
||||
echo $MP
|
||||
MP_DEV=/dev/mapper/$MP
|
||||
echo $MP_DEV
|
||||
|
||||
dd if=$MP_DEV of=/dev/null bs=4k count=1 iflag=direct
|
||||
dd if=/dev/zero of=$MP_DEV bs=4k count=1 oflag=direct
|
||||
|
||||
# Get wwid for the mp and sd dev.
|
||||
WWID=$(multipath -l $MP_DEV | head -1 | awk '{print $2}' | tr -d ')' | tr -d '(')
|
||||
echo $WWID
|
||||
|
||||
grep $WWID /etc/multipath/wwids
|
||||
|
||||
pvcreate $MP_DEV
|
||||
vgcreate $vg1 $MP_DEV
|
||||
|
||||
not pvs $SD_DEV
|
||||
pvs $MP_DEV
|
||||
|
||||
# remove mpath dm device then check that SD_DEV is
|
||||
# filtered based on /etc/multipath/wwids instead of
|
||||
# based on sysfs holder
|
||||
multipath -f $MP
|
||||
sleep 2
|
||||
not pvs $SD_DEV
|
||||
multipath $SD_DEV
|
||||
sleep 2
|
||||
multipath -l | grep $SD
|
||||
|
||||
#
|
||||
# Add the wwid to the blacklist, then restart multipath
|
||||
# so the sd dev should no longer be used by multipath,
|
||||
# but the sd dev wwid is still in /etc/multipath/wwids.
|
||||
#
|
||||
|
||||
mkdir /etc/multipath/conf.d/ || true
|
||||
rm -f /etc/multipath/conf.d/lvmtest.conf
|
||||
|
||||
cat <<EOF > "/etc/multipath/conf.d/lvmtest.conf"
|
||||
blacklist {
|
||||
wwid $WWID
|
||||
}
|
||||
EOF
|
||||
|
||||
cat /etc/multipath/conf.d/lvmtest.conf
|
||||
|
||||
multipath -r
|
||||
sleep 2
|
||||
|
||||
grep $WWID /etc/multipath/wwids
|
||||
|
||||
multipath -l |tee out
|
||||
not grep $SD out
|
||||
not grep $MP out
|
||||
not grep $WWID out
|
||||
|
||||
not pvs $MP_DEV
|
||||
pvs $SD_DEV
|
||||
vgs $vg1
|
||||
|
||||
#
|
||||
# Add the wwid to the blacklist_exceptions, in addition
|
||||
# to the blacklist, then restart multipath so the
|
||||
# sd dev should again be used by multipath.
|
||||
#
|
||||
|
||||
rm -f /etc/multipath/conf.d/lvmtest.conf
|
||||
|
||||
cat <<EOF > "/etc/multipath/conf.d/lvmtest.conf"
|
||||
blacklist {
|
||||
wwid $WWID
|
||||
}
|
||||
blacklist_exceptions {
|
||||
wwid $WWID
|
||||
}
|
||||
EOF
|
||||
|
||||
cat /etc/multipath/conf.d/lvmtest.conf
|
||||
|
||||
multipath -r
|
||||
sleep 2
|
||||
|
||||
grep $WWID /etc/multipath/wwids
|
||||
|
||||
multipath -l |tee out
|
||||
grep $SD out
|
||||
grep $MP out
|
||||
grep $WWID out
|
||||
|
||||
pvs $MP_DEV
|
||||
not pvs $SD_DEV
|
||||
vgs $vg1
|
||||
lvs $vg1
|
||||
|
||||
sleep 2
|
||||
vgremove -ff $vg1
|
||||
sleep 2
|
||||
multipath -f $MP
|
||||
rm /etc/multipath/conf.d/lvmtest.conf
|
||||
rm /etc/multipath/wwids
|
||||
sleep 1
|
||||
rmmod scsi_debug
|
||||
@@ -37,7 +37,7 @@ bool register_test(struct test_suite *ts,
|
||||
void test_fail(const char *fmt, ...)
|
||||
__attribute__((noreturn, format (printf, 1, 2)));
|
||||
|
||||
#define T_ASSERT(e) do {if (!(e)) {test_fail("assertion failed: '%s'", # e);} } while(0)
|
||||
#define T_ASSERT(e) do {if (!(e)) {test_fail("assertion failed: '%s' at %s:%d", # e, __FILE__, __LINE__);} } while(0)
|
||||
#define T_ASSERT_EQUAL(x, y) T_ASSERT((x) == (y))
|
||||
#define T_ASSERT_NOT_EQUAL(x, y) T_ASSERT((x) != (y))
|
||||
|
||||
|
||||
25
tools/args.h
25
tools/args.h
@@ -46,8 +46,12 @@ arg(addtag_ARG, '\0', "addtag", tag_VAL, ARG_GROUPABLE, 0,
|
||||
|
||||
arg(adddev_ARG, '\0', "adddev", pv_VAL, 0, 0,
|
||||
"Add a device to the devices file.\n")
|
||||
arg(deldev_ARG, '\0', "deldev", pv_VAL, 0, 0,
|
||||
"Remove a device from the devices file.\n")
|
||||
|
||||
arg(deldev_ARG, '\0', "deldev", string_VAL, 0, 0,
|
||||
"Remove a device from the devices file.\n"
|
||||
"When used alone, --deldev specifies a device name.\n"
|
||||
"When used with --deviceidtype, --deldev specifies a device id.\n")
|
||||
|
||||
arg(addpvid_ARG, '\0', "addpvid", string_VAL, 0, 0,
|
||||
"Find a device with the PVID and add the device to the devices file.\n")
|
||||
arg(delpvid_ARG, '\0', "delpvid", string_VAL, 0, 0,
|
||||
@@ -241,8 +245,9 @@ arg(deviceidtype_ARG, '\0', "deviceidtype", string_VAL, 0, 0,
|
||||
"then it will override the default type that lvm would use.\n")
|
||||
|
||||
arg(devices_ARG, '\0', "devices", pv_VAL, ARG_GROUPABLE, 0,
|
||||
"Devices that the command can use. This option can be repeated\n"
|
||||
"or accepts a comma separated list of devices. This overrides\n"
|
||||
"Restricts the devices that are visible and accessible to the command.\n"
|
||||
"Devices not listed will appear to be missing. This option can be\n"
|
||||
"repeated, or accepts a comma separated list of devices. This overrides\n"
|
||||
"the devices file.\n")
|
||||
|
||||
arg(devicesfile_ARG, '\0', "devicesfile", string_VAL, 0, 0,
|
||||
@@ -499,7 +504,8 @@ arg(nohistory_ARG, '\0', "nohistory", 0, 0, 0,
|
||||
"metadata/record_lvs_history is enabled.\n")
|
||||
|
||||
arg(nolocking_ARG, '\0', "nolocking", 0, 0, 0,
|
||||
"Disable locking.\n")
|
||||
"Disable locking. Use with caution, concurrent commands may produce\n"
|
||||
"incorrect results.\n")
|
||||
|
||||
arg(norestorefile_ARG, '\0', "norestorefile", 0, 0, 0,
|
||||
"In conjunction with --uuid, this allows a uuid to be specified\n"
|
||||
@@ -906,6 +912,15 @@ arg(vdopool_ARG, '\0', "vdopool", lv_VAL, 0, 0,
|
||||
"The name of a VDO pool LV.\n"
|
||||
"See \\fBlvmvdo\\fP(7) for more information about VDO usage.\n")
|
||||
|
||||
arg(vdosettings_ARG, '\0', "vdosettings", string_VAL, ARG_GROUPABLE, 0,
|
||||
"Specifies tunable VDO options for VDO LVs.\n"
|
||||
"Use the form 'option=value' or 'option1=value option2=value', or\n"
|
||||
"repeat --vdosettings for each option being set.\n"
|
||||
"These settings override the default VDO behaviors.\n"
|
||||
"To remove vdosettings and revert to the default\n"
|
||||
"VDO behaviors, use --vdosettings 'default'.\n"
|
||||
"See \\fBlvmvdo\\fP(7) for more information.\n")
|
||||
|
||||
arg(version_ARG, '\0', "version", 0, 0, 0,
|
||||
"Display version information.\n")
|
||||
|
||||
|
||||
@@ -243,6 +243,7 @@ OO_LVCHANGE_META: --addtag Tag, --deltag Tag,
|
||||
--setautoactivation Bool, --errorwhenfull Bool, --discards Discards, --zero Bool,
|
||||
--cachemode CacheMode, --cachepolicy String, --cachesettings String,
|
||||
--minrecoveryrate SizeKB, --maxrecoveryrate SizeKB,
|
||||
--vdosettings String,
|
||||
--writebehind Number, --writemostly WriteMostlyPV, --persistent n
|
||||
|
||||
# It's unfortunate that activate needs to be optionally allowed here;
|
||||
@@ -341,7 +342,8 @@ OO_LVCONVERT_CACHE: --cachemetadataformat CacheMetadataFormat,
|
||||
--cachesettings String, --zero Bool
|
||||
|
||||
OO_LVCONVERT_VDO: --metadataprofile String, --readahead Readahead,
|
||||
--compression Bool, --deduplication Bool, --zero Bool
|
||||
--compression Bool, --deduplication Bool, --vdosettings String,
|
||||
--zero Bool
|
||||
|
||||
OO_LVCONVERT: --alloc Alloc, --background, --force, --noudevsync
|
||||
|
||||
@@ -839,7 +841,7 @@ OO_LVCREATE_POOL: --poolmetadatasize SizeMB, --poolmetadataspare Bool, --chunksi
|
||||
|
||||
OO_LVCREATE_THINPOOL: --discards Discards, --errorwhenfull Bool
|
||||
|
||||
OO_LVCREATE_VDO: --compression Bool, --deduplication Bool
|
||||
OO_LVCREATE_VDO: --compression Bool, --deduplication Bool, --vdosettings String
|
||||
---
|
||||
|
||||
lvcreate --type error --size SizeMB VG
|
||||
@@ -1434,7 +1436,8 @@ OO: --deviceidtype String
|
||||
ID: lvmdevices_edit
|
||||
DESC: Add a device to the devices file.
|
||||
|
||||
lvmdevices --deldev PV
|
||||
lvmdevices --deldev PV|String
|
||||
OO: --deviceidtype String
|
||||
ID: lvmdevices_edit
|
||||
DESC: Remove a device from the devices file.
|
||||
|
||||
|
||||
@@ -755,6 +755,43 @@ out:
|
||||
return r;
|
||||
}
|
||||
|
||||
static int _lvchange_vdo(struct cmd_context *cmd,
|
||||
struct logical_volume *lv,
|
||||
uint32_t *mr)
|
||||
{
|
||||
struct lv_segment *seg;
|
||||
int updated = 0;
|
||||
|
||||
seg = first_seg(lv);
|
||||
|
||||
// With VDO LV given flip to VDO pool
|
||||
if (seg_is_vdo(seg))
|
||||
seg = first_seg(seg_lv(seg, 0));
|
||||
|
||||
if (!get_vdo_settings(cmd, &seg->vdo_params, &updated))
|
||||
return_0;
|
||||
|
||||
if ((updated & VDO_CHANGE_OFFLINE) &&
|
||||
lv_info(cmd, seg->lv, 1, NULL, 0, 0)) {
|
||||
log_error("Cannot change VDO settings for active VDO pool %s.",
|
||||
display_lvname(seg->lv));
|
||||
// TODO maybe add --force support with prompt here
|
||||
log_print_unless_silent("VDO pool %s with all its LVs needs to be deactivated.",
|
||||
display_lvname(seg->lv));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (updated) {
|
||||
if (!dm_vdo_validate_target_params(&seg->vdo_params, 0 /* vdo_size */))
|
||||
return_0;
|
||||
|
||||
/* Request caller to commit and reload metadata */
|
||||
*mr |= MR_RELOAD;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int _lvchange_tag(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
int arg, uint32_t *mr)
|
||||
{
|
||||
@@ -1154,6 +1191,7 @@ static int _option_requires_direct_commit(int opt_enum)
|
||||
cachemode_ARG,
|
||||
cachepolicy_ARG,
|
||||
cachesettings_ARG,
|
||||
vdosettings_ARG,
|
||||
-1
|
||||
};
|
||||
|
||||
@@ -1354,7 +1392,10 @@ static int _lvchange_properties_single(struct cmd_context *cmd,
|
||||
docmds++;
|
||||
doit += _lvchange_cache(cmd, lv, &mr);
|
||||
break;
|
||||
|
||||
case vdosettings_ARG:
|
||||
docmds++;
|
||||
doit += _lvchange_vdo(cmd, lv, &mr);
|
||||
break;
|
||||
default:
|
||||
log_error(INTERNAL_ERROR "Failed to check for option %s",
|
||||
arg_long_option_name(i));
|
||||
|
||||
@@ -5454,13 +5454,8 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd,
|
||||
if (!fill_vdo_target_params(cmd, &vdo_params, &vdo_pool_header_size, vg->profile))
|
||||
goto_out;
|
||||
|
||||
if (arg_is_set(cmd, compression_ARG))
|
||||
vdo_params.use_compression =
|
||||
arg_int_value(cmd, compression_ARG, 0);
|
||||
|
||||
if (arg_is_set(cmd, deduplication_ARG))
|
||||
vdo_params.use_deduplication =
|
||||
arg_int_value(cmd, deduplication_ARG, 0);
|
||||
if (!get_vdo_settings(cmd, &vdo_params, NULL))
|
||||
return_0;
|
||||
|
||||
if (!activate_lv(cmd, lv)) {
|
||||
log_error("Cannot activate %s.", display_lvname(lv));
|
||||
@@ -6070,6 +6065,69 @@ bad:
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int _check_writecache_memory(struct cmd_context *cmd, struct logical_volume *lv_fast,
|
||||
uint32_t block_size_sectors)
|
||||
{
|
||||
char line[128];
|
||||
FILE *fp;
|
||||
uint64_t cachevol_size_bytes = lv_fast->size * SECTOR_SIZE;
|
||||
uint64_t need_mem_bytes = 0;
|
||||
uint64_t proc_mem_bytes = 0;
|
||||
uint64_t need_mem_gb;
|
||||
uint64_t proc_mem_gb;
|
||||
unsigned long long proc_mem_kb = 0;
|
||||
|
||||
if (!(fp = fopen("/proc/meminfo", "r")))
|
||||
goto skip_proc;
|
||||
|
||||
while (fgets(line, sizeof(line), fp)) {
|
||||
if (strncmp(line, "MemTotal:", 9))
|
||||
continue;
|
||||
if (sscanf(line, "%*s%llu%*s", &proc_mem_kb) != 1)
|
||||
break;
|
||||
break;
|
||||
}
|
||||
(void)fclose(fp);
|
||||
|
||||
proc_mem_bytes = proc_mem_kb * 1024;
|
||||
|
||||
skip_proc:
|
||||
/* dm-writecache memory consumption per block is 88 bytes */
|
||||
if (block_size_sectors == 8) {
|
||||
need_mem_bytes = cachevol_size_bytes * 88 / 4096;
|
||||
} else if (block_size_sectors == 1) {
|
||||
need_mem_bytes = cachevol_size_bytes * 88 / 512;
|
||||
} else {
|
||||
/* shouldn't happen */
|
||||
log_warn("Unknown memory usage for unknown writecache block_size_sectors %u", block_size_sectors);
|
||||
return 1;
|
||||
}
|
||||
|
||||
need_mem_gb = need_mem_bytes / 1073741824;
|
||||
proc_mem_gb = proc_mem_bytes / 1073741824;
|
||||
|
||||
/*
|
||||
* warn if writecache needs > 50% of main memory, and
|
||||
* confirm if writecache needs > 90% of main memory.
|
||||
*/
|
||||
if (need_mem_bytes >= (proc_mem_bytes / 2)) {
|
||||
log_warn("WARNING: writecache size %s will use %llu GiB of system memory (%llu GiB).",
|
||||
display_size(cmd, lv_fast->size),
|
||||
(unsigned long long)need_mem_gb,
|
||||
(unsigned long long)proc_mem_gb);
|
||||
|
||||
if (need_mem_gb >= (proc_mem_gb * 9 / 10)) {
|
||||
if (!arg_is_set(cmd, yes_ARG) &&
|
||||
yes_no_prompt("Continue adding writecache? [y/n]: ") == 'n') {
|
||||
log_error("Conversion aborted.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int lvconvert_writecache_attach_single(struct cmd_context *cmd,
|
||||
struct logical_volume *lv,
|
||||
struct processing_handle *handle)
|
||||
@@ -6158,6 +6216,12 @@ int lvconvert_writecache_attach_single(struct cmd_context *cmd,
|
||||
goto_bad;
|
||||
}
|
||||
|
||||
if (!_check_writecache_memory(cmd, lv_fast, block_size_sectors)) {
|
||||
if (!is_active && !deactivate_lv(cmd, lv))
|
||||
stack;
|
||||
goto_bad;
|
||||
}
|
||||
|
||||
if (!is_active) {
|
||||
if (!deactivate_lv(cmd, lv)) {
|
||||
log_error("Failed to deactivate LV after checking block size %s", display_lvname(lv));
|
||||
|
||||
@@ -698,6 +698,23 @@ static int _read_cache_params(struct cmd_context *cmd,
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int _read_vdo_params(struct cmd_context *cmd,
|
||||
struct lvcreate_params *lp)
|
||||
{
|
||||
if (!seg_is_vdo(lp))
|
||||
return 1;
|
||||
|
||||
// prefiling settings here
|
||||
if (!fill_vdo_target_params(cmd, &lp->vdo_params, &lp->vdo_pool_header_size, NULL))
|
||||
return_0;
|
||||
|
||||
// override with optional vdo settings
|
||||
if (!get_vdo_settings(cmd, &lp->vdo_params, NULL))
|
||||
return_0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int _read_activation_params(struct cmd_context *cmd,
|
||||
struct volume_group *vg,
|
||||
struct lvcreate_params *lp)
|
||||
@@ -888,7 +905,8 @@ static int _lvcreate_params(struct cmd_context *cmd,
|
||||
#define VDO_POOL_ARGS \
|
||||
vdopool_ARG,\
|
||||
compression_ARG,\
|
||||
deduplication_ARG
|
||||
deduplication_ARG,\
|
||||
vdosettings_ARG
|
||||
|
||||
/* Cache and cache-pool segment type */
|
||||
if (seg_is_cache(lp)) {
|
||||
@@ -1098,19 +1116,6 @@ static int _lvcreate_params(struct cmd_context *cmd,
|
||||
zero_ARG,
|
||||
-1))
|
||||
return_0;
|
||||
|
||||
// FIXME: prefiling here - this is wrong place
|
||||
// but will work for this moment
|
||||
if (!fill_vdo_target_params(cmd, &lp->vdo_params, &lp->vdo_pool_header_size, NULL))
|
||||
return_0;
|
||||
|
||||
if (arg_is_set(cmd, compression_ARG))
|
||||
lp->vdo_params.use_compression =
|
||||
arg_int_value(cmd, compression_ARG, 0);
|
||||
|
||||
if (arg_is_set(cmd, deduplication_ARG))
|
||||
lp->vdo_params.use_deduplication =
|
||||
arg_int_value(cmd, deduplication_ARG, 0);
|
||||
}
|
||||
|
||||
/* Check options shared between more segment types */
|
||||
@@ -1198,6 +1203,7 @@ static int _lvcreate_params(struct cmd_context *cmd,
|
||||
&lp->pool_metadata_size, &lp->pool_metadata_spare,
|
||||
&lp->chunk_size, &lp->discards, &lp->zero_new_blocks)) ||
|
||||
!_read_cache_params(cmd, lp) ||
|
||||
!_read_vdo_params(cmd, lp) ||
|
||||
!_read_mirror_and_raid_params(cmd, lp))
|
||||
return_0;
|
||||
|
||||
|
||||
@@ -3267,10 +3267,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
|
||||
if (arg_is_set(cmd, readonly_ARG))
|
||||
readonly = 1;
|
||||
|
||||
if (cmd->nolocking) {
|
||||
if (!_cmd_no_meta_proc(cmd))
|
||||
log_warn("WARNING: File locking is disabled.");
|
||||
} else {
|
||||
if (!cmd->nolocking) {
|
||||
if (!init_locking(cmd, sysinit, readonly, cmd->ignorelockingfailure)) {
|
||||
ret = ECMD_FAILED;
|
||||
goto_out;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "lib/cache/lvmcache.h"
|
||||
#include "lib/device/device_id.h"
|
||||
#include "lib/device/dev-type.h"
|
||||
#include "lib/filters/filter.h"
|
||||
|
||||
/* coverity[unnecessary_header] needed for MuslC */
|
||||
#include <sys/file.h>
|
||||
@@ -112,7 +113,7 @@ static void _search_devs_for_pvids(struct cmd_context *cmd, struct dm_list *sear
|
||||
dev = devl->dev;
|
||||
cmd->filter->wipe(cmd, cmd->filter, dev, NULL);
|
||||
if (!cmd->filter->passes_filter(cmd, cmd->filter, dev, NULL)) {
|
||||
log_warn("WARNING: PVID %s found on %s which is excluded by filter: %s",
|
||||
log_warn("WARNING: PVID %s found on %s which is excluded: %s",
|
||||
dev->pvid, dev_name(dev), dev_filtered_reason(dev));
|
||||
dm_list_del(&devl->list);
|
||||
}
|
||||
@@ -182,6 +183,7 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
|
||||
device_ids_match(cmd);
|
||||
|
||||
if (arg_is_set(cmd, check_ARG) || arg_is_set(cmd, update_ARG)) {
|
||||
int update_set = arg_is_set(cmd, update_ARG);
|
||||
int search_count = 0;
|
||||
int update_needed = 0;
|
||||
int invalid = 0;
|
||||
@@ -230,6 +232,47 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
|
||||
if (invalid)
|
||||
update_needed = 1;
|
||||
|
||||
/*
|
||||
* Remove multipath components.
|
||||
* Add multipath devs that had components listed.
|
||||
*/
|
||||
dm_list_iterate_items_safe(du, du2, &cmd->use_devices) {
|
||||
dev_t mpath_devno;
|
||||
struct device *mpath_dev;
|
||||
|
||||
if (!du->dev)
|
||||
continue;
|
||||
dev = du->dev;
|
||||
|
||||
if (!(dev->filtered_flags & DEV_FILTERED_MPATH_COMPONENT))
|
||||
continue;
|
||||
|
||||
/* redundant given the flag check, but used to get devno */
|
||||
if (!dev_is_mpath_component(cmd, dev, &mpath_devno))
|
||||
continue;
|
||||
|
||||
update_needed = 1;
|
||||
if (update_set) {
|
||||
log_print("Removing multipath component %s.", dev_name(du->dev));
|
||||
dm_list_del(&du->list);
|
||||
}
|
||||
|
||||
if (!(mpath_dev = dev_cache_get_by_devt(cmd, mpath_devno)))
|
||||
continue;
|
||||
|
||||
if (!get_du_for_dev(cmd, mpath_dev)) {
|
||||
if (update_set) {
|
||||
log_print("Adding multipath device %s for multipath component %s.",
|
||||
dev_name(mpath_dev), dev_name(du->dev));
|
||||
if (!device_id_add(cmd, mpath_dev, dev->pvid, NULL, NULL))
|
||||
stack;
|
||||
} else {
|
||||
log_print("Missing multipath device %s for multipath component %s.",
|
||||
dev_name(mpath_dev), dev_name(du->dev));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Find and fix any devname entries that have moved to a
|
||||
* renamed device.
|
||||
@@ -310,7 +353,7 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
|
||||
cmd->filter_deviceid_skip = 1;
|
||||
|
||||
if (!cmd->filter->passes_filter(cmd, cmd->filter, dev, NULL)) {
|
||||
log_warn("WARNING: adding device %s that is excluded by filter: %s.",
|
||||
log_warn("WARNING: adding device %s that is excluded: %s.",
|
||||
dev_name(dev), dev_filtered_reason(dev));
|
||||
}
|
||||
|
||||
@@ -373,12 +416,15 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (arg_is_set(cmd, deldev_ARG)) {
|
||||
if (arg_is_set(cmd, deldev_ARG) && !arg_is_set(cmd, deviceidtype_ARG)) {
|
||||
const char *devname;
|
||||
|
||||
if (!(devname = arg_str_value(cmd, deldev_ARG, NULL)))
|
||||
goto_bad;
|
||||
|
||||
if (strncmp(devname, "/dev/", 5))
|
||||
log_warn("WARNING: to remove a device by device id, include --deviceidtype.");
|
||||
|
||||
/*
|
||||
* No filter because we always want to allow removing a device
|
||||
* by name from the devices file.
|
||||
@@ -410,6 +456,48 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* By itself, --deldev <devname> specifies a device name to remove.
|
||||
* With an id type specified, --deldev specifies a device id to remove:
|
||||
* --deldev <idname> --deviceidtype <idtype>
|
||||
*/
|
||||
if (arg_is_set(cmd, deldev_ARG) && arg_is_set(cmd, deviceidtype_ARG)) {
|
||||
const char *idtype_str = arg_str_value(cmd, deviceidtype_ARG, NULL);
|
||||
const char *idname = arg_str_value(cmd, deldev_ARG, NULL);
|
||||
int idtype;
|
||||
|
||||
if (!idtype_str || !idname || !strlen(idname) || !strlen(idtype_str))
|
||||
goto_bad;
|
||||
|
||||
if (!(idtype = idtype_from_str(idtype_str))) {
|
||||
log_error("Unknown device_id type.");
|
||||
goto_bad;
|
||||
}
|
||||
|
||||
if (!strncmp(idname, "/dev/", 5))
|
||||
log_warn("WARNING: to remove a device by name, do not include --deviceidtype.");
|
||||
|
||||
if (!(du = get_du_for_device_id(cmd, idtype, idname))) {
|
||||
log_error("No devices file entry with device id %s %s.", idtype_str, idname);
|
||||
goto_bad;
|
||||
}
|
||||
|
||||
dev = du->dev;
|
||||
|
||||
if (dev && dev_is_used_by_active_lv(cmd, dev, NULL, NULL, NULL, NULL)) {
|
||||
if (!arg_count(cmd, yes_ARG) &&
|
||||
yes_no_prompt("Device %s is used by an active LV, continue to remove? ", dev_name(dev)) == 'n') {
|
||||
log_error("Device not removed.");
|
||||
goto bad;
|
||||
}
|
||||
}
|
||||
|
||||
dm_list_del(&du->list);
|
||||
free_du(du);
|
||||
device_ids_write(cmd);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (arg_is_set(cmd, delpvid_ARG)) {
|
||||
struct id id;
|
||||
char pvid[ID_LEN+1] = { 0 };
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "lib/metadata/metadata.h"
|
||||
#include "lib/label/hints.h"
|
||||
#include "lib/device/online.h"
|
||||
#include "lib/filters/filter.h"
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
@@ -1435,6 +1436,27 @@ static int _pvscan_cache_all(struct cmd_context *cmd, int argc, char **argv,
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* If /dev/sda* of /dev/vda* is excluded by the devices file
|
||||
* it's usually a misconfiguration that prevents proper booting,
|
||||
* so make it a special case to give extra info to help debugging.
|
||||
*/
|
||||
static void _warn_excluded_root(struct cmd_context *cmd, struct device *dev)
|
||||
{
|
||||
struct dev_use *du;
|
||||
const char *cur_idname;
|
||||
|
||||
if (!(du = get_du_for_devname(cmd, dev_name(dev)))) {
|
||||
log_warn("WARNING: no autoactivation for %s: not found in system.devices.", dev_name(dev));
|
||||
return;
|
||||
}
|
||||
|
||||
cur_idname = device_id_system_read(cmd, dev, du->idtype);
|
||||
|
||||
log_warn("WARNING: no autoactivation for %s: system.devices %s current %s.",
|
||||
dev_name(dev), du->idname, cur_idname ?: "missing device id");
|
||||
}
|
||||
|
||||
static int _pvscan_cache_args(struct cmd_context *cmd, int argc, char **argv,
|
||||
struct dm_list *complete_vgnames)
|
||||
{
|
||||
@@ -1542,9 +1564,15 @@ static int _pvscan_cache_args(struct cmd_context *cmd, int argc, char **argv,
|
||||
|
||||
dm_list_iterate_items_safe(devl, devl2, &pvscan_devs) {
|
||||
if (!cmd->filter->passes_filter(cmd, cmd->filter, devl->dev, NULL)) {
|
||||
log_print_pvscan(cmd, "%s excluded by filters: %s.",
|
||||
log_print_pvscan(cmd, "%s excluded: %s.",
|
||||
dev_name(devl->dev), dev_filtered_reason(devl->dev));
|
||||
dm_list_del(&devl->list);
|
||||
|
||||
/* Special case warning when probable root dev is missing from system.devices */
|
||||
if ((devl->dev->filtered_flags & DEV_FILTERED_DEVICES_FILE) &&
|
||||
(!strncmp(dev_name(devl->dev), "/dev/sda", 8) ||
|
||||
!strncmp(dev_name(devl->dev), "/dev/vda", 8)))
|
||||
_warn_excluded_root(cmd, devl->dev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1599,7 +1627,7 @@ static int _pvscan_cache_args(struct cmd_context *cmd, int argc, char **argv,
|
||||
|
||||
/* Applies all filters, including those that need data from dev. */
|
||||
if (!cmd->filter->passes_filter(cmd, cmd->filter, devl->dev, NULL)) {
|
||||
log_print_pvscan(cmd, "%s excluded by filters: %s.",
|
||||
log_print_pvscan(cmd, "%s excluded: %s.",
|
||||
dev_name(devl->dev), dev_filtered_reason(devl->dev));
|
||||
dm_list_del(&devl->list);
|
||||
}
|
||||
@@ -1710,13 +1738,11 @@ int pvscan_cache_cmd(struct cmd_context *cmd, int argc, char **argv)
|
||||
}
|
||||
|
||||
/*
|
||||
* If obtain_device_list_from_udev was set to 1, force it to 0.
|
||||
* Don't ask udev for info since pvscan is running from udev.
|
||||
* If a pvscan attempts to get dev info from udev, udev can
|
||||
* repeatedly return errors about the dev not being initialized
|
||||
* which will stall the pvscan.
|
||||
* Do not use udev for device listing or device info because pvscan
|
||||
* is used to populate udev info.
|
||||
*/
|
||||
init_obtain_device_list_from_udev(0);
|
||||
init_external_device_info_source(DEV_EXT_NONE);
|
||||
|
||||
if (arg_is_set(cmd, major_ARG) + arg_is_set(cmd, minor_ARG))
|
||||
devno_args = 1;
|
||||
|
||||
184
tools/toollib.c
184
tools/toollib.c
@@ -1200,6 +1200,183 @@ out:
|
||||
return ok;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare VDO option name, skip any '_' in name
|
||||
* and also allow to use it without vdo_[use_] prefix
|
||||
*/
|
||||
static int _compare_vdo_option(const char *b1, const char *b2)
|
||||
{
|
||||
if (strncasecmp(b1, "vdo", 3) == 0) // skip vdo prefix
|
||||
b1 += 3;
|
||||
|
||||
if ((tolower(*b1) != tolower(*b2)) &&
|
||||
(strncmp(b2, "use_", 4) == 0))
|
||||
b2 += 4; // try again with skipped prefix 'use_'
|
||||
|
||||
while (*b1 && *b2) {
|
||||
if (tolower(*b1) == tolower(*b2)) {
|
||||
++b1;
|
||||
++b2;
|
||||
continue; // matching char
|
||||
}
|
||||
|
||||
if (*b1 == '_')
|
||||
++b1; // skip to next char
|
||||
else if (*b2 == '_')
|
||||
++b2; // skip to next char
|
||||
else
|
||||
break; // mismatch
|
||||
}
|
||||
|
||||
return (*b1 || *b2) ? 0 : 1;
|
||||
}
|
||||
|
||||
#define CHECK_AND_SET(var, onoff) \
|
||||
option = #var;\
|
||||
if (_compare_vdo_option(cn->key, option)) {\
|
||||
if (is_lvchange || !cn->v || (cn->v->type != DM_CFG_INT))\
|
||||
goto err;\
|
||||
if (vtp->var != cn->v->v.i) {\
|
||||
vtp->var = cn->v->v.i;\
|
||||
u |= onoff;\
|
||||
}\
|
||||
continue;\
|
||||
}
|
||||
|
||||
#define DO_OFFLINE(var) \
|
||||
CHECK_AND_SET(var, VDO_CHANGE_OFFLINE)
|
||||
|
||||
#define DO_ONLINE(var) \
|
||||
CHECK_AND_SET(var, VDO_CHANGE_ONLINE)
|
||||
|
||||
int get_vdo_settings(struct cmd_context *cmd,
|
||||
struct dm_vdo_target_params *vtp,
|
||||
int *updated)
|
||||
{
|
||||
const char *str, *option = NULL;
|
||||
struct arg_value_group_list *group;
|
||||
struct dm_config_tree *result = NULL, *prev = NULL, *current = NULL;
|
||||
struct dm_config_node *cn;
|
||||
int r = 0, u = 0, is_lvchange;
|
||||
int use_compression = vtp->use_compression;
|
||||
int use_deduplication = vtp->use_deduplication;
|
||||
int checked_lvchange;
|
||||
|
||||
if (updated)
|
||||
*updated = 0;
|
||||
|
||||
// Group all --vdosettings
|
||||
dm_list_iterate_items(group, &cmd->arg_value_groups) {
|
||||
if (!grouped_arg_is_set(group->arg_values, vdosettings_ARG))
|
||||
continue;
|
||||
|
||||
if (!(current = dm_config_create()))
|
||||
goto_out;
|
||||
if (prev)
|
||||
current->cascade = prev;
|
||||
prev = current;
|
||||
|
||||
if (!(str = grouped_arg_str_value(group->arg_values,
|
||||
vdosettings_ARG,
|
||||
NULL)))
|
||||
goto_out;
|
||||
|
||||
if (!dm_config_parse_without_dup_node_check(current, str, str + strlen(str)))
|
||||
goto_out;
|
||||
}
|
||||
|
||||
if (current) {
|
||||
if (!(result = dm_config_flatten(current)))
|
||||
goto_out;
|
||||
|
||||
checked_lvchange = !strcmp(cmd->name, "lvchange");
|
||||
|
||||
/* Use all acceptable VDO options */
|
||||
for (cn = result->root; cn; cn = cn->sib) {
|
||||
is_lvchange = 0;
|
||||
DO_OFFLINE(ack_threads);
|
||||
DO_OFFLINE(bio_rotation);
|
||||
DO_OFFLINE(bio_threads);
|
||||
DO_OFFLINE(block_map_cache_size_mb);
|
||||
DO_OFFLINE(block_map_era_length);
|
||||
DO_OFFLINE(block_map_period); // alias for block_map_era_length
|
||||
DO_OFFLINE(cpu_threads);
|
||||
DO_OFFLINE(hash_zone_threads);
|
||||
DO_OFFLINE(logical_threads);
|
||||
DO_OFFLINE(max_discard);
|
||||
DO_OFFLINE(physical_threads);
|
||||
|
||||
// Support also these - even when we have regular opts for them
|
||||
DO_ONLINE(use_compression);
|
||||
DO_ONLINE(use_deduplication);
|
||||
|
||||
// Settings bellow cannot be changed with lvchange command
|
||||
is_lvchange = checked_lvchange;
|
||||
|
||||
DO_OFFLINE(check_point_frequency);
|
||||
DO_OFFLINE(index_memory_size_mb);
|
||||
DO_OFFLINE(minimum_io_size);
|
||||
DO_OFFLINE(slab_size_mb);
|
||||
DO_OFFLINE(use_metadata_hints);
|
||||
DO_OFFLINE(use_sparse_index);
|
||||
|
||||
option = "write_policy";
|
||||
if (_compare_vdo_option(cn->key, option)) {
|
||||
if (is_lvchange || !cn->v || (cn->v->type != DM_CFG_STRING))
|
||||
goto err;
|
||||
if (!set_vdo_write_policy(&vtp->write_policy, cn->v->v.str))
|
||||
goto_out;
|
||||
u |= VDO_CHANGE_OFFLINE;
|
||||
continue;
|
||||
}
|
||||
|
||||
log_error("Unknown VDO setting \"%s\".", cn->key);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (arg_is_set(cmd, compression_ARG)) {
|
||||
vtp->use_compression = arg_int_value(cmd, compression_ARG, 0);
|
||||
if (vtp->use_compression != use_compression)
|
||||
u |= VDO_CHANGE_ONLINE;
|
||||
}
|
||||
|
||||
if (arg_is_set(cmd, deduplication_ARG)) {
|
||||
vtp->use_deduplication = arg_int_value(cmd, deduplication_ARG, 0);
|
||||
if (vtp->use_deduplication != use_deduplication)
|
||||
u |= VDO_CHANGE_ONLINE;
|
||||
}
|
||||
|
||||
if (updated) {
|
||||
// validation of updated VDO option
|
||||
if (!dm_vdo_validate_target_params(vtp, 0 /* vdo_size */)) {
|
||||
err:
|
||||
if (is_lvchange)
|
||||
log_error("Cannot change VDO setting \"vdo_%s\" in existing VDO pool.",
|
||||
option);
|
||||
else
|
||||
log_error("Invalid argument for VDO setting \"vdo_%s\".",
|
||||
option);
|
||||
goto out;
|
||||
}
|
||||
|
||||
*updated = u;
|
||||
}
|
||||
|
||||
r = 1;
|
||||
out:
|
||||
if (result)
|
||||
dm_config_destroy(result);
|
||||
|
||||
while (prev) {
|
||||
current = prev->cascade;
|
||||
dm_config_destroy(prev);
|
||||
prev = current;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static int _get_one_writecache_setting(struct cmd_context *cmd, struct writecache_settings *settings,
|
||||
char *key, char *val, uint32_t *block_size_sectors)
|
||||
{
|
||||
@@ -3270,13 +3447,14 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
|
||||
process_lv = 1;
|
||||
}
|
||||
|
||||
process_lv = process_lv && select_match_lv(cmd, handle, vg, lvl->lv) && _select_matches(handle);
|
||||
_historical_lv.this_glv = glvl->glv;
|
||||
_historical_lv.name = glvl->glv->historical->name;
|
||||
|
||||
process_lv = process_lv && select_match_lv(cmd, handle, vg, &_historical_lv) && _select_matches(handle);
|
||||
|
||||
if (!process_lv)
|
||||
continue;
|
||||
|
||||
_historical_lv.this_glv = glvl->glv;
|
||||
_historical_lv.name = glvl->glv->historical->name;
|
||||
log_very_verbose("Processing historical LV %s in VG %s.", glvl->glv->historical->name, vg->name);
|
||||
|
||||
ret = process_single_lv(cmd, &_historical_lv, handle);
|
||||
|
||||
@@ -217,6 +217,12 @@ int get_cache_params(struct cmd_context *cmd,
|
||||
const char **name,
|
||||
struct dm_config_tree **settings);
|
||||
|
||||
#define VDO_CHANGE_ONLINE 1
|
||||
#define VDO_CHANGE_OFFLINE 2
|
||||
int get_vdo_settings(struct cmd_context *cmd,
|
||||
struct dm_vdo_target_params *vtp,
|
||||
int *updated);
|
||||
|
||||
int get_writecache_settings(struct cmd_context *cmd, struct writecache_settings *settings,
|
||||
uint32_t *block_size_sectors);
|
||||
|
||||
|
||||
@@ -992,6 +992,17 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)
|
||||
return ECMD_PROCESSED;
|
||||
}
|
||||
|
||||
/*
|
||||
* Do not use udev for device listing or device info because
|
||||
* vgchange --monitor y is called during boot when udev is being
|
||||
* initialized and is not yet ready to be used.
|
||||
*/
|
||||
if (arg_is_set(cmd, monitor_ARG) &&
|
||||
arg_int_value(cmd, monitor_ARG, DEFAULT_DMEVENTD_MONITOR)) {
|
||||
init_obtain_device_list_from_udev(0);
|
||||
init_external_device_info_source(DEV_EXT_NONE);
|
||||
}
|
||||
|
||||
if (update)
|
||||
flags |= READ_FOR_UPDATE;
|
||||
else if (arg_is_set(cmd, activate_ARG))
|
||||
|
||||
@@ -311,8 +311,8 @@ int vgimportclone(struct cmd_context *cmd, int argc, char **argv)
|
||||
*/
|
||||
dm_list_iterate_items(devl, &vp.new_devs) {
|
||||
if (!cmd->filter->passes_filter(cmd, cmd->filter, devl->dev, "persistent")) {
|
||||
/* FIXME: print which filter */
|
||||
log_error("Device %s was excluded by filters.", dev_name(devl->dev));
|
||||
log_error("Device %s is excluded: %s.",
|
||||
dev_name(devl->dev), dev_filtered_reason(devl->dev));
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,8 +57,7 @@ static int _vgimportdevices_single(struct cmd_context *cmd,
|
||||
dm_list_iterate_items(pvl, &vg->pvs) {
|
||||
pv = pvl->pv;
|
||||
|
||||
if (!idtypestr && pv->device_id_type)
|
||||
idtypestr = pv->device_id_type;
|
||||
idtypestr = pv->device_id_type;
|
||||
|
||||
memcpy(pvid, &pvl->pv->id.uuid, ID_LEN);
|
||||
device_id_add(cmd, pv->dev, pvid, idtypestr, NULL);
|
||||
|
||||
Reference in New Issue
Block a user