mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Remove dmeventd mirror status line word limit
This commit is contained in:
parent
3b007b270d
commit
65e635b685
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.18 -
|
Version 2.02.18 -
|
||||||
====================================
|
====================================
|
||||||
|
Remove dmeventd mirror status line word limit.
|
||||||
Use CFLAGS when linking so mixed sparc builds can supply -m64.
|
Use CFLAGS when linking so mixed sparc builds can supply -m64.
|
||||||
Prevent permission changes on active mirrors.
|
Prevent permission changes on active mirrors.
|
||||||
Print warning instead of error message if lvconvert cannot zero volume.
|
Print warning instead of error message if lvconvert cannot zero volume.
|
||||||
|
@ -54,54 +54,51 @@ static pthread_mutex_t _event_mutex = PTHREAD_MUTEX_INITIALIZER;
|
|||||||
static int _get_mirror_event(char *params)
|
static int _get_mirror_event(char *params)
|
||||||
{
|
{
|
||||||
int i, r = ME_INSYNC;
|
int i, r = ME_INSYNC;
|
||||||
|
char **args = NULL;
|
||||||
#define MAX_ARGS 30 /* should support at least 8-way mirrors */
|
|
||||||
/* FIXME Remove unnecessary limit. It tells you how many devices there are - use it! */
|
|
||||||
|
|
||||||
char *args[MAX_ARGS];
|
|
||||||
char *dev_status_str;
|
char *dev_status_str;
|
||||||
char *log_status_str;
|
char *log_status_str;
|
||||||
char *sync_str;
|
char *sync_str;
|
||||||
char *p;
|
char *p;
|
||||||
int log_argc, num_devs, num_failures=0;
|
int log_argc, num_devs;
|
||||||
|
|
||||||
/* FIXME Remove unnecessary limit - get num_devs here */
|
|
||||||
if (MAX_ARGS <= dm_split_words(params, MAX_ARGS, 0, args)) {
|
|
||||||
syslog(LOG_ERR, "Unable to split mirror parameters: Arg list too long");
|
|
||||||
return -E2BIG; /* FIXME Why? Unused */
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unused: 0 409600 mirror
|
* Unused: 0 409600 mirror
|
||||||
* Used : 2 253:4 253:5 400/400 1 AA 3 cluster 253:3 A
|
* Used : 2 253:4 253:5 400/400 1 AA 3 cluster 253:3 A
|
||||||
*/
|
*/
|
||||||
num_devs = atoi(args[0]);
|
|
||||||
|
|
||||||
/* FIXME *Now* split rest of args */
|
/* number of devices */
|
||||||
|
if (!dm_split_words(params, 1, 0, &p))
|
||||||
|
goto out_parse;
|
||||||
|
|
||||||
dev_status_str = args[3 + num_devs];
|
num_devs = atoi(p);
|
||||||
log_argc = atoi(args[4 + num_devs]);
|
p += strlen(p) + 1;
|
||||||
log_status_str = args[4 + num_devs + log_argc];
|
|
||||||
sync_str = args[1 + num_devs];
|
/* devices names + max log parameters */
|
||||||
|
args = dm_malloc((num_devs + 8) * sizeof(char *));
|
||||||
|
if (!args || dm_split_words(p, num_devs + 8, 0, args) < num_devs)
|
||||||
|
goto out_parse;
|
||||||
|
|
||||||
|
dev_status_str = args[2 + num_devs];
|
||||||
|
log_argc = atoi(args[3 + num_devs]);
|
||||||
|
log_status_str = args[3 + num_devs + log_argc];
|
||||||
|
sync_str = args[num_devs];
|
||||||
|
|
||||||
/* Check for bad mirror devices */
|
/* Check for bad mirror devices */
|
||||||
for (i = 0; i < num_devs; i++)
|
for (i = 0; i < num_devs; i++)
|
||||||
if (dev_status_str[i] == 'D') {
|
if (dev_status_str[i] == 'D') {
|
||||||
syslog(LOG_ERR, "Mirror device, %s, has failed.\n", args[i+1]);
|
syslog(LOG_ERR, "Mirror device, %s, has failed.\n", args[i]);
|
||||||
num_failures++;
|
r = ME_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for bad log device */
|
/* Check for bad disk log device */
|
||||||
if (log_status_str[0] == 'D') {
|
if (log_argc > 1 && log_status_str[0] == 'D') {
|
||||||
syslog(LOG_ERR, "Log device, %s, has failed.\n",
|
syslog(LOG_ERR, "Log device, %s, has failed.\n",
|
||||||
args[3 + num_devs + log_argc]);
|
args[2 + num_devs + log_argc]);
|
||||||
num_failures++;
|
r = ME_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num_failures) {
|
if (r == ME_FAILURE)
|
||||||
r = ME_FAILURE;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
|
|
||||||
p = strstr(sync_str, "/");
|
p = strstr(sync_str, "/");
|
||||||
if (p) {
|
if (p) {
|
||||||
@ -109,16 +106,19 @@ static int _get_mirror_event(char *params)
|
|||||||
if (strcmp(sync_str, p+1))
|
if (strcmp(sync_str, p+1))
|
||||||
r = ME_IGNORE;
|
r = ME_IGNORE;
|
||||||
p[0] = '/';
|
p[0] = '/';
|
||||||
} else {
|
} else
|
||||||
/*
|
goto out_parse;
|
||||||
* How the hell did we get this?
|
|
||||||
* Might mean all our parameters are screwed.
|
out:
|
||||||
*/
|
if (args)
|
||||||
syslog(LOG_ERR, "Unable to parse sync string.");
|
dm_free(args);
|
||||||
r = ME_IGNORE;
|
|
||||||
}
|
|
||||||
out:
|
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
out_parse:
|
||||||
|
if (args)
|
||||||
|
dm_free(args);
|
||||||
|
syslog(LOG_ERR, "Unable to parse mirror status string.");
|
||||||
|
return ME_IGNORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _temporary_log_fn(int level, const char *file,
|
static void _temporary_log_fn(int level, const char *file,
|
||||||
|
@ -54,54 +54,51 @@ static pthread_mutex_t _event_mutex = PTHREAD_MUTEX_INITIALIZER;
|
|||||||
static int _get_mirror_event(char *params)
|
static int _get_mirror_event(char *params)
|
||||||
{
|
{
|
||||||
int i, r = ME_INSYNC;
|
int i, r = ME_INSYNC;
|
||||||
|
char **args = NULL;
|
||||||
#define MAX_ARGS 30 /* should support at least 8-way mirrors */
|
|
||||||
/* FIXME Remove unnecessary limit. It tells you how many devices there are - use it! */
|
|
||||||
|
|
||||||
char *args[MAX_ARGS];
|
|
||||||
char *dev_status_str;
|
char *dev_status_str;
|
||||||
char *log_status_str;
|
char *log_status_str;
|
||||||
char *sync_str;
|
char *sync_str;
|
||||||
char *p;
|
char *p;
|
||||||
int log_argc, num_devs, num_failures=0;
|
int log_argc, num_devs;
|
||||||
|
|
||||||
/* FIXME Remove unnecessary limit - get num_devs here */
|
|
||||||
if (MAX_ARGS <= dm_split_words(params, MAX_ARGS, 0, args)) {
|
|
||||||
syslog(LOG_ERR, "Unable to split mirror parameters: Arg list too long");
|
|
||||||
return -E2BIG; /* FIXME Why? Unused */
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unused: 0 409600 mirror
|
* Unused: 0 409600 mirror
|
||||||
* Used : 2 253:4 253:5 400/400 1 AA 3 cluster 253:3 A
|
* Used : 2 253:4 253:5 400/400 1 AA 3 cluster 253:3 A
|
||||||
*/
|
*/
|
||||||
num_devs = atoi(args[0]);
|
|
||||||
|
|
||||||
/* FIXME *Now* split rest of args */
|
/* number of devices */
|
||||||
|
if (!dm_split_words(params, 1, 0, &p))
|
||||||
|
goto out_parse;
|
||||||
|
|
||||||
dev_status_str = args[3 + num_devs];
|
num_devs = atoi(p);
|
||||||
log_argc = atoi(args[4 + num_devs]);
|
p += strlen(p) + 1;
|
||||||
log_status_str = args[4 + num_devs + log_argc];
|
|
||||||
sync_str = args[1 + num_devs];
|
/* devices names + max log parameters */
|
||||||
|
args = dm_malloc((num_devs + 8) * sizeof(char *));
|
||||||
|
if (!args || dm_split_words(p, num_devs + 8, 0, args) < num_devs)
|
||||||
|
goto out_parse;
|
||||||
|
|
||||||
|
dev_status_str = args[2 + num_devs];
|
||||||
|
log_argc = atoi(args[3 + num_devs]);
|
||||||
|
log_status_str = args[3 + num_devs + log_argc];
|
||||||
|
sync_str = args[num_devs];
|
||||||
|
|
||||||
/* Check for bad mirror devices */
|
/* Check for bad mirror devices */
|
||||||
for (i = 0; i < num_devs; i++)
|
for (i = 0; i < num_devs; i++)
|
||||||
if (dev_status_str[i] == 'D') {
|
if (dev_status_str[i] == 'D') {
|
||||||
syslog(LOG_ERR, "Mirror device, %s, has failed.\n", args[i+1]);
|
syslog(LOG_ERR, "Mirror device, %s, has failed.\n", args[i]);
|
||||||
num_failures++;
|
r = ME_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for bad log device */
|
/* Check for bad disk log device */
|
||||||
if (log_status_str[0] == 'D') {
|
if (log_argc > 1 && log_status_str[0] == 'D') {
|
||||||
syslog(LOG_ERR, "Log device, %s, has failed.\n",
|
syslog(LOG_ERR, "Log device, %s, has failed.\n",
|
||||||
args[3 + num_devs + log_argc]);
|
args[2 + num_devs + log_argc]);
|
||||||
num_failures++;
|
r = ME_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num_failures) {
|
if (r == ME_FAILURE)
|
||||||
r = ME_FAILURE;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
|
|
||||||
p = strstr(sync_str, "/");
|
p = strstr(sync_str, "/");
|
||||||
if (p) {
|
if (p) {
|
||||||
@ -109,16 +106,19 @@ static int _get_mirror_event(char *params)
|
|||||||
if (strcmp(sync_str, p+1))
|
if (strcmp(sync_str, p+1))
|
||||||
r = ME_IGNORE;
|
r = ME_IGNORE;
|
||||||
p[0] = '/';
|
p[0] = '/';
|
||||||
} else {
|
} else
|
||||||
/*
|
goto out_parse;
|
||||||
* How the hell did we get this?
|
|
||||||
* Might mean all our parameters are screwed.
|
out:
|
||||||
*/
|
if (args)
|
||||||
syslog(LOG_ERR, "Unable to parse sync string.");
|
dm_free(args);
|
||||||
r = ME_IGNORE;
|
|
||||||
}
|
|
||||||
out:
|
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
out_parse:
|
||||||
|
if (args)
|
||||||
|
dm_free(args);
|
||||||
|
syslog(LOG_ERR, "Unable to parse mirror status string.");
|
||||||
|
return ME_IGNORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _temporary_log_fn(int level, const char *file,
|
static void _temporary_log_fn(int level, const char *file,
|
||||||
|
Loading…
Reference in New Issue
Block a user