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@
This commit is contained in:
Warner Losh 2019-12-18 16:01:15 +00:00
parent a4c5668d12
commit 56e4d45895

View file

@ -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