Windows: Treat EIO from file server as fatal error
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 26 Sep 2012 05:51:37 +0000 (01:51 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 28 Oct 2012 16:23:45 +0000 (09:23 -0700)
Return STATUS_DISK_OPERATION_FAILURE to caller when a file
server fails an RPC with EIO.  Previous behavior was to retry
the request indefinitely.

Change-Id: I8fa3dbc92dda4e50e1331ad350dd697092f26985
Reviewed-on: http://gerrit.openafs.org/8319
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsd/cm_buf.c
src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_dcache.c
src/WINNT/afsd/smb.c
src/WINNT/afsrdr/user/RDRFunction.c

index 3779b96..58a7891 100644 (file)
@@ -855,7 +855,7 @@ afs_uint32 buf_CleanLocked(cm_scache_t *scp, cm_buf_t *bp, cm_req_t *reqp,
         */
        if (code == CM_ERROR_NOSUCHFILE || code == CM_ERROR_BADFD || code == CM_ERROR_NOACCESS ||
             code == CM_ERROR_QUOTA || code == CM_ERROR_SPACE || code == CM_ERROR_TOOBIG ||
-            code == CM_ERROR_READONLY || code == CM_ERROR_NOSUCHPATH){
+            code == CM_ERROR_READONLY || code == CM_ERROR_NOSUCHPATH || code == EIO){
            _InterlockedAnd(&bp->flags, ~CM_BUF_DIRTY);
            _InterlockedOr(&bp->flags, CM_BUF_ERROR);
             bp->dirty_offset = 0;
@@ -2237,6 +2237,7 @@ long buf_CleanVnode(struct cm_scache *scp, cm_user_t *userp, cm_req_t *reqp)
                 case CM_ERROR_TOOBIG:
                 case CM_ERROR_READONLY:
                 case CM_ERROR_NOSUCHPATH:
+                case EIO:
                     /*
                      * Apply the previous fatal error to this buffer.
                      * Do not waste the time attempting to store to
index 7ba19bb..969442b 100644 (file)
@@ -1286,6 +1286,8 @@ cm_Analyze(cm_conn_t *connp,
            case CM_ERROR_ALLDOWN           : s = "CM_ERROR_ALLDOWN";            break;
            case CM_ERROR_TOOFEWBUFS        : s = "CM_ERROR_TOOFEWBUFS";         break;
            case CM_ERROR_TOOMANYBUFS       : s = "CM_ERROR_TOOMANYBUFS";        break;
+            case UAEIO                      : s = "UAEIO";                       break;
+            case EIO                        : s = "EIO";                         break;
             }
             osi_Log2(afsd_logp, "cm_Analyze: ignoring error code 0x%x (%s)",
                      errorCode, s);
index 314def8..7cf934b 100644 (file)
@@ -1534,6 +1534,7 @@ void cm_ReleaseBIOD(cm_bulkIO_t *biop, int isStore, long code, int scp_locked)
                     case CM_ERROR_TOOBIG:
                     case CM_ERROR_READONLY:
                     case CM_ERROR_NOSUCHPATH:
+                    case EIO:
                         /*
                          * Apply the fatal error to this buffer.
                          */
index d9d5332..a217121 100644 (file)
@@ -3287,6 +3287,9 @@ void smb_MapNTError(long code, unsigned long *NTStatusp, afs_uint32 redir)
     else if (code == ENOMEM) {
         NTStatus = 0xC0000017L; /* Out of Memory */
     }
+    else if (code == EIO) {
+       NTStatus = 0xC000016AL; /* Disk Operation Failure */
+    }
     else if (code == CM_ERROR_RPC_MOREDATA) {
        NTStatus = 0x80000005L; /* Buffer overflow */
     }
index dead109..83c65ea 100644 (file)
@@ -3104,6 +3104,7 @@ RDR_BkgFetch(cm_scache_t *scp, afs_uint32 p1, afs_uint32 p2, afs_uint32 p3, afs_
             case RXKADNOAUTH:
             case CM_ERROR_QUOTA:
             case CM_ERROR_LOCK_CONFLICT:
+            case EIO:
                 /*
                  * these are fatal errors.  deliver what we can
                  * and halt.