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
This commit is contained in:
parent
f2c6083361
commit
43af3dde11
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user