Author: mckusick
Date: Thu Jan 23 06:24:11 2020
New Revision: 357034
URL: https://svnweb.freebsd.org/changeset/base/357034

Log:
  MFC of 356714
  
  Fix DIRCHG panic

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

Modified: stable/11/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- stable/11/sys/ufs/ffs/ffs_softdep.c Thu Jan 23 06:20:57 2020        
(r357033)
+++ stable/11/sys/ufs/ffs/ffs_softdep.c Thu Jan 23 06:24:11 2020        
(r357034)
@@ -9776,14 +9776,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;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to