master - cmirrord: add missing checks for kernel_send
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=461eb1ac6adbf8e1938bd6e726dd4048c341cb49 Commit: 461eb1ac6adbf8e1938bd6e726dd4048c341cb49 Parent: ac8a931889d796cf1e74b7c38ee6fb201ae2963b Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue Jun 19 23:28:59 2012 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Wed Jun 20 14:48:26 2012 +0200
cmirrord: add missing checks for kernel_send
Log errors if kernel_send fails.
--- WHATS_NEW | 1 + daemons/cmirrord/cluster.c | 9 ++++++--- daemons/cmirrord/local.c | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.97 - =============================== + Add tests for kernel_send() errors in cmirrod. Print clean_bits in pull_state, fix cut&paste typo in cmirrord. Add tests for errors from closedir(), close() in cmirrord. Fix missing sync of filesystem when creating thin volume snapshot.
daemons/cmirrord/cluster.c +6 -3
@@ -910,8 +910,9 @@ static int resend_requests(struct clog_cpg *entry) rq->u_rq.seq); rq->u_rq.data_size =0 ; -kernel_send (&rq->u_rq); - +if (kernel_send (&rq->u_rq)) +LOG_ERROR ("Failed to respond to kernel [%s]" , +RQ_TYPE (rq->u_rq.request_type));break ;default :
@@ -1346,7 +1347,9 @@ static void cpg_leave_callback(struct clog_cpg *match,dm_list_del (&rq->u.list);if (rq->u_rq.request_type ==DM_ULOG_POSTSUSPEND ) -kernel_send (&rq->u_rq); +if (kernel_send (&rq->u_rq)) +LOG_ERROR ("Failed to respond to kernel [%s]" , +RQ_TYPE (rq->u_rq.request_type));free (rq); }
daemons/cmirrord/local.c +3 -1
@@ -279,7 +279,9 @@ static int do_local_work(void *data __attribute__((unused)))if (r) { u_rq->data_size =0 ; u_rq->error = r; -kernel_send (u_rq); +if (kernel_send (u_rq)) +LOG_ERROR ("Failed to respond to kernel [%s]" , +RQ_TYPE (u_rq->request_type)); }break ;