From 0f339711ebf7b7a76e299f9ab9ee74264bedb0d2 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 30 Jan 2014 00:39:39 -0600 Subject: [PATCH] rx: Remove RX_CALL_IDLE After change Ie0497d24f1bf4ad7d30ab59061f96c3298f47d17, RX_CALL_IDLE is not generated by Rx anymore; "idle dead" timeouts just cause RX_CALL_TIMEOUT errors. Any code dealing with it is thus now dead code (this value was deliberately never sent over the wire), so remove the dead code. Change-Id: I2b38327f77ffc8168712b83506afa1da3eea1224 Reviewed-on: http://gerrit.openafs.org/10783 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/WINNT/afsd/cm_conn.c | 82 +-------------------------------------- src/WINNT/afsd/cm_utils.c | 4 -- src/afs/afs_analyze.c | 2 +- src/afs/afs_conn.c | 3 +- src/rx/rx.c | 1 - src/rx/rx.h | 7 +--- 6 files changed, 7 insertions(+), 92 deletions(-) diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index 341a9dd39..b888622a0 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -1022,85 +1022,6 @@ cm_Analyze(cm_conn_t *connp, retry = 2; } - else if (errorCode == RX_CALL_IDLE) { - /* - * RPC failed because the server failed to respond with data - * within the idle dead timeout period. This could be for a variety - * of reasons: - * 1. The server could have a bad partition such as a failed - * disk or iSCSI target and all I/O to that partition is - * blocking on the server and will never complete. - * - * 2. The server vnode may be locked by another client request - * that is taking a very long time. - * - * 3. The server may have a very long queue of requests - * pending and is unable to process this request. - * - * 4. The server could be malicious and is performing a denial - * of service attack against the client. - * - * If this is a request against a .readonly with alternate sites - * the server should be marked down for this request and the - * client should fail over to another server. If this is a - * request against a single source, the client may retry once. - */ - if (connp) - _InterlockedAnd(&connp->flags, ~CM_CONN_FLAG_NEW); - - if (serverp) - sprintf(addr, "%d.%d.%d.%d", - ((serverp->addr.sin_addr.s_addr & 0xff)), - ((serverp->addr.sin_addr.s_addr & 0xff00)>> 8), - ((serverp->addr.sin_addr.s_addr & 0xff0000)>> 16), - ((serverp->addr.sin_addr.s_addr & 0xff000000)>> 24)); - - if (fidp) { - code = cm_FindVolumeByID(cellp, fidp->volume, userp, reqp, - CM_GETVOL_FLAG_NO_LRU_UPDATE, - &volp); - if (code == 0) { - statep = cm_VolumeStateByID(volp, fidp->volume); - - if (statep) - replicated = (statep->flags & CM_VOL_STATE_FLAG_REPLICATED); - - lock_ObtainRead(&cm_volumeLock); - cm_PutVolume(volp); - lock_ReleaseRead(&cm_volumeLock); - volp = NULL; - } - - if (storeOp) - scp = cm_FindSCache(fidp); - if (scp) { - if (cm_HaveCallback(scp)) { - lock_ObtainWrite(&scp->rw); - cm_DiscardSCache(scp); - lock_ReleaseWrite(&scp->rw); - - /* - * We really should notify the redirector that we discarded - * the status information but doing so in this case is not - * safe as it can result in a deadlock with extent release - * processing. - */ - } - cm_ReleaseSCache(scp); - } - } - - if (replicated && serverp) { - reqp->errorServp = serverp; - reqp->tokenError = errorCode; - - retry = 2; - } - - LogEvent(EVENTLOG_WARNING_TYPE, MSG_RX_IDLE_DEAD_TIMEOUT, addr, retry); - osi_Log2(afsd_logp, "cm_Analyze: RPC failed due to idle dead timeout addr[%s] retry=%u", - osi_LogSaveString(afsd_logp,addr), retry); - } else if (errorCode == RX_CALL_DEAD) { /* mark server as down */ if (serverp) @@ -1610,7 +1531,8 @@ static void cm_NewRXConnection(cm_conn_t *tcp, cm_ucell_t *ucellp, rx_SetConnHardDeadTime(tcp->rxconnp, HardDeadtimeout); /* - * Setting idle dead timeout to a non-zero value activates RX_CALL_IDLE errors + * Setting idle dead timeout to a non-zero value activates RX_CALL_TIMEOUT + * errors if the call is idle for a certain amount of time. */ if (replicated) { _InterlockedOr(&tcp->flags, CM_CONN_FLAG_REPLICATION); diff --git a/src/WINNT/afsd/cm_utils.c b/src/WINNT/afsd/cm_utils.c index 6c7718e7e..ea19f7bb0 100644 --- a/src/WINNT/afsd/cm_utils.c +++ b/src/WINNT/afsd/cm_utils.c @@ -217,8 +217,6 @@ long cm_MapRPCError(long error, cm_req_t *reqp) error == RX_MSGSIZE || error == VNOSERVICE) error = CM_ERROR_TIMEDOUT; - else if (error == RX_CALL_IDLE) - error = EIO; else if (error == RX_INVALID_OPERATION) error = CM_ERROR_INVAL_NET_RESP; else if (error < 0) @@ -284,7 +282,6 @@ long cm_MapRPCErrorRmdir(long error, cm_req_t *reqp) if (error == RX_CALL_DEAD || error == RX_CALL_TIMEOUT || error == RX_CALL_BUSY || - error == RX_CALL_IDLE || error == RX_MSGSIZE || error == VNOSERVICE) error = CM_ERROR_TIMEDOUT; @@ -338,7 +335,6 @@ long cm_MapVLRPCError(long error, cm_req_t *reqp) if (error == RX_CALL_DEAD || error == RX_CALL_TIMEOUT || error == RX_CALL_BUSY || - error == RX_CALL_IDLE || error == RX_MSGSIZE || error == VNOSERVICE) error = CM_ERROR_TIMEDOUT; diff --git a/src/afs/afs_analyze.c b/src/afs/afs_analyze.c index e34edcd11..014bd3ecd 100644 --- a/src/afs/afs_analyze.c +++ b/src/afs/afs_analyze.c @@ -625,7 +625,7 @@ afs_Analyze(struct afs_conn *aconn, struct rx_connection *rxconn, shouldRetry = 1; goto out; } - if (acode == RX_CALL_TIMEOUT || acode == RX_CALL_IDLE || acode == VNOSERVICE) { + if (acode == RX_CALL_TIMEOUT || acode == VNOSERVICE) { serversleft = afs_BlackListOnce(areq, afid, tsp); if (afid) tvp = afs_FindVolume(afid, READ_LOCK); diff --git a/src/afs/afs_conn.c b/src/afs/afs_conn.c index 8cd8a75c8..be6ab2bbf 100644 --- a/src/afs/afs_conn.c +++ b/src/afs/afs_conn.c @@ -513,7 +513,8 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell, rx_SetConnHardDeadTime(tc->id, afs_rx_harddead); } - /* Setting idle dead time to non-zero activates RX_CALL_IDLE errors. */ + /* Setting idle dead time to non-zero activates idle-dead + * RX_CALL_TIMEOUT errors. */ if (isrep) rx_SetConnIdleDeadTime(tc->id, afs_rx_idledead_rep); else diff --git a/src/rx/rx.c b/src/rx/rx.c index 63859ebb3..13a3892ff 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -5157,7 +5157,6 @@ rxi_SendCallAbort(struct rx_call *call, struct rx_packet *packet, return packet; switch (call->error) { - case RX_CALL_IDLE: case RX_CALL_BUSY: cerror = RX_CALL_TIMEOUT; break; diff --git a/src/rx/rx.h b/src/rx/rx.h index dbfb66d6b..f4ad3dca1 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -489,11 +489,8 @@ struct rx_ackPacket { /* EMSGSIZE returned from network. Packet too big, must fragment */ #define RX_MSGSIZE (-8) -/* - * Idle dead timeout error. This error is never sent on the wire. - * rxi_SendCallAbort() translates RX_CALL_IDLE to RX_CALL_TIMEOUT. - */ -#define RX_CALL_IDLE (-9) +/* The value -9 was previously used for RX_CALL_IDLE but is now free for + * reuse. */ /* * Busy call channel error. This error is never sent on the wire. -- 2.39.5