Skip to content

Commit

Permalink
dm log userspace: trap all failed log construction errors
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Brassow authored and Alasdair G Kergon committed Jan 13, 2011
1 parent 69a8cfc commit 4a03867
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/md/dm-log-userspace-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
ctr_str, str_size, NULL, NULL);

if (r == -ESRCH) {
DMERR("Userspace log server not found");
if (r < 0) {
if (r == -ESRCH)
DMERR("Userspace log server not found");
else
DMERR("Userspace log server failed to create log");
goto out;
}

Expand Down Expand Up @@ -214,10 +217,9 @@ static int userspace_ctr(struct dm_dirty_log *log, struct dm_target *ti,

static void userspace_dtr(struct dm_dirty_log *log)
{
int r;
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, NULL);

Expand Down

0 comments on commit 4a03867

Please sign in to comment.