Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/resize_ffs Fix another dodgy switch-jump.



details:   https://anonhg.NetBSD.org/src/rev/a9aa0f0512ed
branches:  trunk
changeset: 768351:a9aa0f0512ed
user:      dholland <dholland%NetBSD.org@localhost>
date:      Mon Aug 15 02:22:46 2011 +0000

description:
Fix another dodgy switch-jump.

diffstat:

 sbin/resize_ffs/resize_ffs.c |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (54 lines):

diff -r 803e7cbfb0e7 -r a9aa0f0512ed sbin/resize_ffs/resize_ffs.c
--- a/sbin/resize_ffs/resize_ffs.c      Mon Aug 15 02:19:50 2011 +0000
+++ b/sbin/resize_ffs/resize_ffs.c      Mon Aug 15 02:22:46 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: resize_ffs.c,v 1.30 2011/08/15 02:19:50 dholland Exp $ */
+/*     $NetBSD: resize_ffs.c,v 1.31 2011/08/15 02:22:46 dholland Exp $ */
 /* From sources sent on February 17, 2003 */
 /*-
  * As its sole author, I explicitly place this code in the public
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: resize_ffs.c,v 1.30 2011/08/15 02:19:50 dholland Exp $");
+__RCSID("$NetBSD: resize_ffs.c,v 1.31 2011/08/15 02:22:46 dholland Exp $");
 
 #include <sys/disk.h>
 #include <sys/disklabel.h>
@@ -1157,11 +1157,13 @@
        fn = (mark_callback_t) arg;
        switch (DIP(di,di_mode) & IFMT) {
        case IFLNK:
-               if (filesize > newsb->fs_maxsymlinklen) {
+               if (filesize <= newsb->fs_maxsymlinklen) {
+                       break;
+               }
+               /* FALLTHROUGH */
        case IFDIR:
        case IFREG:
-                       map_inode_data_blocks(di, fn);
-               }
+               map_inode_data_blocks(di, fn);
                break;
        }
 }
@@ -1956,7 +1958,7 @@
                        break;
                case IFDIR:
                        cg->cg_cs.cs_ndir++;
-                       /* fall through */
+                       /* FALLTHROUGH */
                default:
                        set_bits(cg_inosused(cg, 0), iwc, 1);
                        break;
@@ -2126,8 +2128,8 @@
                readat(where / DEV_BSIZE, oldsb, SBLOCKSIZE);
                switch (oldsb->fs_magic) {
                case FS_UFS2_MAGIC:
+                       is_ufs2 = 1;
                        /* FALLTHROUGH */
-                       is_ufs2 = 1;
                case FS_UFS1_MAGIC:
                        needswap = 0;
                        break;



Home | Main Index | Thread Index | Old Index