From fb88a009805c1c918d1790046682620388b7a31b Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Mon, 24 Sep 2001 23:19:46 +0000 Subject: [PATCH] fileserver-remove-delay-on-stat-errors-20010925 previously and since 3.5 rx enhancements fileserver would delay 3 seconds on sending an rx abort when the abort was the 11th or more occurance of the same error on the same call. the problem was fetchstatus/bulkstatus on a directory on which you have "l" but not "r" would take forever after the first 5 files (bulkstatus and then fetchstatus on each file, 2*5=10) so in FetchStatus and BulkStatus stubs we suppress repeated errors from Check_PermissionRights *only*, which has the effect of suppressing the problem without removing the theoretical benefit of avoiding letting any one client throw requests at as as fast as we can abort them unless those requests happen to be fetch/bulkstat requests which fail a permission check, but in order to avoid that we'd also need to cache what they last tried to stat, and then things would get ugly. --- src/rx/rx.h | 3 +++ src/viced/afsfileprocs.c | 25 ++++++++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/rx/rx.h b/src/rx/rx.h index 79ab60835..16b79b1a4 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -224,6 +224,9 @@ returned with an error code of RX_CALL_DEAD ( transient error ) */ #define rx_SetConnAbortThreshold(A) (rxi_connAbortThreshhold = (A)) #define rx_SetConnAbortDelay(A) (rxi_connAbortDelay = (A)) +#define rx_GetCallAbortCode(call) ((call)->abortCode) +#define rx_SetCallAbortCode(call, code) ((call)->abortCode = (code)) + #define cpspace(call) ((call)->curlen) #define cppos(call) ((call)->curpos) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index b5cc861b1..d81af3089 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -523,7 +523,7 @@ SRXAFS_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync) /* Check whether the caller has permission access to fetch the data */ if (errorCode = Check_PermissionRights(targetptr, client, rights, - CHK_FETCHDATA, 0)) + CHK_FETCHDATA, 0)) goto Bad_FetchData; /* @@ -783,8 +783,8 @@ Bad_FetchACL: * This routine is called exclusively by SRXAFS_FetchStatus(), and should be * merged into it when possible. */ -SAFSS_FetchStatus (tcon, Fid, OutStatus, CallBack, Sync) - struct rx_connection *tcon; /* Rx connection handle */ +SAFSS_FetchStatus (tcall, Fid, OutStatus, CallBack, Sync) + struct rx_call *tcall; struct AFSFid *Fid; /* Fid of target file */ struct AFSFetchStatus *OutStatus; /* Returned status for the fid */ struct AFSCallBack *CallBack; /* if r/w, callback promise for Fid */ @@ -799,6 +799,7 @@ SAFSS_FetchStatus (tcon, Fid, OutStatus, CallBack, Sync) afs_int32 rights, anyrights; /* rights for this and any user */ struct client *t_client; /* tmp ptr to client data */ struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ + struct rx_connection *tcon = rx_ConnectionOf(tcall); /* Get ptr to client data for user Id for logging */ t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); @@ -824,8 +825,11 @@ SAFSS_FetchStatus (tcon, Fid, OutStatus, CallBack, Sync) /* Are we allowed to fetch Fid's status? */ if (targetptr->disk.type != vDirectory) { if (errorCode = Check_PermissionRights(targetptr, client, rights, - CHK_FETCHSTATUS, 0)) - goto Bad_FetchStatus; + CHK_FETCHSTATUS, 0)) { + if (rx_GetCallAbortCode(tcall) == errorCode) + rx_SetCallAbortCode(tcall, 0); + goto Bad_FetchStatus; + } } /* set OutStatus From the Fid */ @@ -924,9 +928,12 @@ SRXAFS_BulkStatus(tcon, Fids, OutStats, CallBacks, Sync) /* Are we allowed to fetch Fid's status? */ if (targetptr->disk.type != vDirectory) { - if (errorCode = Check_PermissionRights(targetptr, client, rights, - CHK_FETCHSTATUS, 0)) - goto Bad_BulkStatus; + if (errorCode = Check_PermissionRights(targetptr, client, rights, + CHK_FETCHSTATUS, 0)) { + if (rx_GetCallAbortCode(tcall) == errorCode) + rx_SetCallAbortCode(tcall, 0); + goto Bad_BulkStatus; + } } /* set OutStatus From the Fid */ @@ -1014,7 +1021,7 @@ SRXAFS_FetchStatus (tcon, Fid, OutStatus, CallBack, Sync) if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL)) goto Bad_FetchStatus; - code = SAFSS_FetchStatus (tcon, Fid, OutStatus, CallBack, Sync); + code = SAFSS_FetchStatus (tcall, Fid, OutStatus, CallBack, Sync); Bad_FetchStatus: CallPostamble(tcon); -- 2.39.5