]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
RDS: Do not BUG() on error returned from ib_post_send
authorAndy Grover <andy.grover@oracle.com>
Tue, 8 Dec 2009 00:06:53 +0000 (16:06 -0800)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 23:41:19 +0000 (16:41 -0700)
BUGging on a runtime error code should be avoided. This
patch also eliminates all other BUG()s that have no real
reason to exist.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
net/rds/ib_recv.c
net/rds/ib_send.c
net/rds/iw_recv.c
net/rds/iw_send.c
net/rds/rdma_transport.c

index 3415e72f47ad3fff0a05b0c3a9a1bf941367705b..2421e588556239a183c92e6d9fa94892a1b8c987 100644 (file)
@@ -468,8 +468,8 @@ static void rds_ib_send_ack(struct rds_ib_connection *ic, unsigned int adv_credi
                set_bit(IB_ACK_REQUESTED, &ic->i_ack_flags);
 
                rds_ib_stats_inc(s_ib_ack_send_failure);
-               /* Need to finesse this later. */
-               BUG();
+
+               rds_ib_conn_error(ic->conn, "sending ack failed\n");
        } else
                rds_ib_stats_inc(s_ib_ack_sent);
 }
index cb6c52cb1c4c1aa47a085e2d71bdf1b61cf2dfa7..a07d311b8ae39b79ec3e0456c735e3eaf03d996f 100644 (file)
@@ -574,8 +574,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
                rds_ib_send_grab_credits(ic, 0, &posted, 1);
                adv_credits += posted;
                BUG_ON(adv_credits > 255);
-       } else if (ic->i_rm != rm)
-               BUG();
+       }
 
        send = &ic->i_sends[pos];
        first = send;
@@ -714,8 +713,8 @@ add_header:
                        ic->i_rm = prev->s_rm;
                        prev->s_rm = NULL;
                }
-               /* Finesse this later */
-               BUG();
+
+               rds_ib_conn_error(ic->conn, "ib_post_send failed\n");
                goto out;
        }
 
index 3501f06b841c0905b626625f594e891768dde33f..b3dca0836d00d35e7fbf114e66fa1fb63bf1f6c1 100644 (file)
@@ -468,8 +468,8 @@ static void rds_iw_send_ack(struct rds_iw_connection *ic, unsigned int adv_credi
                set_bit(IB_ACK_REQUESTED, &ic->i_ack_flags);
 
                rds_iw_stats_inc(s_iw_ack_send_failure);
-               /* Need to finesse this later. */
-               BUG();
+
+               rds_iw_conn_error(ic->conn, "sending ack failed\n");
        } else
                rds_iw_stats_inc(s_iw_ack_sent);
 }
index fabb8a465d208950396e1551000daee6f87eac29..603262f8602944ff0567f34c75850512497faf75 100644 (file)
@@ -617,8 +617,7 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm,
                rds_iw_send_grab_credits(ic, 0, &posted, 1);
                adv_credits += posted;
                BUG_ON(adv_credits > 255);
-       } else if (ic->i_rm != rm)
-               BUG();
+       }
 
        send = &ic->i_sends[pos];
        first = send;
index 027e924ec9e0bb8d36a5874d0a66ee0785999721..213d539019ba80a51a3d6987698cc16200188560 100644 (file)
@@ -109,8 +109,7 @@ int rds_rdma_cm_event_handler(struct rdma_cm_id *cm_id,
 
        default:
                /* things like device disconnect? */
-               printk(KERN_ERR "unknown event %u\n", event->event);
-               BUG();
+               printk(KERN_ERR "RDS: unknown event %u!\n", event->event);
                break;
        }