dm log userspace: trap all failed log construction errors
When constructing a mirror log, it is possible for the initial request to fail for other reasons besides -ESRCH. These must be handled too. Signed-off-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
This commit is contained in:
committed by
Alasdair G Kergon
parent
69a8cfcda2
commit
4a038677df
@@ -181,8 +181,11 @@ static int userspace_ctr(struct dm_dirty_log *log, struct dm_target *ti,
|
|||||||
r = dm_consult_userspace(lc->uuid, lc->luid, DM_ULOG_CTR,
|
r = dm_consult_userspace(lc->uuid, lc->luid, DM_ULOG_CTR,
|
||||||
ctr_str, str_size, NULL, NULL);
|
ctr_str, str_size, NULL, NULL);
|
||||||
|
|
||||||
if (r == -ESRCH) {
|
if (r < 0) {
|
||||||
DMERR("Userspace log server not found");
|
if (r == -ESRCH)
|
||||||
|
DMERR("Userspace log server not found");
|
||||||
|
else
|
||||||
|
DMERR("Userspace log server failed to create log");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,10 +217,9 @@ out:
|
|||||||
|
|
||||||
static void userspace_dtr(struct dm_dirty_log *log)
|
static void userspace_dtr(struct dm_dirty_log *log)
|
||||||
{
|
{
|
||||||
int r;
|
|
||||||
struct log_c *lc = log->context;
|
struct log_c *lc = log->context;
|
||||||
|
|
||||||
r = dm_consult_userspace(lc->uuid, lc->luid, DM_ULOG_DTR,
|
(void) dm_consult_userspace(lc->uuid, lc->luid, DM_ULOG_DTR,
|
||||||
NULL, 0,
|
NULL, 0,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user