Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Dec 2019 16:01:15 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355882 - head/sys/ufs/ffs
Message-ID:  <201912181601.xBIG1F9P096463@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Wed Dec 18 16:01:15 2019
New Revision: 355882
URL: https://svnweb.freebsd.org/changeset/base/355882

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

Modified:
  head/sys/ufs/ffs/ffs_softdep.c

Modified: head/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- head/sys/ufs/ffs/ffs_softdep.c	Wed Dec 18 12:06:34 2019	(r355881)
+++ head/sys/ufs/ffs/ffs_softdep.c	Wed Dec 18 16:01:15 2019	(r355882)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912181601.xBIG1F9P096463>