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
This commit is contained in:
Konstantin Belousov 2021-06-15 13:27:37 +03:00
parent 2126f103e0
commit 50acaaef54

View file

@ -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);
}