]> git.baikalelectronics.ru Git - kernel.git/commitdiff
RDS: Do not BUG() on error returned from ib_post_send
authorAndy Grover <andy.grover@oracle.com>
Thu, 11 Mar 2010 13:49:55 +0000 (13:49 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Mar 2010 04:16:53 +0000 (21:16 -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>
Signed-off-by: David S. Miller <davem@davemloft.net>
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 04dc0d3f3c955c00449d67a17951b86ac0f08573..c338881eca718f844de66b770bed8610b1ee5631 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 a10fab6886d18a033749cce366494bbbac7c7d12..f380c3f01256db5f52b12d06198704e376474c1f 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, RDS_MAX_ADV_CREDIT - adv_credits);
                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 54af7d6b92da073ad9305d67eb04a48acb0b6e7e..337e4e5025e2221cf1364c365d2d8eb2f40d0894 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 1379e9d66a789934ae8d7d649066c1e5d5463ef0..52182ff7519edcde8b7dee746b72282fe6eb832f 100644 (file)
@@ -616,8 +616,7 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm,
                rds_iw_send_grab_credits(ic, 0, &posted, 1, RDS_MAX_ADV_CREDIT - adv_credits);
                adv_credits += posted;
                BUG_ON(adv_credits > 255);
-       } else if (ic->i_rm != rm)
-               BUG();
+       }
 
        send = &ic->i_sends[pos];
        first = send;
index 9ece910ea394317a7b8dc9fd80e6a7c540e5f9b3..31f9c72b8d76fbaaf470b273b1395fa09264162d 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;
        }