1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

lvmlockd: recognize normal errors from sanlock_convert

Don't log an error message for error values returned
by sanlock_convert for expected conditions like lock
contention or io timeouts.
This commit is contained in:
David Teigland 2017-11-29 15:17:25 -06:00
parent bd893348b4
commit 46d6f7a639
2 changed files with 19 additions and 10 deletions

View File

@ -1389,12 +1389,11 @@ static int res_convert(struct lockspace *ls, struct resource *r,
}
rv = lm_convert(ls, r, act->mode, act, r_version);
if (rv < 0) {
log_error("S %s R %s res_convert lm error %d", ls->name, r->name, rv);
return rv;
}
log_debug("S %s R %s res_convert lm done", ls->name, r->name);
log_debug("S %s R %s res_convert rv %d", ls->name, r->name, rv);
if (rv < 0)
return rv;
if (lk->mode == LD_LK_EX && act->mode == LD_LK_SH) {
r->sh_count = 1;

View File

@ -1699,12 +1699,22 @@ int lm_convert_sanlock(struct lockspace *ls, struct resource *r,
flags |= SANLK_ACQUIRE_OWNER_NOWAIT;
rv = sanlock_convert(lms->sock, -1, flags, rs);
if (rv == -EAGAIN) {
/* FIXME: When could this happen? Should something different be done? */
log_error("S %s R %s convert_san EAGAIN", ls->name, r->name);
if (!rv)
return 0;
switch (rv) {
case -EAGAIN:
case SANLK_ACQUIRE_IDLIVE:
case SANLK_ACQUIRE_OWNED:
case SANLK_ACQUIRE_OWNED_RETRY:
case SANLK_ACQUIRE_OTHER:
case SANLK_AIO_TIMEOUT:
case SANLK_DBLOCK_LVER:
case SANLK_DBLOCK_MBAL:
/* expected errors from known/normal cases like lock contention or io timeouts */
log_debug("S %s R %s convert_san error %d", ls->name, r->name, rv);
return -EAGAIN;
}
if (rv < 0) {
default:
log_error("S %s R %s convert_san convert error %d", ls->name, r->name, rv);
rv = -ELMERR;
}