public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* ext3_dx_add_entry: Directory index full!
@ 2008-05-18 15:36 Bernie Innocenti
  2008-05-18 15:38 ` Bernie Innocenti
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Bernie Innocenti @ 2008-05-18 15:36 UTC (permalink / raw)
  To: lkml; +Cc: David Woodhouse, ext3-users, ext2-devel, Stefano Fedrigo

On 2.6.24.4-64.fc8, I createed and mounted a filesystem like this:

  mke2fs -m0 -b 1024 -R stride=64 -I 128 -i 2048 -j  -L mail -O dir_index,sparse_super -v /dev/sdc1
  mount -t ext3 -o noatime,data=writeback,nosuid,usrquota /dev/sdc1 /mail

Then I copied a directory with 200K small files into it:

  cp -a home/simone/Maildir/YouHaveJunkSir /mail/
  [...]
  cp: cannot create regular file `/mnt/YouHaveJunkSir/1174170042.20731_2.trinity.develer.com:2,b': No space left on device
  cp: cannot create regular file `/mnt/YouHaveJunkSir/1186341042.8337_2.trinity.develer.com:2,': No space left on device
  cp: cannot create regular file `/mnt/YouHaveJunkSir/1209101786.3888_2.trinity.develer.com:2,': No space left on device

The kernel logs are also scary:

  EXT3-fs warning (device sdc1): ext3_dx_add_entry: Directory index full!
  EXT3-fs warning (device sdc1): ext3_dx_add_entry: Directory index full!
  [...]

The failing check looks like this:

        if (levels && (dx_get_count(frames->entries) ==
                   dx_get_limit(frames->entries))) {
            ext3_warning(sb, __FUNCTION__,
                     "Directory index full!");
            err = -ENOSPC;
            goto cleanup;
        }

The limit is set in make_indexed_dir():

  dx_set_limit (entries, dx_root_limit(dir, sizeof(root->info)));

with this helper function:

  static inline unsigned dx_root_limit (struct inode *dir, unsigned infosize)
  {
      unsigned entry_space = dir->i_sb->s_blocksize - EXT3_DIR_REC_LEN(1) -
          EXT3_DIR_REC_LEN(2) - infosize;
      return 0? 20: entry_space / sizeof(struct dx_entry);
  }

Am I reading the above code correctly?  Why does it always return
20 no matter what?


Some background: I'm moving users' Maildirs to a separate filesystem tuned
for small files to increase performance.  One of our users intentionally
collected spam for 5 years in one folder and likes it this way.
We could easily work it around, but first I'd like to understand whether
the particular parameters we used trigger a bug in ext3 or if we're just
hitting a (possibly undocumented) limit.

-- 
   \___/
  _| X |  Bernie Innocenti - http://www.codewiz.org/
  \|_O_|  "It's an education project, not a laptop project!"

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-05-19  0:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-18 15:36 ext3_dx_add_entry: Directory index full! Bernie Innocenti
2008-05-18 15:38 ` Bernie Innocenti
2008-05-18 18:32   ` Jan Engelhardt
2008-05-18 21:04   ` Theodore Tso
2008-05-19  0:58     ` Bernie Innocenti
2008-05-18 15:39 ` David Woodhouse
2008-05-18 15:44   ` Bernie Innocenti
2008-05-18 16:24 ` Theodore Tso
2008-05-18 23:01   ` Stefano Fedrigo
2008-05-19  0:49     ` Theodore Tso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox