svn commit: r267031 - head/sys/ufs/ffs

John-Mark Gurney jmg at FreeBSD.org
Tue Jun 3 21:46:14 UTC 2014


Author: jmg
Date: Tue Jun  3 21:46:13 2014
New Revision: 267031
URL: http://svnweb.freebsd.org/changeset/base/267031

Log:
  don't check fs_flags for _FLAGS_UPDATED as it is stored in fs_old_flags..
  If you had a UFS2 FS that didn't have it's super block at SBLOCK_UFS2,
  you'll end up corrupting your FS as the superblock is updated and written
  to a different location...
  
  makefs used to put the superblock at SBLOCK_UFS1 for UFS 2 FS's causing
  this issue...
  
  Reviewed by:	silience from mckusick
  MFC after:	1 week

Modified:
  head/sys/ufs/ffs/ffs_vfsops.c

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vfsops.c	Tue Jun  3 21:31:28 2014	(r267030)
+++ head/sys/ufs/ffs/ffs_vfsops.c	Tue Jun  3 21:46:13 2014	(r267031)
@@ -1931,13 +1931,13 @@ ffs_sbupdate(ump, waitfor, suspended)
 	}
 	bp = sbbp;
 	if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_sblockloc != SBLOCK_UFS1 &&
-	    (fs->fs_flags & FS_FLAGS_UPDATED) == 0) {
+	    (fs->fs_old_flags & FS_FLAGS_UPDATED) == 0) {
 		printf("WARNING: %s: correcting fs_sblockloc from %jd to %d\n",
 		    fs->fs_fsmnt, fs->fs_sblockloc, SBLOCK_UFS1);
 		fs->fs_sblockloc = SBLOCK_UFS1;
 	}
 	if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_sblockloc != SBLOCK_UFS2 &&
-	    (fs->fs_flags & FS_FLAGS_UPDATED) == 0) {
+	    (fs->fs_old_flags & FS_FLAGS_UPDATED) == 0) {
 		printf("WARNING: %s: correcting fs_sblockloc from %jd to %d\n",
 		    fs->fs_fsmnt, fs->fs_sblockloc, SBLOCK_UFS2);
 		fs->fs_sblockloc = SBLOCK_UFS2;


More information about the svn-src-head mailing list