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

lvmlockd: fix handling of sanlock release error

When sanlock_release returns an error because of an i/o
timeout releasing the lease on disk, lvmlockd should just
consider the lock released.  sanlock will continue trying
to release the lease on disk after the original request
times out.
This commit is contained in:
David Teigland 2018-11-02 12:11:09 -05:00
parent f6a54a50a0
commit e7a56d5cd3

View File

@ -2111,12 +2111,20 @@ int lm_unlock_sanlock(struct lockspace *ls, struct resource *r,
if (rv < 0) if (rv < 0)
log_error("S %s R %s unlock_san release error %d", ls->name, r->name, rv); log_error("S %s R %s unlock_san release error %d", ls->name, r->name, rv);
if (rv == -EIO) /*
rv = -ELOCKIO; * sanlock may return an error here if it fails to release the lease on
else if (rv < 0) * disk because of an io timeout. But, sanlock will continue trying to
rv = -ELMERR; * release the lease after this call returns. We shouldn't return an
* error here which would result in lvmlockd-core keeping the lock
* around. By releasing the lock in lvmlockd-core at this point,
* lvmlockd may send another acquire request to lvmlockd. If sanlock
* has not been able to release the previous instance of the lock yet,
* then it will return an error for the new request. But, acquiring a
* new lock is able o fail gracefully, until sanlock is finally able to
* release the old lock.
*/
return rv; return 0;
} }
int lm_hosts_sanlock(struct lockspace *ls, int notify) int lm_hosts_sanlock(struct lockspace *ls, int notify)