Whamcloud - gitweb
I believe that this will fix the remaining threaded unlink issues, although
authoradilger <adilger>
Thu, 20 Mar 2003 11:02:16 +0000 (11:02 +0000)
committeradilger <adilger>
Thu, 20 Mar 2003 11:02:16 +0000 (11:02 +0000)
I wasn't able to get a chance to test it...

Basically, uncomment extN-delete_thread.diff in extN/Makefile.am and give
it a whirl under dbench and/or runtests or whatever, and if it passes we
are golden.

lustre/extN/extN-delete_thread.diff

index acb25e4..6e278c8 100644 (file)
@@ -36,7 +36,7 @@
  #endif        /* _LINUX_EXTN_FS_SB */
 --- linux/fs/extN/super.c.orig Wed Mar 12 14:05:30 2003
 +++ linux/fs/extN/super.c      Thu Mar 13 19:05:26 2003
-@@ -396,6 +396,200 @@
+@@ -396,6 +396,207 @@
        }
  }
  
@@ -98,7 +98,7 @@
 +
 +                      list_del_init(&inode->i_dentry);
 +                      spin_unlock(&sbi->s_delete_lock);
-+                      extN_debug("%s deleting inode %lu, %lu blocks\n",
++                      printk(KERN_DEBUG "%s delete ino %lu blk %lu\n",
 +                                 tsk->comm, inode->i_ino, blocks);
 +
 +                      iput(inode);
 +      }
 +      J_ASSERT(new_inode != old_inode);
 +
-+      list_del(&EXTN_I(old_inode)->i_orphan);
-+      list_add(&EXTN_I(new_inode)->i_orphan, &sbi->s_orphan);
++      J_ASSERT(!list_empty(&EXTN_I(old_inode)->i_orphan));
++      /* Ugh.  We need to insert new_inode into the same spot on the list
++       * as old_inode was, to ensure the in-memory orphan list is still
++       * the same as the on-disk orphan list.
++       */
++      EXTN_I(new_inode)->i_orphan = EXTN_I(old_inode)->i_orphan;
++      EXTN_I(new_inode)->i_orphan.next->prev = &EXTN_I(new_inode)->i_orphan;
++      EXTN_I(new_inode)->i_orphan.prev->next = &EXTN_I(new_inode)->i_orphan;
 +      EXTN_I(new_inode)->i_state |= EXTN_STATE_DELETE;
 +      up(&sbi->s_orphan_lock);
 +
 +      printk(KERN_DEBUG "delete inode %lu (%lu blocks) by thread\n",
 +             new_inode->i_ino, blocks);
 +      spin_lock(&sbi->s_delete_lock);
++      J_ASSERT(list_empty(&new_inode->i_dentry));
 +      list_add_tail(&new_inode->i_dentry, &sbi->s_delete_list);
 +      sbi->s_delete_blocks += blocks;
 +      sbi->s_delete_inodes++;