clang-10: use AFS_FALLTHROUGH for case fallthrough 74/14274/9
authorCheyenne Wills <cwills@sinenomine.net>
Mon, 27 Jul 2020 14:33:03 +0000 (08:33 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 27 Jul 2020 16:20:50 +0000 (12:20 -0400)
Clang-10 will not recognize '/* fallthrough */' as an indicator to
turn off the fallthrough diagnostic due to the lack of a 'break' in a
case statement.  Clang-10 requires the '__attribute__((fallthrough))'
statement to disable the diagnostic.

In addition clang-10 is finding additional locations where fall throughs
occur.

Determine if the compiler supports '__attribute__((fallthrough))' to
disable the implicit fallthrough diagnostic.

Define a new macro 'AFS_FALLTHROUGH' that will disable the fallthrough
diagnostic. Set it as a wrapper for the Linux kernel's 'fallthrough'
macro if available, otherwise set it as a wrapper macro for
'__attribute__((fallthrough))' if the compiler supports it.

Update CODING to document the use of AFS_FALLTHROUGH when needing to
fallthrough between case statements.

Replace the '/* fallthrough */' comments with AFS_FALLTHROUGH, and add
AFS_FALLTHROUGH as needed.

Replace some fallthroughs with a break (or goto) if the flow was was
just to a break (or goto).

e.g.   case x:                 case x:
           somestmt;               somestmt;
                                   break;
       case y:                 case y:
           break;                  break;

Correct a mis-indented brace '}' in src/WINNT/afsd/smb3.c

Note, the clang maintainers have rejected the use of comments as a flag
to turn off the fall through warnings.

Change-Id: Ia5da10fc14fc1874baca035a3cf471e618e0d5f5
Reviewed-on: https://gerrit.openafs.org/14274
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

32 files changed:
CODING
src/WINNT/afsadmsvr/TaAfsAdmSvrGeneral.cpp
src/WINNT/afsd/afskfw.c
src/WINNT/afsd/cm_daemon.c
src/WINNT/afsd/cm_utils.c
src/WINNT/afsd/rpc_srvsvc.c
src/WINNT/afsd/smb.c
src/WINNT/afsd/smb3.c
src/WINNT/afssvrmgr/svr_getdates.cpp
src/WINNT/afssvrmgr/svr_install.cpp
src/WINNT/afssvrmgr/svr_prune.cpp
src/afs/LINUX/osi_export.c
src/afs/LINUX/osi_vnodeops.c
src/aklog/asetkey.c
src/aklog/klog.c
src/butc/dump.c
src/cf/c-attribute.m4
src/cmd/cmd.c
src/config/stds.h
src/opr/jhash.h
src/rx/rx_trace.c
src/rx/xdr.c
src/rxkad/ticket5.c
src/tests/snprintf.c
src/tools/dumpscan/parsevnode.c
src/vfsck/pass2.c
src/vfsck/pass5.c
src/vol/fssync-server.c
src/vol/salvaged.c
src/vol/salvsync-server.c
src/vol/volume.c
src/volser/volprocs.c

diff --git a/CODING b/CODING
index 5d62dbb..bac7490 100644 (file)
--- a/CODING
+++ b/CODING
@@ -115,6 +115,47 @@ Instead of:
            do_something();
        }
 
+In switch statements, to fall through from one case statement to another, use
+AFS_FALLTHROUGH to mark the intentional fall through.  Do not use fall through
+comments (e.g. /* fallthrough */), as some compilers do not recognize them and
+will flag the case statement with an implied fallthrough warning.
+
+Use:
+
+    switch (x) {
+    case 1:
+        do_something();
+        AFS_FALLTHROUGH;
+    case 2:
+        do_something_else();
+        AFS_FALLTHROUGH;
+    default:
+        do_some_action();
+    }
+
+Instead of using fallthrough comments:
+
+    switch (x) {
+    case 1:
+        do_something();
+        /* fallthrough */
+    case 2:
+        do_something_else();
+        /* fallthrough */
+    default:
+        do_some_action();
+    }
+
+Or not marking the fall through:
+
+   switch (x) {
+    case 1:
+        do_something();
+    case 2:
+        do_something_else();
+    default:
+        do_some_action();
+    }
 
 Dependencies required to build OpenAFS from source
 --------------------------------------------------
