diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2021-06-15 10:27:37 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2021-06-23 20:47:05 +0000 |
commit | 50acaaef54b4d7811393eb8c05a398d7a1882418 (patch) | |
tree | 008b0f4d0e714204d778cb1a30b60228843460fb | |
parent | 2126f103e0434db6ca34f0a5167bf5f03d4f02ad (diff) |
ffs_softdep: force sync if journal is low in journal_check_space
This effectively causes syncing of the mount point from softdep_prealloc(),
softdep_prerename(), and softdep_prelink(). Typically it avoids the need
for journal suspension at this point, at all.
Suggested and reviewed by: mckusick
Discussed with: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D30041
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index efb63d94af31..2f9819ff7023 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -3226,10 +3226,17 @@ static void journal_check_space(ump) struct ufsmount *ump; { + struct mount *mp; + LOCK_OWNED(ump); if (journal_space(ump, 0) == 0) { softdep_speedup(ump); + mp = UFSTOVFS(ump); + FREE_LOCK(ump); + VFS_SYNC(mp, MNT_NOWAIT); + ffs_sbupdate(ump, MNT_WAIT, 0); + ACQUIRE_LOCK(ump); if (journal_space(ump, 1) == 0) journal_suspend(ump); } |