Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ffs Don't cache buffers used when finding the superb...



details:   https://anonhg.NetBSD.org/src/rev/4d0e1846cc8d
branches:  trunk
changeset: 545632:4d0e1846cc8d
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Sat Apr 12 10:35:58 2003 +0000

description:
Don't cache buffers used when finding the superblock, it can lead to
seeing bogus data for the first cg with certain block/frag sizes.
>From enami tsugutomo.

diffstat:

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

diffs (40 lines):

diff -r 71fd95917ec6 -r 4d0e1846cc8d sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c  Sat Apr 12 10:33:17 2003 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c  Sat Apr 12 10:35:58 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_vfsops.c,v 1.111 2003/04/05 13:37:36 fvdl Exp $    */
+/*     $NetBSD: ffs_vfsops.c,v 1.112 2003/04/12 10:35:58 fvdl Exp $    */
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1994
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.111 2003/04/05 13:37:36 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.112 2003/04/12 10:35:58 fvdl Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -743,16 +743,16 @@
                        fsblockloc = bswap64(fs->fs_sblockloc);
                        needswap = 1;
 #endif
-               } else {
-                       brelse(bp);
-                       bp = NULL;
-                       continue;
-               }
+               } else
+                       goto next_sblock;
 
                if ((fsblockloc == sblockloc ||
                     (fs->fs_old_flags & FS_FLAGS_UPDATED) == 0)
                    && sbsize <= MAXBSIZE && sbsize >= sizeof(struct fs))
                        break;
+
+next_sblock:
+               bp->b_flags |= B_NOCACHE;
                brelse(bp);
                bp = NULL;
        }



Home | Main Index | Thread Index | Old Index