dlm: replace BUG_ON with a less severe handling
[cascardo/linux.git] / fs / dlm / lowcomms.c
index 856d750..4ea64e9 100644 (file)
@@ -542,6 +542,10 @@ static int receive_from_sock(struct connection *con)
                ret = -EAGAIN;
                goto out_close;
        }
+       if (con->nodeid == 0) {
+               ret = -EINVAL;
+               goto out_close;
+       }
 
        if (con->rx_page == NULL) {
                /*
@@ -582,8 +586,6 @@ static int receive_from_sock(struct connection *con)
        else if (ret == len)
                call_again_soon = 1;
 
-       BUG_ON(con->nodeid == 0);
-
        cbuf_add(&con->cb, ret);
        ret = dlm_process_incoming_buffer(con->nodeid,
                                          page_address(con->rx_page),