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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to