1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Add activation/udev_sync to lvm.conf.

This commit is contained in:
Alasdair Kergon 2009-08-04 15:36:13 +00:00
parent c48b10050a
commit cf8235e0aa
7 changed files with 22 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.51 - Version 2.02.51 -
================================ ================================
Add activation/udev_sync to lvm.conf.
Only change LV symlinks on ACTIVATE not PRELOAD. Only change LV symlinks on ACTIVATE not PRELOAD.
Make lvconvert honour log mirror options combined with downconversion. Make lvconvert honour log mirror options combined with downconversion.
Allow LV suspend while --ignorelockingfailure is in force. Allow LV suspend while --ignorelockingfailure is in force.

View File

@ -301,6 +301,16 @@ global {
} }
activation { activation {
# Set to 0 to disable udev syncronisation (if compiled into the binaries).
# Processes will not wait for notification from udev.
# They will continue irrespective of any possible udev processing
# in the background. You should only use this if udev is not running
# or has rules that ignore the devices LVM2 creates.
# The command line argument --nodevsync takes precedence over this setting.
# If set to 1 when udev is not running, and there are LVM2 processes
# waiting for udev, run 'dmsetup udevcomplete' manually to wake them up.
udev_sync = 1
# How to fill in missing stripes if activating an incomplete volume. # How to fill in missing stripes if activating an incomplete volume.
# Using "error" will make inaccessible parts of the device return # Using "error" will make inaccessible parts of the device return
# I/O errors on access. You can instead use a device path, in which # I/O errors on access. You can instead use a device path, in which

View File

@ -455,6 +455,8 @@ struct dev_manager *dev_manager_create(struct cmd_context *cmd,
dm->target_state = NULL; dm->target_state = NULL;
dm_udev_set_sync_support(cmd->current_settings.udev_sync);
return dm; return dm;
bad: bad:

View File

@ -265,6 +265,10 @@ static int _process_config(struct cmd_context *cmd)
return 0; return 0;
} }
cmd->default_settings.udev_sync = find_config_tree_int(cmd,
"activation/udev_sync",
DEFAULT_UDEV_SYNC);
cmd->stripe_filler = find_config_tree_str(cmd, cmd->stripe_filler = find_config_tree_str(cmd,
"activation/missing_stripe_filler", "activation/missing_stripe_filler",
DEFAULT_STRIPE_FILLER); DEFAULT_STRIPE_FILLER);

View File

@ -34,6 +34,7 @@ struct config_info {
int archive; /* should we archive ? */ int archive; /* should we archive ? */
int backup; /* should we backup ? */ int backup; /* should we backup ? */
int read_ahead; /* DM_READ_AHEAD_NONE or _AUTO */ int read_ahead; /* DM_READ_AHEAD_NONE or _AUTO */
int udev_sync;
int cache_vgmetadata; int cache_vgmetadata;
const char *msg_prefix; const char *msg_prefix;
struct format_type *fmt; struct format_type *fmt;

View File

@ -68,6 +68,7 @@
#define DEFAULT_PVMETADATACOPIES 1 #define DEFAULT_PVMETADATACOPIES 1
#define DEFAULT_LABELSECTOR UINT64_C(1) #define DEFAULT_LABELSECTOR UINT64_C(1)
#define DEFAULT_READ_AHEAD "auto" #define DEFAULT_READ_AHEAD "auto"
#define DEFAULT_UDEV_SYNC 0
#define DEFAULT_EXTENT_SIZE 4096 /* In KB */ #define DEFAULT_EXTENT_SIZE 4096 /* In KB */
#define DEFAULT_MAX_PV 0 #define DEFAULT_MAX_PV 0
#define DEFAULT_MAX_LV 0 #define DEFAULT_MAX_LV 0

View File

@ -830,6 +830,9 @@ static int _get_settings(struct cmd_context *cmd)
} else } else
init_trust_cache(0); init_trust_cache(0);
if (arg_count(cmd, noudevsync_ARG))
cmd->current_settings.udev_sync = 0;
/* Handle synonyms */ /* Handle synonyms */
if (!_merge_synonym(cmd, resizable_ARG, resizeable_ARG) || if (!_merge_synonym(cmd, resizable_ARG, resizeable_ARG) ||
!_merge_synonym(cmd, allocation_ARG, allocatable_ARG) || !_merge_synonym(cmd, allocation_ARG, allocatable_ARG) ||