Windows: Prevent fs fetchdata offset bug error from propagating to caller
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 9 Oct 2009 10:23:10 +0000 (06:23 -0400)
committerJeffrey Altman <jaltman|account-1000011@unknown>
Sat, 10 Oct 2009 17:06:16 +0000 (10:06 -0700)
When the file server fetchdata offset bug is triggered and detected,
not only do we have to behave as if 'length_found' is zero, but we
also must ignore the RXGEN_CC_UNMARSHAL error that will be returned
from rx_EndCall() due to the parsing error that occurred during the
rx_Read32() call.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/634
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/cm_dcache.c

index c3b53d9..94010d9 100644 (file)
@@ -1850,8 +1850,11 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *userp
         if (code1 == RXKADUNKNOWNKEY)
             osi_Log0(afsd_logp, "CALL EndCall returns RXKADUNKNOWNKEY");
 
+        /* If we are avoiding a file server bug, ignore the error state */
+        if (fs_fetchdata_offset_bug && first_read && length_found == 0 && code == -451)
+            code = 0;
         /* Prefer the error value from FetchData over rx_EndCall */
-        if (code == 0 && code1 != 0)
+        else if (code == 0 && code1 != 0)
             code = code1;
         osi_Log0(afsd_logp, "CALL FetchData DONE");