netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Grover <andy.grover@oracle.com>
To: netdev@vger.kernel.org
Cc: rds-devel@oss.oracle.com
Subject: [PATCH 01/13] RDS: Do not BUG() on error returned from ib_post_send
Date: Thu, 11 Mar 2010 15:49:55 -0800	[thread overview]
Message-ID: <1268351407-7394-2-git-send-email-andy.grover@oracle.com> (raw)
In-Reply-To: <1268351407-7394-1-git-send-email-andy.grover@oracle.com>

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        |    4 ++--
 net/rds/ib_send.c        |    7 +++----
 net/rds/iw_recv.c        |    4 ++--
 net/rds/iw_send.c        |    3 +--
 net/rds/rdma_transport.c |    3 +--
 5 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index 04dc0d3..c338881 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -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);
 }
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c
index a10fab6..f380c3f 100644
--- a/net/rds/ib_send.c
+++ b/net/rds/ib_send.c
@@ -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;
 	}
 
diff --git a/net/rds/iw_recv.c b/net/rds/iw_recv.c
index 54af7d6..337e4e5 100644
--- a/net/rds/iw_recv.c
+++ b/net/rds/iw_recv.c
@@ -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);
 }
diff --git a/net/rds/iw_send.c b/net/rds/iw_send.c
index 1379e9d..52182ff 100644
--- a/net/rds/iw_send.c
+++ b/net/rds/iw_send.c
@@ -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;
diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c
index 9ece910..31f9c72 100644
--- a/net/rds/rdma_transport.c
+++ b/net/rds/rdma_transport.c
@@ -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;
 	}
 
-- 
1.6.3.3


  reply	other threads:[~2010-03-11 23:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-11 23:49 [PATCH net-next 00/13] RDS bugfixes and cleanups Andy Grover
2010-03-11 23:49 ` Andy Grover [this message]
2010-03-11 23:49 ` [PATCH 02/13] RDS: sendmsg() should check sndtimeo, not rcvtimeo Andy Grover
2010-03-11 23:49 ` [PATCH 03/13] RDS: update copy_to_user state in tcp transport Andy Grover
2010-03-11 23:49 ` [PATCH 04/13] RDS/TCP: Wait to wake thread when write space available Andy Grover
2010-03-11 23:49 ` [PATCH 05/13] RDS: Fix congestion issues for loopback Andy Grover
2010-03-11 23:50 ` [PATCH 06/13] RDS: Fix send locking issue Andy Grover
2010-03-11 23:50 ` [PATCH 07/13] RDS: Workaround for in-use MRs on close causing crash Andy Grover
2010-03-11 23:50 ` [PATCH 08/13] RDS: Turn down alarming reconnect messages Andy Grover
2010-03-11 23:50 ` [PATCH 09/13] RDS: Fix locking in rds_send_drop_to() Andy Grover
2010-03-11 23:50 ` [PATCH 10/13] RDS: only put sockets that have seen congestion on the poll_waitq Andy Grover
2010-03-11 23:50 ` [PATCH 11/13] RDS: Properly unmap when getting a remote access error Andy Grover
2010-03-11 23:50 ` [PATCH 12/13] RDS: Do not call set_page_dirty() with irqs off Andy Grover
2010-03-11 23:50 ` [PATCH 13/13] RDS: Enable per-cpu workqueue threads Andy Grover
2010-03-17  4:18 ` [PATCH net-next 00/13] RDS bugfixes and cleanups David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1268351407-7394-2-git-send-email-andy.grover@oracle.com \
    --to=andy.grover@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=rds-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).