]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-store64-cleanup-20050212
authorChaskiel M Grundman <cg2v@andrew.cmu.edu>
Mon, 21 Feb 2005 01:15:21 +0000 (01:15 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 21 Feb 2005 01:15:21 +0000 (01:15 +0000)
fix several deficiencies in 64 bit file size handling

(cherry picked from commit cefe48fc1353c0f5e2831b8b81443d35e983fc96)

src/afs/afs_dcache.c
src/afs/afs_memcache.c
src/afs/afs_segments.c

index f231db28413686eafac0bce64f2141dcbe51e58c..3abdaa37ff3c930402a3f8bc69a11edf10fac7b6 100644 (file)
@@ -1301,8 +1301,9 @@ afs_UFSCacheStoreProc(register struct rx_call *acall, struct osi_file *afile,
        (*abytesXferredP) += code;
 #endif /* AFS_NOSTATS */
        if (code != got) {
+           code = rx_Error(acall);
            osi_FreeLargeSpace(tbuffer);
-           return -33;
+           return code ? code : -33;
        }
        alen -= got;
        /*
index a44931789afe8071ec8ecc79c2b1d34b2ec8fef9..a5ffe96f18ce5777aa22761a14c40e4dd967512d 100644 (file)
@@ -383,8 +383,9 @@ afs_MemCacheStoreProc(register struct rx_call *acall,
        code = rx_WritevAlloc(acall, tiov, &tnio, RX_MAXIOVECS, tlen);
        RX_AFS_GLOCK();
        if (code <= 0) {
+           code = rx_Error(acall);
            osi_FreeSmallSpace(tiov);
-           return -33;
+           return code ? code : -33;
        }
        tlen = code;
        code = afs_MemReadvBlk(mceP, offset, tiov, tnio, tlen);
@@ -399,8 +400,9 @@ afs_MemCacheStoreProc(register struct rx_call *acall,
        (*abytesXferredP) += code;
 #endif /* AFS_NOSTATS */
        if (code != tlen) {
+           code = rx_Error(acall);
            osi_FreeSmallSpace(tiov);
-           return -33;
+           return code ? code : -33;
        }
        offset += tlen;
        alen -= tlen;
index 23c0a4571dc0f9b538e755f2aa5755f5a7fd6e31..d9b6e8dac95439e5d157b61196730d21cd8b70ac 100644 (file)
@@ -60,8 +60,8 @@ afs_StoreMini(register struct vcache *avc, struct vrequest *areq)
     do {
        tc = afs_Conn(&avc->fid, areq, SHARED_LOCK);
        if (tc) {
-           RX_AFS_GUNLOCK();
          retry:
+           RX_AFS_GUNLOCK();
            tcall = rx_NewCall(tc->id);
            RX_AFS_GLOCK();
            /* Set the client mod time since we always want the file
@@ -104,17 +104,16 @@ afs_StoreMini(register struct vcache *avc, struct vrequest *areq)
 #endif /* AFS_64BIT_CLIENT */
            if (code == 0) {
                code = EndRXAFS_StoreData(tcall, &OutStatus, &tsync);
-#ifdef AFS_64BIT_CLIENT
-               if (code == RXGEN_OPCODE) {
-                   afs_serverSetNo64Bit(tc);
-                   code = rx_EndCall(tcall, code);
-                   goto retry;
-               }
-#endif /* AFS_64BIT_CLIENT */
            }
            code = rx_EndCall(tcall, code);
            RX_AFS_GLOCK();
            XSTATS_END_TIME;
+#ifdef AFS_64BIT_CLIENT
+           if (code == RXGEN_OPCODE && !afs_serverHasNo64Bit(tc)) {
+               afs_serverSetNo64Bit(tc);
+               goto retry;
+           }
+#endif /* AFS_64BIT_CLIENT */
        } else
            code = -1;
     } while (afs_Analyze
@@ -508,14 +507,8 @@ afs_StoreAllSegments(register struct vcache *avc, struct vrequest *areq,
                                                   shouldwake, &lp1, &lp2);
 #endif /* AFS_NOSTATS */
                            afs_CFileClose(tfile);
-#ifdef AFS_64BIT_CLIENT
-                           if (code == RXGEN_OPCODE) {
-                               afs_serverSetNo64Bit(tc);
-                               goto restart;
-                           }
-#endif /* AFS_64BIT_CLIENT */
                            if ((tdc->f.chunkBytes < afs_OtherCSize)
-                               && (i < (nchunks - 1))) {
+                               && (i < (nchunks - 1)) && code == 0) {
                                int bsent, tlen, sbytes =
                                    afs_OtherCSize - tdc->f.chunkBytes;
                                char *tbuffer =
@@ -567,6 +560,12 @@ afs_StoreAllSegments(register struct vcache *avc, struct vrequest *areq,
                            if (code2)
                                code = code2;
                        }
+#ifdef AFS_64BIT_CLIENT
+                       if (code == RXGEN_OPCODE && !afs_serverHasNo64Bit(tc)) {
+                           afs_serverSetNo64Bit(tc);
+                           goto restart;
+                       }
+#endif /* AFS_64BIT_CLIENT */
                    } while (afs_Analyze
                             (tc, code, &avc->fid, areq,
                              AFS_STATS_FS_RPCIDX_STOREDATA, SHARED_LOCK,