windows-handle-vl_badname-20080731
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 31 Jul 2008 13:37:29 +0000 (13:37 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 31 Jul 2008 13:37:29 +0000 (13:37 +0000)
LICENSE MIT

Process VL_BADNAME so that when a user creates an mount point with
an invalid volume name we will do something sane.

src/WINNT/afsd/cm_utils.c
src/WINNT/afsd/cm_utils.h
src/WINNT/afsd/cm_volume.c

index bb849b3..52da62f 100644 (file)
@@ -330,7 +330,7 @@ long cm_MapVLRPCError(long error, cm_req_t *reqp)
 
     if (error < 0) 
        error = CM_ERROR_TIMEDOUT;
-    else if (error == VL_NOENT) 
+    else if (error == VL_NOENT || error == VL_BADNAME) 
        error = CM_ERROR_NOSUCHVOLUME;
     return error;
 }
index eced1a0..bca414e 100644 (file)
@@ -20,8 +20,38 @@ typedef struct cm_space {
 } cm_space_t;
 
 /* error code hack */
-#define ERROR_TABLE_BASE_VL    (363520L)
-#define VL_NOENT               (363524L)
+#define VL_IDEXIST                               (363520L)
+#define VL_IO                                    (363521L)
+#define VL_NAMEEXIST                             (363522L)
+#define VL_CREATEFAIL                            (363523L)
+#define VL_NOENT                                 (363524L)
+#define VL_EMPTY                                 (363525L)
+#define VL_ENTDELETED                            (363526L)
+#define VL_BADNAME                               (363527L)
+#define VL_BADINDEX                              (363528L)
+#define VL_BADVOLTYPE                            (363529L)
+#define VL_BADSERVER                             (363530L)
+#define VL_BADPARTITION                          (363531L)
+#define VL_REPSFULL                              (363532L)
+#define VL_NOREPSERVER                           (363533L)
+#define VL_DUPREPSERVER                          (363534L)
+#define VL_RWNOTFOUND                            (363535L)
+#define VL_BADREFCOUNT                           (363536L)
+#define VL_SIZEEXCEEDED                          (363537L)
+#define VL_BADENTRY                              (363538L)
+#define VL_BADVOLIDBUMP                          (363539L)
+#define VL_IDALREADYHASHED                       (363540L)
+#define VL_ENTRYLOCKED                           (363541L)
+#define VL_BADVOLOPER                            (363542L)
+#define VL_BADRELLOCKTYPE                        (363543L)
+#define VL_RERELEASE                             (363544L)
+#define VL_BADSERVERFLAG                         (363545L)
+#define VL_PERM                                  (363546L)
+#define VL_NOMEM                                 (363547L)
+#define VL_BADVERSION                            (363548L)
+#define VL_INDEXERANGE                           (363549L)
+#define VL_MULTIPADDR                            (363550L)
+#define VL_BADMASK                               (363551L)
 
 extern cm_space_t *cm_GetSpace(void);
 
index fbe2b55..9cf6eb0 100644 (file)
@@ -559,7 +559,7 @@ long cm_UpdateVolumeLocation(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *
         rwNewstate = rwServers_alldown ? vl_alldown : vl_online;
         roNewstate = roServers_alldown ? vl_alldown : vl_online;
         bkNewstate = bkServers_alldown ? vl_alldown : vl_online;
-    } else if (code == CM_ERROR_NOSUCHVOLUME || code == VL_NOENT) {
+    } else if (code == CM_ERROR_NOSUCHVOLUME || code == VL_NOENT || code == VL_BADNAME) {
         /* this volume does not exist - we should discard it */
         if (volp->flags & CM_VOLUMEFLAG_IN_HASH)
             cm_RemoveVolumeFromNameHashTable(volp);