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 computation of left-over fragments also ...



details:   https://anonhg.NetBSD.org/src/rev/65f825e481c4
branches:  trunk
changeset: 356721:65f825e481c4
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Mon Oct 09 05:24:26 2017 +0000

description:
Fix computation of left-over fragments also for ufs2.

Fixes PR 52600.

diffstat:

 sbin/resize_ffs/resize_ffs.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r 3cfb91658681 -r 65f825e481c4 sbin/resize_ffs/resize_ffs.c
--- a/sbin/resize_ffs/resize_ffs.c      Sun Oct 08 21:33:38 2017 +0000
+++ b/sbin/resize_ffs/resize_ffs.c      Mon Oct 09 05:24:26 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: resize_ffs.c,v 1.52 2017/10/01 22:59:19 christos Exp $ */
+/*     $NetBSD: resize_ffs.c,v 1.53 2017/10/09 05:24:26 mlelstv 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.52 2017/10/01 22:59:19 christos Exp $");
+__RCSID("$NetBSD: resize_ffs.c,v 1.53 2017/10/09 05:24:26 mlelstv Exp $");
 
 #include <sys/disk.h>
 #include <sys/disklabel.h>
@@ -595,16 +595,17 @@
                        cg_clustersum(cg, 0)[(n > newsb->fs_contigsumsize) ?
                            newsb->fs_contigsumsize : n]++;
                }
-               if (is_ufs2 == 0)
-                       for (i = n; i > 0; i--) {
+               for (i = n; i > 0; i--) {
+                       if (is_ufs2 == 0) {
                                old_cg_blktot(cg, 0)[old_cbtocylno(newsb,
                                            dhigh)]++;
                                old_cg_blks(newsb, cg,
                                    old_cbtocylno(newsb, dhigh),
                                    0)[old_cbtorpos(newsb,
                                            dhigh)]++;
-                               dhigh += newsb->fs_frag;
                        }
+                       dhigh += newsb->fs_frag;
+               }
        }
        /* Deal with any leftover frag at the end of the cg. */
        i = dmax - dhigh;



Home | Main Index | Thread Index | Old Index