index 8e51331..bf758e5 100644 (file)
@@ -653,7 +653,7 @@ void AfsAdmSvr_Action_StartRefresh (ASID idScope)
       {
       case itCELL:
          AfsAdmSvr_MarkRefreshThread (idScope);
-         // fall through
+         AFS_FALLTHROUGH;
 
       case itSERVER:
          ASACTION Action;
index 636b58b..a45896f 100644 (file)
@@ -1995,7 +1995,7 @@ MultiInputDialogProc( HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam)
                 if ( !GetDlgItemText(hDialog, ID_MID_TEXT+i, mid_tb[i].buf, mid_tb[i].len) )
                     *mid_tb[i].buf = '\0';
             }
-            /* fallthrough */
+            AFS_FALLTHROUGH;
         case IDCANCEL:
             EndDialog(hDialog, LOWORD(wParam));
             return TRUE;
index 2a3f032..c3f41c8 100644 (file)
@@ -252,7 +252,8 @@ void * cm_BkgDaemon(void * vparm)
                 cm_daemons[daemonID].retryCount++;
                 osi_QAddT((osi_queue_t **) &cm_daemons[daemonID].head, (osi_queue_t **)&cm_daemons[daemonID].tail, &rp->q);
                 break;
-            } /* otherwise fall through */
+            }
+            AFS_FALLTHROUGH;
         case 0:  /* success */
         default: /* other error */
             if (code == 0) {
index f89b84b..c335a40 100644 (file)
@@ -768,7 +768,7 @@ int cm_MatchMask(clientchar_t *namep, clientchar_t *maskp, int flags)
             break;
         case '.':
             dot++;
-            /* fallthrough */
+            AFS_FALLTHROUGH;
         default:
             if ( star ) {
                 newmask[j++] = '*';
index aa262fe..899e2ad 100644 (file)
@@ -877,12 +877,12 @@ NET_API_STATUS NetrShareGetInfo(
                 NetrIntGenerateSharePath(ServerName, &scp->fid);
             /* must be the empty string */
             InfoStruct->ShareInfo2->shi2_passwd = wcsdup(L"");
-            /* fall-through */
+            AFS_FALLTHROUGH;
         case 1:
             InfoStruct->ShareInfo1->shi1_type = STYPE_DISKTREE;
             InfoStruct->ShareInfo1->shi1_remark =
                 NetrIntGenerateShareRemark(scp, &scp->fid);
-            /* fall-through */
+            AFS_FALLTHROUGH;
         case 0:
             /* Canonicalized version of NetName parameter */
             InfoStruct->ShareInfo0->shi0_netname = wcsdup(NetName);
@@ -995,7 +995,7 @@ NET_API_STATUS NetrServerGetInfo(
     switch (Level) {
     case 103:
         InfoStruct->ServerInfo103->sv103_capabilities = 0;
-        /* fall-through */
+        AFS_FALLTHROUGH;
     case 102:
         InfoStruct->ServerInfo102->sv102_users = 0xFFFFFFFF;
         InfoStruct->ServerInfo102->sv102_disc = SV_NODISC;
@@ -1004,13 +1004,13 @@ NET_API_STATUS NetrServerGetInfo(
         InfoStruct->ServerInfo102->sv102_anndelta = 0;
         InfoStruct->ServerInfo102->sv102_licenses = 0;
         InfoStruct->ServerInfo102->sv102_userpath = wcsdup(L"C:\\");
-        /* fall-through */
+        AFS_FALLTHROUGH;
     case 101:
         InfoStruct->ServerInfo101->sv101_version_major = AFSPRODUCT_VERSION_MAJOR;
         InfoStruct->ServerInfo101->sv101_version_minor = AFSPRODUCT_VERSION_MINOR;
         InfoStruct->ServerInfo101->sv101_type = SV_TYPE_WORKSTATION | SV_TYPE_SERVER | SV_TYPE_SERVER_UNIX;
         InfoStruct->ServerInfo101->sv101_comment = wcsdup(wAFSVersion);
-        /* fall-through */
+        AFS_FALLTHROUGH;
     case 100:
         InfoStruct->ServerInfo100->sv100_platform_id = SV_PLATFORM_ID_AFS;
         /* The Netbios Name */
index 22b9d43..4bfb1be 100644 (file)
@@ -9471,7 +9471,7 @@ void smb_Server(VOID *parmp)
         case NRC_SNUMOUT:
        case NRC_SABORT:
            LogEvent(EVENTLOG_WARNING_TYPE, MSG_UNEXPECTED_SMB_SESSION_CLOSE, ncb_error_string(rc));
-           /* fallthrough */
+           AFS_FALLTHROUGH;
        case NRC_SCLOSED:
             /* Client closed session */
             vcp = smb_FindVC(ncbp->ncb_lsn, 0, lanas[idx_session]);
index d461f85..006e2fa 100644 (file)
@@ -5392,12 +5392,12 @@ long smb_T2SearchDirSingle(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *op
                    shortName);
             fp->u.FfileBothDirectoryInfo.shortNameLength = cm_ClientStrLen(shortName);
 #endif
-    }
-        /* Fallthrough */
+        }
+        AFS_FALLTHROUGH;
 
     case SMB_FIND_FILE_FULL_DIRECTORY_INFO:
         fp->u.FfileFullDirectoryInfo.eaSize = 0;
-        /* Fallthrough */
+        AFS_FALLTHROUGH;
 
     case SMB_FIND_FILE_DIRECTORY_INFO:
         fp->u.FfileDirectoryInfo.nextEntryOffset = 0;
@@ -6108,11 +6108,11 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
                     fp->u.FfileBothDirectoryInfo.shortNameLength = cm_ClientStrLen(shortName);
 #endif
                 }
-                /* Fallthrough */
+                AFS_FALLTHROUGH;
 
             case SMB_FIND_FILE_FULL_DIRECTORY_INFO:
                 fp->u.FfileFullDirectoryInfo.eaSize = 0;
-                /* Fallthrough */
+                AFS_FALLTHROUGH;
 
             case SMB_FIND_FILE_DIRECTORY_INFO:
                 fp->u.FfileDirectoryInfo.nextEntryOffset = orbytes + align;
index 07096e8..b8ba340 100644 (file)
@@ -97,7 +97,7 @@ BOOL WINAPI Server_GetDates_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
                {
                case IDOK:
                   Server_GetDates_OnOK (hDlg);
-                  // fall through
+                  AFS_FALLTHROUGH;
 
                case IDCANCEL:
                   DestroyWindow (hDlg);
index 2dfca8b..f77b54d 100644 (file)
@@ -94,7 +94,7 @@ BOOL WINAPI Server_Install_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
                {
                case IDOK:
                   Server_Install_OnOK (hDlg);
-                  // fall through
+                  AFS_FALLTHROUGH;
 
                case IDCANCEL:
                   DestroyWindow (hDlg);
index ac39fc3..d645b16 100644 (file)
@@ -94,7 +94,7 @@ BOOL WINAPI Server_Prune_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
                {
                case IDOK:
                   Server_Prune_OnOK (hDlg);
-                  // fall through
+                  AFS_FALLTHROUGH;
 
                case IDCANCEL:
                   DestroyWindow (hDlg);
index 76dd229..3a40eae 100644 (file)
@@ -93,7 +93,7 @@ static int afs_encode_fh(struct dentry *de, __u32 *fh, int *max_len,
                if (*max_len < 5) {
                    return 255;
                }
-               /* fall through */
+               AFS_FALLTHROUGH;
 
            case VN_TYPE_CELL:
            case VN_TYPE_ALIAS:
index 1a29ed7..d9bc952 100644 (file)
@@ -2638,7 +2638,7 @@ afs_linux_can_bypass(struct inode *ip) {
        case LARGE_FILES_BYPASS_CACHE:
            if (i_size_read(ip) > cache_bypass_threshold)
                return 1;
-           /* fall through */
+           AFS_FALLTHROUGH;
        default:
            return 0;
      }
index f24dddf..83f137a 100644 (file)
@@ -288,7 +288,7 @@ addRandomKey(struct afsconf_dir *dir, int argc, char **argv)
     switch (argc) {
     case 5:
         subtype = atoi(argv[4]);
-        /* fall through */
+        AFS_FALLTHROUGH;
     case 4:
         type = stringToType(argv[2]);
         kvno = atoi(argv[3]);
index 3ff3c2f..df4a062 100644 (file)
@@ -247,12 +247,12 @@ k5_to_k4_name(krb5_context k5context,
            i = get_princ_len(k5context, k5princ, 1);
            if (i > MAXKTCNAMELEN-1) i = MAXKTCNAMELEN-1;
            memcpy(ktcprinc->instance, get_princ_str(k5context, k5princ, 1), i);
-           /* fall through */
+           AFS_FALLTHROUGH;
        case 1:
            i = get_princ_len(k5context, k5princ, 0);
            if (i > MAXKTCNAMELEN-1) i = MAXKTCNAMELEN-1;
            memcpy(ktcprinc->name, get_princ_str(k5context, k5princ, 0), i);
-           /* fall through */
+           AFS_FALLTHROUGH;
        case 0:
            break;
        }
index ceda6d7..3750ef7 100644 (file)
@@ -868,7 +868,7 @@ dumpPass(struct dumpRock * dparamsPtr, int passNumber)
                    dparamsPtr->volumesFailed++;
                    continue;
                }
-               /* fall through */
+               AFS_FALLTHROUGH;
            case RWVOL:
                for (e = 0; e < vldbEntry.nServers; e++) {      /* Find the RW volume */
                    if (vldbEntry.serverFlags[e] & VLSF_RWVOL)
index 61b9410..97dbfb3 100644 (file)
@@ -9,6 +9,7 @@ dnl roken.  The HAVE___ATTRIBUTE__ symbol is not used in the OpenAFS code.
 dnl
 AC_DEFUN([OPENAFS_C_ATTRIBUTE], [
   AX_GCC_FUNC_ATTRIBUTE([always_inline])
+  AX_GCC_FUNC_ATTRIBUTE([fallthrough])
   AX_GCC_FUNC_ATTRIBUTE([format])
   AX_GCC_FUNC_ATTRIBUTE([nonnull])
   AX_GCC_FUNC_ATTRIBUTE([noreturn])
index 87f8e69..4aa9242 100644 (file)
@@ -691,7 +691,7 @@ ResetSyntax(struct cmd_syndesc *as)
        case CMD_SINGLE_OR_FLAG:
            if (tp->items == &dummy)
                break;
-           /* fall through */
+           AFS_FALLTHROUGH;
        case CMD_SINGLE:
        case CMD_LIST:
            /* free whole list in both cases, just for fun */
index 18ab2e3..254856d 100644 (file)
@@ -307,6 +307,14 @@ hdr_static_inline(unsigned long long) afs_printable_uint64_lu(afs_uint64 d) { re
 # define AFS_NONNULL(x)
 #endif
 
+#if defined(AFS_LINUX26_ENV) && defined(fallthrough)
+# define AFS_FALLTHROUGH fallthrough
+#elif defined(HAVE_FUNC_ATTRIBUTE_FALLTHROUGH)
+# define AFS_FALLTHROUGH __attribute__((fallthrough))
+#else
+# define AFS_FALLTHROUGH do {} while(0)
+#endif
+
 /*
  * Conditionally remove unreached statements under Solaris Studio.
  */
index d110735..5fedaa1 100644 (file)
@@ -79,13 +79,10 @@ opr_jhash(const afs_uint32 *k, size_t length, afs_uint32 initval)
 
     /* All the case statements fall through */
     switch(length) {
-      case 3 : c+=k[2];
-       /* fall through */
-      case 2 : b+=k[1];
-       /* fall through */
+      case 3 : c+=k[2];                        AFS_FALLTHROUGH;
+      case 2 : b+=k[1];                        AFS_FALLTHROUGH;
       case 1 : a+=k[0];
-       opr_jhash_final(a, b, c);
-       /* fall through */
+       opr_jhash_final(a, b, c);       AFS_FALLTHROUGH;
       case 0:     /* case 0: nothing left to add */
        break;
     }
@@ -150,19 +147,19 @@ opr_jhash_opaque(const void *val, size_t length, afs_uint32 initval)
 
     /* All the case statements fall through */
     switch(length) {
-      case 12 : c += (afs_uint32) str[11]<<24;         /* fall through */
-      case 11 : c += (afs_uint32) str[10]<<16;         /* fall through */
-      case 10 : c += (afs_uint32) str[9]<<8;   /* fall through */
-      case 9  : c += (afs_uint32) str[8];      /* fall through */
-      case 8  : b += (afs_uint32) str[7]<<24;  /* fall through */
-      case 7  : b += (afs_uint32) str[6]<<16;  /* fall through */
-      case 6  : b += (afs_uint32) str[5]<<8;   /* fall through */
-      case 5  : b += (afs_uint32) str[4];      /* fall through */
-      case 4  : a += (afs_uint32) str[3]<<24;  /* fall through */
-      case 3  : a += (afs_uint32) str[2]<<16;  /* fall through */
-      case 2  : a += (afs_uint32) str[1]<<8;   /* fall through */
+      case 12 : c += (afs_uint32) str[11]<<24; AFS_FALLTHROUGH;
+      case 11 : c += (afs_uint32) str[10]<<16; AFS_FALLTHROUGH;
+      case 10 : c += (afs_uint32) str[9]<<8;   AFS_FALLTHROUGH;
+      case 9  : c += (afs_uint32) str[8];      AFS_FALLTHROUGH;
+      case 8  : b += (afs_uint32) str[7]<<24;  AFS_FALLTHROUGH;
+      case 7  : b += (afs_uint32) str[6]<<16;  AFS_FALLTHROUGH;
+      case 6  : b += (afs_uint32) str[5]<<8;   AFS_FALLTHROUGH;
+      case 5  : b += (afs_uint32) str[4];      AFS_FALLTHROUGH;
+      case 4  : a += (afs_uint32) str[3]<<24;  AFS_FALLTHROUGH;
+      case 3  : a += (afs_uint32) str[2]<<16;  AFS_FALLTHROUGH;
+      case 2  : a += (afs_uint32) str[1]<<8;   AFS_FALLTHROUGH;
       case 1  : a += (afs_uint32) str[0];
-       opr_jhash_final(a, b, c);               /* fall through */
+       opr_jhash_final(a, b, c);               AFS_FALLTHROUGH;
       case 0:     /* case 0: nothing left to add */
        break;
     }
index 59cc646..512491e 100644 (file)
@@ -122,6 +122,8 @@ rxi_calltrace(unsigned int event, struct rx_call *call)
 
     case RX_CALL_ARRIVAL:
        call->traceWait = now;
+       break;
+
     default:
        break;
     }
index b1efad3..7d23917 100644 (file)
@@ -424,7 +424,7 @@ xdr_bytes(XDR * xdrs, char **cpp, u_int * sizep,
        if (sp == NULL) {
            return (FALSE);
        }
-       /* fall through */
+       AFS_FALLTHROUGH;
 
     case XDR_ENCODE:
        return (xdr_opaque(xdrs, sp, nodesize));
@@ -519,7 +519,7 @@ xdr_string(XDR * xdrs, char **cpp, u_int maxsize)
        if (sp == NULL) {
            return (TRUE);      /* already free */
        }
-       /* Fall through */
+       AFS_FALLTHROUGH;
     case XDR_ENCODE:
        size = strlen(sp);
        break;
@@ -547,7 +547,7 @@ xdr_string(XDR * xdrs, char **cpp, u_int maxsize)
            return (FALSE);
        }
        sp[size] = 0;
-       /* fall through */
+       AFS_FALLTHROUGH;
 
     case XDR_ENCODE:
        return (xdr_opaque(xdrs, sp, size));
index f4402f9..ea5ed3e 100644 (file)
@@ -750,7 +750,7 @@ tkt_DeriveDesKey(int enctype, void *keydata, size_t keylen,
     case KRB5_ENCTYPE_DES3_CBC_SHA1:
        if (compress_parity_bits(keydata, &keylen))
            return 1;
-       /* FALLTHROUGH */
+       AFS_FALLTHROUGH;
     default:
        if (enctype < 0)
            return 1;
index aaed1a7..a8eeb19 100644 (file)
@@ -442,7 +442,7 @@ xyzprintf(struct state *state, const char *char_format, va_list ap)
                }
            case '\0':
                --format;
-               /* FALLTHROUGH */
+               AFS_FALLTHROUGH;
            case '%':
                if ((*state->append_char) (state, c))
                    return -1;
index 1940b3b..f4e5e4b 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 /* parsevnode.c - Parse a VNode */
-
+#include <afsconfig.h>
 #include <sys/types.h>
 #include <netinet/in.h>
 #include <errno.h>
@@ -480,7 +480,7 @@ parse_vdata(XFILE * X, unsigned char *tag, tagged_field * field,
                    return r;
                break;
            }
-           /* fall through */
+           AFS_FALLTHROUGH;
        default:
            if ((r = xfskip(X, v->size)))
                return r;
index 8b14fdd..9d0b745 100644 (file)
@@ -140,7 +140,7 @@ pass2()
 #else /* no ACLS */
        statemap[ROOTINO] = DSTATE;
 #endif /* ACLS */
-       /* fall into ... */
+       AFS_FALLTHROUGH;
 
     case DSTATE:
        descend(&rootdesc, ROOTINO);
@@ -347,7 +347,7 @@ pass2check(idesc)
                else if ((n = reply("REMOVE")) == 1)
                    break;
            }
-           /* fall through */
+           AFS_FALLTHROUGH;
 
        case FSTATE:
 #ifdef VICE
index 8e6cd6d..4ac84fe 100644 (file)
@@ -213,7 +213,7 @@ pass5()
            case DCLEAR:
            case DFOUND:
                newcg->cg_cs.cs_ndir++;
-               /* fall through */
+               AFS_FALLTHROUGH;
 
 #ifdef VICE
            case VSTATE:
index 8cf3b55..720e6ef 100644 (file)
@@ -954,6 +954,7 @@ FSYNC_com_VolOff(FSSYNC_VolOp_command * vcom, SYNC_response * res)
 
                VOL_CV_WAIT(&V_attachCV(vp));
            }
+           break;
 
        case debugUtility:
            break;
@@ -996,7 +997,7 @@ FSYNC_com_VolOff(FSSYNC_VolOp_command * vcom, SYNC_response * res)
             * attaching the volume would be safe */
            VRegisterVolOp_r(vp, &info);
            vp->pending_vol_op->vol_op_state = FSSYNC_VolOpRunningUnknown;
-           /* fall through */
+           goto done;
 
        case VOL_STATE_DELETED:
            goto done;
@@ -1026,7 +1027,7 @@ FSYNC_com_VolOff(FSSYNC_VolOp_command * vcom, SYNC_response * res)
                  * attaching the volume would be safe */
                 VRegisterVolOp_r(vp, &info);
                 vp->pending_vol_op->vol_op_state = FSSYNC_VolOpRunningUnknown;
-               /* fall through */
+               goto done;
 
             case VOL_STATE_DELETED:
                 goto done;
index bf3d101..1e522c9 100644 (file)
@@ -478,7 +478,7 @@ SalvageClient(VolumeId vid, char * pname)
        switch (sres.state) {
        case SALVSYNC_STATE_ERROR:
            printf("salvageserver reports salvage ended in an error; check log files for more details\n");
-           /* fall through */
+           AFS_FALLTHROUGH;
        case SALVSYNC_STATE_DONE:
        case SALVSYNC_STATE_UNKNOWN:
            done = 1;
index 8eb879f..fbbc70b 100644 (file)
@@ -940,7 +940,7 @@ LinkNode(struct SalvageQueueNode * parent,
     switch (clone->state) {
     case SALVSYNC_STATE_QUEUED:
        DeleteFromSalvageQueue(clone);
-       /* fall through */
+       AFS_FALLTHROUGH;
     case SALVSYNC_STATE_SALVAGING:
        switch (parent->state) {
        case SALVSYNC_STATE_UNKNOWN:
index 6d4af59..f52a560 100644 (file)
@@ -1790,18 +1790,18 @@ ShutdownVolumeWalk_r(struct DiskPartition64 * dp, int pass,
                (V_attachState(vp) != VOL_STATE_PREATTACHED)) {
                break;
            }
-           /* fall through */
+           AFS_FALLTHROUGH;
        case 1:
            if ((V_attachState(vp) == VOL_STATE_ATTACHED) &&
                (vp->header == NULL)) {
                break;
            }
-           /* fall through */
+           AFS_FALLTHROUGH;
        case 2:
            if (VIsExclusiveState(V_attachState(vp))) {
                break;
            }
-           /* fall through */
+           AFS_FALLTHROUGH;
        case 3:
            *idx = nqp;
            DeleteVolumeFromVByPList_r(vp);
@@ -1845,6 +1845,7 @@ VShutdownVolume_r(Volume * vp)
     case VOL_STATE_PREATTACHED:
     case VOL_STATE_ERROR:
        VChangeState_r(vp, VOL_STATE_UNATTACHED);
+       break;
     case VOL_STATE_UNATTACHED:
     case VOL_STATE_DELETED:
        break;
index 6a6e72c..13bba38 100644 (file)
@@ -2276,6 +2276,7 @@ GetVolInfo(afs_uint32 partId,
        case VOL_INFO_LIST_SINGLE:
            Log("1 Volser: GetVolInfo: Volume %" AFS_VOLID_FMT " (%s:%s) will be destroyed on next salvage\n",
                afs_printable_VolumeId_lu(volumeId), pname, volname);
+           goto drop;
 
        default:
            goto drop;