Author: kib
Date: Wed Mar 23 09:58:51 2016
New Revision: 297206
URL: https://svnweb.freebsd.org/changeset/base/297206

Log:
  Fix locking mistake in softdep_waitidle().  The surrounding code
  expects that the loop is always exited with the SU lock owned, even on
  error.
  
  Reported and tested by:       pho
  Sponsored by: The FreeBSD Foundation
  MFC after:    3 days

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

Modified: head/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- head/sys/ufs/ffs/ffs_softdep.c      Wed Mar 23 04:18:57 2016        
(r297205)
+++ head/sys/ufs/ffs/ffs_softdep.c      Wed Mar 23 09:58:51 2016        
(r297206)
@@ -1937,9 +1937,9 @@ softdep_waitidle(struct mount *mp, int f
                vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
                error = VOP_FSYNC(devvp, MNT_WAIT, td);
                VOP_UNLOCK(devvp, 0);
+               ACQUIRE_LOCK(ump);
                if (error != 0)
                        break;
-               ACQUIRE_LOCK(ump);
        }
        ump->softdep_req = 0;
        if (i == SU_WAITIDLE_RETRIES && error == 0 && ump->softdep_deps != 0) {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to