Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ffs make sure to not get flags which are for interna...



details:   https://anonhg.NetBSD.org/src/rev/b01cf83bbafd
branches:  trunk
changeset: 551874:b01cf83bbafd
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sat Sep 13 14:09:15 2003 +0000

description:
make sure to not get flags which are for internal use only from the on-disk
superblock.
Proposed in http://mail-index.netbsd.org/tech-kern/2003/09/06/0005.html

diffstat:

 sys/ufs/ffs/ffs_vfsops.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r 756c4676f6cd -r b01cf83bbafd sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c  Sat Sep 13 13:54:30 2003 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c  Sat Sep 13 14:09:15 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_vfsops.c,v 1.120 2003/09/13 13:47:04 bouyer Exp $  */
+/*     $NetBSD: ffs_vfsops.c,v 1.121 2003/09/13 14:09:15 bouyer Exp $  */
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1994
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.120 2003/09/13 13:47:04 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.121 2003/09/13 14:09:15 bouyer Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -494,8 +494,9 @@
        if (ump->um_flags & UFS_NEEDSWAP) {
                ffs_sb_swap((struct fs*)bp->b_data, newfs);
                fs->fs_flags |= FS_SWAPPED;
-       }
+       } else
 #endif
+               fs->fs_flags &= ~FS_SWAPPED;
        if ((newfs->fs_magic != FS_UFS1_MAGIC &&        
             newfs->fs_magic != FS_UFS2_MAGIC)||
             newfs->fs_bsize > MAXBSIZE ||
@@ -779,8 +780,9 @@
        if (needswap) {
                ffs_sb_swap((struct fs*)bp->b_data, fs);
                fs->fs_flags |= FS_SWAPPED;
-       }
+       } else
 #endif
+               fs->fs_flags &= ~FS_SWAPPED;
 
        if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) {
                fs->fs_pendingblocks = 0;



Home | Main Index | Thread Index | Old Index