Module Name:    src
Committed By:   maxv
Date:           Sun Mar 15 09:21:01 UTC 2015

Modified Files:
        src/sys/ufs/ffs: ffs_vfsops.c

Log Message:
ffs_reload(): fix a bug that prevents Big Endian FSes from being reloaded.
'newfs' should be tagged as FS_SWAPPED, not 'fs'.

Was here before my changes.

While here, also KNF a bit.


To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 src/sys/ufs/ffs/ffs_vfsops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.323 src/sys/ufs/ffs/ffs_vfsops.c:1.324
--- src/sys/ufs/ffs/ffs_vfsops.c:1.323	Sat Mar 14 19:52:54 2015
+++ src/sys/ufs/ffs/ffs_vfsops.c	Sun Mar 15 09:21:01 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.323 2015/03/14 19:52:54 maxv Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.324 2015/03/15 09:21:01 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.323 2015/03/14 19:52:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.324 2015/03/15 09:21:01 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -727,16 +727,16 @@ ffs_reload(struct mount *mp, kauth_cred_
 
 #ifdef FFS_EI
 	if (ump->um_flags & UFS_NEEDSWAP) {
-		ffs_sb_swap((struct fs*)bp->b_data, newfs);
-		fs->fs_flags |= FS_SWAPPED;
+		ffs_sb_swap((struct fs *)bp->b_data, newfs);
+		newfs->fs_flags |= FS_SWAPPED;
 	} else
 #endif
-		fs->fs_flags &= ~FS_SWAPPED;
+		newfs->fs_flags &= ~FS_SWAPPED;
 
 	brelse(bp, 0);
 
-	if ((newfs->fs_magic != FS_UFS1_MAGIC &&
-	     newfs->fs_magic != FS_UFS2_MAGIC)) {
+	if ((newfs->fs_magic != FS_UFS1_MAGIC) &&
+	    (newfs->fs_magic != FS_UFS2_MAGIC)) {
 		kmem_free(newfs, fs_sbsize);
 		return (EIO);		/* XXX needs translation */
 	}
@@ -757,7 +757,6 @@ ffs_reload(struct mount *mp, kauth_cred_
 		return (EINVAL);
 	}
 
-
 	/* Store off old fs_sblockloc for fs_oldfscompat_read. */
 	sblockloc = fs->fs_sblockloc;
 	/*

Reply via email to