Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ffs Fix a recently introduced bug which prevents csu...



details:   https://anonhg.NetBSD.org/src/rev/e47bbeb1d8a8
branches:  trunk
changeset: 552052:e47bbeb1d8a8
user:      enami <enami%NetBSD.org@localhost>
date:      Wed Sep 17 02:24:33 2003 +0000

description:
Fix a recently introduced bug which prevents csum totals being copied
when an old ffs filesytem is first mounted (as a result, df reports disk
full on old ffs filesystem or mfs created by old binary).  Problem first
noticed by onoe san.

diffstat:

 sys/ufs/ffs/ffs_vfsops.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (59 lines):

diff -r c70e5c118ef8 -r e47bbeb1d8a8 sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c  Wed Sep 17 00:41:39 2003 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c  Wed Sep 17 02:24:33 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_vfsops.c,v 1.121 2003/09/13 14:09:15 bouyer Exp $  */
+/*     $NetBSD: ffs_vfsops.c,v 1.122 2003/09/17 02:24:33 enami Exp $   */
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1994
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.121 2003/09/13 14:09:15 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.122 2003/09/17 02:24:33 enami Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -961,6 +961,7 @@
        daddr_t sblockloc;
 {
        off_t maxfilesize;
+       int old_ufs1;
 
        if (fs->fs_magic != FS_UFS1_MAGIC)
                return;
@@ -969,7 +970,8 @@
         * If not yet done, update UFS1 superblock with new wider fields,
         * and  update fs_flags location and value of fs_sblockloc.
         */
-       if (fs->fs_maxbsize != fs->fs_bsize) {
+       old_ufs1 = fs->fs_maxbsize != fs->fs_bsize;
+       if (old_ufs1) {
                fs->fs_maxbsize = fs->fs_bsize;
                fs->fs_time = fs->fs_old_time;
                fs->fs_size = fs->fs_old_size;
@@ -979,12 +981,13 @@
                fs->fs_flags = fs->fs_old_flags;
                fs->fs_old_flags |= FS_FLAGS_UPDATED;
        }
+
        /*
         * If the new fields haven't been set yet, or if the filesystem
         * was mounted and modified by an old kernel, use the old csum
         * totals, and update the flags
         */
-       if (fs->fs_maxbsize != fs->fs_bsize || fs->fs_time < fs->fs_old_time) {
+       if (old_ufs1 || fs->fs_time < fs->fs_old_time) {
                fs->fs_cstotal.cs_ndir = fs->fs_old_cstotal.cs_ndir;
                fs->fs_cstotal.cs_nbfree = fs->fs_old_cstotal.cs_nbfree;
                fs->fs_cstotal.cs_nifree = fs->fs_old_cstotal.cs_nifree;
@@ -992,7 +995,6 @@
                fs->fs_flags |= (fs->fs_old_flags & ~FS_FLAGS_UPDATED);
        }
 
-
        if (fs->fs_old_inodefmt < FS_44INODEFMT) {
                fs->fs_maxfilesize = (u_quad_t) 1LL << 39;
                fs->fs_qbmask = ~fs->fs_bmask;



Home | Main Index | Thread Index | Old Index