Skip to contentSkip to conversation

ocfs2/dlm: small signedness bug in dlm_request_all_locks()

PATCH New Dan Carpenter 1 participant 1 message Oct 2, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2/dlm: small signedness bug in dlm_request_all_locks()

"ret" is used to store the return value of o2net_send_message(), and not an enum dlm_status. Because of the type difference, if an error happened then the check for (ret < 0) didn't work and the error wasn't logged.

fs/ocfs2/dlm/dlmrecovery.c +1 -2
index 15d81ad..393515b 100644
@@ -789,7 +789,7 @@ static int dlm_request_all_locks(struct dlm_ctxt *dlm, u8 request_from,
 				 u8 dead_node)
 {
 	struct dlm_lock_request lr;
-	enum dlm_status ret;
+	int ret;
 
 	mlog(0, "\n");
 
@@ -802,7 +802,6 @@ static int dlm_request_all_locks(struct dlm_ctxt *dlm, u8 request_from,
 	lr.dead_node = dead_node;
 
 	// send message
-	ret = DLM_NOLOCKMGR;
 	ret = o2net_send_message(DLM_LOCK_REQUEST_MSG, dlm->key,
 				 &lr, sizeof(lr), request_from, NULL);