]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ocfs2: Fix a missing credit when deleting from indexed directories.
authorJoel Becker <joel.becker@oracle.com>
Thu, 30 Apr 2009 00:55:08 +0000 (17:55 -0700)
committerJoel Becker <joel.becker@oracle.com>
Thu, 30 Apr 2009 20:21:56 +0000 (13:21 -0700)
The ocfs2 directory index updates two blocks when we remove an entry -
the dx root and the dx leaf.  OCFS2_DELETE_INODE_CREDITS was only
accounting for the dx leaf.  This shows up when ocfs2_delete_inode()
runs out of credits in jbd2_journal_dirty_metadata() at
"J_ASSERT_JH(jh, handle->h_buffer_credits > 0);".

The test that caught this was running dirop_file_racer from the
ocfs2-test suite with a 250-character filename PREFIX.  Run on a 512B
blocksize, it forces the orphan dir index to grow large enough to
trigger.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
fs/ocfs2/journal.h

index 619dd7f6c053c1562863707bebc7c3c6e1753b52..eb7b76331eb7733f4d9f4a5494b3509054a886b1 100644 (file)
@@ -437,8 +437,9 @@ static inline int ocfs2_unlink_credits(struct super_block *sb)
 }
 
 /* dinode + orphan dir dinode + inode alloc dinode + orphan dir entry +
- * inode alloc group descriptor + orphan dir index leaf */
-#define OCFS2_DELETE_INODE_CREDITS (3 * OCFS2_INODE_UPDATE_CREDITS + 3)
+ * inode alloc group descriptor + orphan dir index root +
+ * orphan dir index leaf */
+#define OCFS2_DELETE_INODE_CREDITS (3 * OCFS2_INODE_UPDATE_CREDITS + 4)
 
 /* dinode update, old dir dinode update, new dir dinode update, old
  * dir dir entry, new dir dir entry, dir entry update for renaming