From 56e4d45895c8ea8f6b283785287bb9deacefcf12 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 18 Dec 2019 16:01:15 +0000 Subject: [PATCH] Drop a sleepable lock when we plan on sleeping g_io_speedup waits for the completion of the speedup request before proceeding using biowait(), but check_clear_deps is called with the softdeps lock held (which is non-sleepable). It's safe to drop this lock around the call to speedup, so do that. Submitted by: Peter Holm Reviewed by: kib@ --- sys/ufs/ffs/ffs_softdep.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 88a97aad6e3..00b3c5eec83 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -13744,6 +13744,7 @@ static void check_clear_deps(mp) struct mount *mp; { + struct ufsmount *ump; size_t resid; /* @@ -13751,8 +13752,11 @@ check_clear_deps(mp) * that have been delayed for performance reasons should * proceed to help alleviate the shortage faster. */ - g_io_speedup(0, BIO_SPEEDUP_TRIM | BIO_SPEEDUP_WRITE, &resid, - VFSTOUFS(mp)->um_cp); + ump = VFSTOUFS(mp); + FREE_LOCK(ump); + g_io_speedup(0, BIO_SPEEDUP_TRIM | BIO_SPEEDUP_WRITE, &resid, ump->um_cp); + ACQUIRE_LOCK(ump); + /* * If we are suspended, it may be because of our using