lkml.org 
[lkml]   [2002]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Orlov allocator directory accounting bug
Hi,

In looking at the fix for the ext3 Orlov double-accounting bug, I
noticed a change to the sb->s_dir_count accounting, restoring a
missing s_dir_count++ when we allocate a new directory.

However, I can't find anywhere in the code where we decrement this
again on directory deletion, neither in ext2 nor in ext3, in 2.4 nor
in 2.5.

Patch below is against Ted's 2.4 Orlov-for-ext3 backport, but it looks
like we need something similar in both ext2 and ext3 in 2.5, too.

--Stephen
--- linux-2.4-ext3merge/fs/ext3/ialloc.c.=K0023=.orig Fri Nov 15 11:02:23 2002
+++ linux-2.4-ext3merge/fs/ext3/ialloc.c Fri Nov 15 11:02:23 2002
@@ -263,9 +263,11 @@
if (gdp) {
gdp->bg_free_inodes_count = cpu_to_le16(
le16_to_cpu(gdp->bg_free_inodes_count) + 1);
- if (is_directory)
+ if (is_directory) {
gdp->bg_used_dirs_count = cpu_to_le16(
le16_to_cpu(gdp->bg_used_dirs_count) - 1);
+ EXT3_SB(sb)->s_dir_count--;
+ }
}
BUFFER_TRACE(bh2, "call ext3_journal_dirty_metadata");
err = ext3_journal_dirty_metadata(handle, bh2);
\
 
 \ /
  Last update: 2005-03-22 13:31    [W:0.019 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site