svn commit: r357033 - stable/12/sys/ufs/ffs

Kirk McKusick mckusick at FreeBSD.org
Thu Jan 23 06:20:58 UTC 2020


Author: mckusick
Date: Thu Jan 23 06:20:57 2020
New Revision: 357033
URL: https://svnweb.freebsd.org/changeset/base/357033

Log:
  MFC of 356714
  
  Fix DIRCHG panic

Modified:
  stable/12/sys/ufs/ffs/ffs_softdep.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- stable/12/sys/ufs/ffs/ffs_softdep.c	Thu Jan 23 06:18:08 2020	(r357032)
+++ stable/12/sys/ufs/ffs/ffs_softdep.c	Thu Jan 23 06:20:57 2020	(r357033)
@@ -9821,14 +9821,20 @@ handle_workitem_remove(dirrem, flags)
 	/*
 	 * Move all dependencies waiting on the remove to complete
 	 * from the dirrem to the inode inowait list to be completed
-	 * after the inode has been updated and written to disk.  Any
-	 * marked MKDIR_PARENT are saved to be completed when the .. ref
-	 * is removed.
+	 * after the inode has been updated and written to disk.
+	 *
+	 * Any marked MKDIR_PARENT are saved to be completed when the 
+	 * dotdot ref is removed unless DIRCHG is specified.  For
+	 * directory change operations there will be no further
+	 * directory writes and the jsegdeps need to be moved along
+	 * with the rest to be completed when the inode is free or
+	 * stable in the inode free list.
 	 */
 	LIST_INIT(&dotdotwk);
 	while ((wk = LIST_FIRST(&dirrem->dm_jwork)) != NULL) {
 		WORKLIST_REMOVE(wk);
-		if (wk->wk_state & MKDIR_PARENT) {
+		if ((dirrem->dm_state & DIRCHG) == 0 &&
+		    wk->wk_state & MKDIR_PARENT) {
 			wk->wk_state &= ~MKDIR_PARENT;
 			WORKLIST_INSERT(&dotdotwk, wk);
 			continue;


More information about the svn-src-all mailing list