Commit 2d818823 authored by Filippos Giannakos's avatar Filippos Giannakos

Turn BUG_ON to WARN_ON on xsegbd

parent d7334890
......@@ -394,7 +394,7 @@ static void xseg_request_fn(struct request_queue *rq)
if (blkreq_idx >= xsegbd_dev->nr_requests) {
XSEGLOG("blkreq_idx >= xsegbd_dev->nr_requests");
BUG_ON(1);
WARN_ON(1);
break;
}
......@@ -425,14 +425,14 @@ static void xseg_request_fn(struct request_queue *rq)
if (r < 0) {
XSEGLOG("couldn't prep request");
blk_end_request_err(blkreq, r);
BUG_ON(1);
WARN_ON(1);
break;
}
r = -ENOMEM;
if (xreq->bufferlen - xsegbd_dev->targetlen < datalen){
XSEGLOG("malformed req buffers");
blk_end_request_err(blkreq, r);
BUG_ON(1);
WARN_ON(1);
break;
}
......@@ -483,10 +483,10 @@ static void xseg_request_fn(struct request_queue *rq)
WARN_ON(xseg_signal(xsegbd_dev->xsegbd->xseg, p) < 0);
}
if (xreq)
BUG_ON(xseg_put_request(xsegbd_dev->xsegbd->xseg, xreq,
WARN_ON(xseg_put_request(xsegbd_dev->xsegbd->xseg, xreq,
xsegbd_dev->src_portno) == -1);
if (blkreq_idx != Noneidx)
BUG_ON(xq_append_head(&xsegbd_dev->blk_queue_pending,
WARN_ON(xq_append_head(&xsegbd_dev->blk_queue_pending,
blkreq_idx, xsegbd_dev->src_portno) == Noneidx);
spin_lock_irq(&xsegbd_dev->rqlock);
}
......@@ -534,7 +534,7 @@ static int xsegbd_get_size(struct xsegbd_device *xsegbd_dev)
if (!xreq)
goto out;
BUG_ON(xseg_prep_request(xsegbd_dev->xseg, xreq, xsegbd_dev->targetlen,
WARN_ON(xseg_prep_request(xsegbd_dev->xseg, xreq, xsegbd_dev->targetlen,
sizeof(struct xseg_reply_info)));
init_completion(&comp);
......@@ -561,7 +561,7 @@ static int xsegbd_get_size(struct xsegbd_device *xsegbd_dev)
xsegbd_dev->src_portno, X_ALLOC);
if ( p == NoPort) {
XSEGLOG("couldn't submit request");
BUG_ON(1);
WARN_ON(1);
goto out_queue;
}
WARN_ON(xseg_signal(xsegbd_dev->xseg, p) < 0);
......@@ -576,7 +576,7 @@ out_queue:
pending->comp = NULL;
xq_append_head(&xsegbd_dev->blk_queue_pending, blkreq_idx, 1);
out_put:
BUG_ON(xseg_put_request(xsegbd_dev->xseg, xreq, xsegbd_dev->src_portno) == -1);
WARN_ON(xseg_put_request(xsegbd_dev->xseg, xreq, xsegbd_dev->src_portno) == -1);
out:
return ret;
}
......@@ -596,7 +596,7 @@ static int xsegbd_mapclose(struct xsegbd_device *xsegbd_dev)
if (!xreq)
goto out;
BUG_ON(xseg_prep_request(xsegbd_dev->xseg, xreq, xsegbd_dev->targetlen, 0));
WARN_ON(xseg_prep_request(xsegbd_dev->xseg, xreq, xsegbd_dev->targetlen, 0));
init_completion(&comp);
blkreq_idx = xq_pop_head(&xsegbd_dev->blk_queue_pending, 1);
......@@ -622,7 +622,7 @@ static int xsegbd_mapclose(struct xsegbd_device *xsegbd_dev)
xsegbd_dev->src_portno, X_ALLOC);
if ( p == NoPort) {
XSEGLOG("couldn't submit request");
BUG_ON(1);
WARN_ON(1);
goto out_queue;
}
WARN_ON(xseg_signal(xsegbd_dev->xseg, p) < 0);
......@@ -636,7 +636,7 @@ out_queue:
pending->comp = NULL;
xq_append_head(&xsegbd_dev->blk_queue_pending, blkreq_idx, 1);
out_put:
BUG_ON(xseg_put_request(xsegbd_dev->xseg, xreq, xsegbd_dev->src_portno) == -1);
WARN_ON(xseg_put_request(xsegbd_dev->xseg, xreq, xsegbd_dev->src_portno) == -1);
out:
return ret;
}
......@@ -724,7 +724,7 @@ blk_end:
if (xseg_put_request(xsegbd_dev->xseg, xreq,
xsegbd_dev->src_portno) < 0){
XSEGLOG("couldn't put req");
BUG_ON(1);
WARN_ON(1);
}
}
if (xsegbd_dev) {
......@@ -1015,7 +1015,7 @@ static ssize_t xsegbd_add(struct bus_type *bus, const char *buf, size_t count)
if (xsegbd_dev->src_portno != xseg_portno(xsegbd_dev->xseg, port)) {
XSEGLOG("portno != xsegbd_dev->src_portno");
BUG_ON(1);
WARN_ON(1);
ret = -EFAULT;
goto out_bus;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment