From 3a715f43c66e2a3717c8200ae7458a4e5974b676 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Fri, 10 Nov 2000 14:54:15 +0000 Subject: [PATCH] Quick fix for not writing group descriptor group, inode bitmaps or block bitmaps before unmount() completes. They were written using bdwrite(), so they were normally written less than 32 seconds after unmount(), but this is too late if the media is removed or the system is rebooted soon after unmount(). sync()ing before unmount() didn't help, because ext2fs uses buggy private caching for these blocks -- it doesn't even bdwrite() them until they are uncached or the filesystem is unmounted. sync()ing after unmount() didn't help, because sync() only applies to (vnodes for) mounted filesystems. PR: 22726 --- sys/gnu/ext2fs/fs.h | 3 ++- sys/gnu/fs/ext2fs/fs.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/gnu/ext2fs/fs.h b/sys/gnu/ext2fs/fs.h index b8dab54606a..8bedb05f330 100644 --- a/sys/gnu/ext2fs/fs.h +++ b/sys/gnu/ext2fs/fs.h @@ -37,6 +37,7 @@ * SUCH DAMAGE. * * @(#)fs.h 8.7 (Berkeley) 4/19/94 + * $FreeBSD$ */ /* @@ -177,7 +178,7 @@ extern u_char *fragtbl[]; bremfree(bp); \ splx(s); \ if (flags & B_DIRTY) \ - bdwrite(bp); \ + bwrite(bp); \ else \ brelse(bp); \ } diff --git a/sys/gnu/fs/ext2fs/fs.h b/sys/gnu/fs/ext2fs/fs.h index b8dab54606a..8bedb05f330 100644 --- a/sys/gnu/fs/ext2fs/fs.h +++ b/sys/gnu/fs/ext2fs/fs.h @@ -37,6 +37,7 @@ * SUCH DAMAGE. * * @(#)fs.h 8.7 (Berkeley) 4/19/94 + * $FreeBSD$ */ /* @@ -177,7 +178,7 @@ extern u_char *fragtbl[]; bremfree(bp); \ splx(s); \ if (flags & B_DIRTY) \ - bdwrite(bp); \ + bwrite(bp); \ else \ brelse(bp); \ }