]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: not all short rx_Read[v] reads are fatal
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 7 Jul 2012 18:11:23 +0000 (14:11 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 11 Jul 2012 14:12:01 +0000 (07:12 -0700)
When performing a RXAFS_FetchData[64] RPC, a short read from
rx_Read[v] is not a reason to stop processing the call unless
it is the first read and the file server FetchData offset bug
has been detected.  If not, only stop processing if the
rx_Read[v] return value is <= 0.

Change-Id: I5b10ce7903686fa3d9c251e6c92c4bcec376ed40
Reviewed-on: http://gerrit.openafs.org/7749
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
src/WINNT/afsd/cm_dcache.c

index dd156cbbea409947dc7a5501c66cf367b038a42b..040671aae7673a7101625bc74f6cb4b1bef4ea10 100644 (file)
@@ -1987,11 +1987,13 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *userp
                      * length_found and continue as if the file server said
                      * it was sending us zero octets of data.
                      */
-                    if (fs_fetchdata_offset_bug && first_read)
+                    if (fs_fetchdata_offset_bug && first_read) {
                         length_found = 0;
-                    else
+                        break;
+                    } else if (temp <= 0) {
                         code = (rx_Error(rxcallp) < 0) ? rx_Error(rxcallp) : RX_PROTOCOL_ERROR;
-                    break;
+                        break;
+                    }
                 }
 
                 iov = 0;
@@ -2064,11 +2066,13 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *userp
                      * length_found and continue as if the file server said
                      * it was sending us zero octets of data.
                      */
-                    if (fs_fetchdata_offset_bug && first_read)
+                    if (fs_fetchdata_offset_bug && first_read) {
                         length_found = 0;
-                    else
+                        break;
+                    } else if (temp <= 0) {
                         code = (rx_Error(rxcallp) < 0) ? rx_Error(rxcallp) : RX_PROTOCOL_ERROR;
-                    break;
+                        break;
+                    }
                 }
                 first_read = 0;
 
@@ -2436,11 +2440,13 @@ long cm_GetData(cm_scache_t *scp, osi_hyper_t *offsetp, char *datap, int data_le
                      * length_found and continue as if the file server said
                      * it was sending us zero octets of data.
                      */
-                    if (fs_fetchdata_offset_bug && first_read)
+                    if (fs_fetchdata_offset_bug && first_read) {
                         length_found = 0;
-                    else
+                        break;
+                    } else if (temp <= 0) {
                         code = (rx_Error(rxcallp) < 0) ? rx_Error(rxcallp) : RX_PROTOCOL_ERROR;
-                    break;
+                        break;
+                    }
                 }
 
                 iov = 0;
@@ -2483,11 +2489,13 @@ long cm_GetData(cm_scache_t *scp, osi_hyper_t *offsetp, char *datap, int data_le
                      * length_found and continue as if the file server said
                      * it was sending us zero octets of data.
                      */
-                    if (fs_fetchdata_offset_bug && first_read)
+                    if (fs_fetchdata_offset_bug && first_read) {
                         length_found = 0;
-                    else
+                        break;
+                    } else if (temp <= 0) {
                         code = (rx_Error(rxcallp) < 0) ? rx_Error(rxcallp) : RX_PROTOCOL_ERROR;
-                    break;
+                        break;
+                    }
                 }
                 first_read = 0;
 
@@ -2726,11 +2734,13 @@ cm_VerifyStoreData(cm_bulkIO_t *biod, cm_scache_t *savedScp)
                      * length_found and continue as if the file server said
                      * it was sending us zero octets of data.
                      */
-                    if (fs_fetchdata_offset_bug && first_read)
+                    if (fs_fetchdata_offset_bug && first_read) {
                         length_found = 0;
-                    else
+                        break;
+                    } else if (temp <= 0) {
                         code = (rx_Error(rxcallp) < 0) ? rx_Error(rxcallp) : RX_PROTOCOL_ERROR;
-                    break;
+                        break;
+                    }
                 }
                 first_read = 0;