summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs/ffs_vfsops.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-04-10 02:23:44 +0000
committerkib <kib@FreeBSD.org>2015-04-10 02:23:44 +0000
commit6b6e486121afe6203d138c1089582dbb4617e997 (patch)
treed8da6296f235e1f41a45ffd5b4900bca4345e664 /sys/ufs/ffs/ffs_vfsops.c
parent036979b3f8248aa22f93a69ead97446775b48e26 (diff)
downloadFreeBSD-src-6b6e486121afe6203d138c1089582dbb4617e997.zip
FreeBSD-src-6b6e486121afe6203d138c1089582dbb4617e997.tar.gz
MFC r280760:
Fix the hand after the immediate reboot after the init binary is unlinked. MFC r280763: Fix build (with gcc).
Diffstat (limited to 'sys/ufs/ffs/ffs_vfsops.c')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 41e29c0..881da62 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1502,8 +1502,11 @@ ffs_sync(mp, waitfor)
if (fs->fs_fmod != 0 && fs->fs_ronly != 0 && ump->um_fsckpid == 0)
panic("%s: ffs_sync: modification on read-only filesystem",
fs->fs_fsmnt);
- if (waitfor == MNT_LAZY)
- return (ffs_sync_lazy(mp));
+ if (waitfor == MNT_LAZY) {
+ if (!rebooting)
+ return (ffs_sync_lazy(mp));
+ waitfor = MNT_NOWAIT;
+ }
/*
* Write back each (modified) inode.
@@ -1560,7 +1563,7 @@ loop:
/*
* Force stale filesystem control information to be flushed.
*/
- if (waitfor == MNT_WAIT) {
+ if (waitfor == MNT_WAIT || rebooting) {
if ((error = softdep_flushworklist(ump->um_mountp, &count, td)))
allerror = error;
/* Flushed work items may create new vnodes to clean */
@@ -1577,9 +1580,12 @@ loop:
if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0) {
BO_UNLOCK(bo);
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
- if ((error = VOP_FSYNC(devvp, waitfor, td)) != 0)
- allerror = error;
+ error = VOP_FSYNC(devvp, waitfor, td);
VOP_UNLOCK(devvp, 0);
+ if (MOUNTEDSOFTDEP(mp) && (error == 0 || error == EAGAIN))
+ error = ffs_sbupdate(ump, waitfor, 0);
+ if (error != 0)
+ allerror = error;
if (allerror == 0 && waitfor == MNT_WAIT)
goto loop;
} else if (suspend != 0) {
OpenPOWER on IntegriCloud