Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Oct 2017 02:48:37 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325050 - head/sys/ufs/ffs
Message-ID:  <201710280248.v9S2mbHR005628@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Sat Oct 28 02:48:37 2017
New Revision: 325050
URL: https://svnweb.freebsd.org/changeset/base/325050

Log:
  Remove workqueue items after updating the workqueue tail pointer.
  
  When QUEUE_MACRO_DEBUG_TRASH is configured, the queue linkage fields
  are trashed upon removal of the item, so be sure to only read them before
  removing the item.
  
  No functional change intended.
  
  MFC after:	1 week
  Sponsored by:	Dell EMC Isilon

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

Modified: head/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- head/sys/ufs/ffs/ffs_softdep.c	Fri Oct 27 21:48:02 2017	(r325049)
+++ head/sys/ufs/ffs/ffs_softdep.c	Sat Oct 28 02:48:37 2017	(r325050)
@@ -1535,10 +1535,10 @@ remove_from_worklist(wk)
 	struct ufsmount *ump;
 
 	ump = VFSTOUFS(wk->wk_mp);
-	WORKLIST_REMOVE(wk);
 	if (ump->softdep_worklist_tail == wk)
 		ump->softdep_worklist_tail =
 		    (struct worklist *)wk->wk_list.le_prev;
+	WORKLIST_REMOVE(wk);
 	ump->softdep_on_worklist -= 1;
 }
 
@@ -1836,11 +1836,11 @@ process_worklist_item(mp, target, flags)
 		wake_worklist(wk);
 		add_to_worklist(wk, WK_HEAD);
 	}
-	LIST_REMOVE(&sentinel, wk_list);
 	/* Sentinal could've become the tail from remove_from_worklist. */
 	if (ump->softdep_worklist_tail == &sentinel)
 		ump->softdep_worklist_tail =
 		    (struct worklist *)sentinel.wk_list.le_prev;
+	LIST_REMOVE(&sentinel, wk_list);
 	PRELE(curproc);
 	return (matchcnt);
 }
@@ -2894,7 +2894,6 @@ remove_from_journal(wk)
 	if (ump->softdep_journal_tail == wk)
 		ump->softdep_journal_tail =
 		    (struct worklist *)wk->wk_list.le_prev;
-
 	WORKLIST_REMOVE(wk);
 	ump->softdep_on_journal -= 1;
 }



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