linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@sun.com>
To: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
Cc: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>, linux-ext4@vger.kernel.org
Subject: Re: Problems with the max value for create directory
Date: Tue, 23 Dec 2008 00:49:44 -0700	[thread overview]
Message-ID: <20081223074944.GH5000@webber.adilger.int> (raw)
In-Reply-To: <495062D1.6010805@jp.fujitsu.com>

On Dec 23, 2008  13:02 +0900, Toshiyuki Okajima wrote:
> Zhang Xiliang wrote:
>> Hi,
>>
>> I creat 65537 long directories and failed when the block size is 1024.
>>
>> # mkfs.ext4dev -b 1024 -I 256 /dev/hda3
>> # tune2fs -E test_fs -O extents /dev/hda3
>> # mount -t ext4dev /dev/hda3 /mnt
>> # ./create_long_dirs 65537 /mnt
>>
>> The code of create_long_dirs.c:
>
> ext4 filesystem cannot make over 65000 links toward a file.
> (ext3 filesystem cannot make over 32000 links toward a file.)
> This test makes over 65000 links toward /mnt-directory.
> (Creating 65000 sub-directories makes 65000 links toward /mnt-directory.)

Note that there is a specific reason why it was implemented this way:
- a directory with > 65000 subdirectories can be checked if empty even
  if the link count is wrong (in fact link count was ignored even in ext3)
- a file needs to keep accurate link counts or it is impossible to know
  when the file needs to be deleted.

We thought about adding a "i_links_count_hi" but it wasn't thought that
many (any) real applications would create so many hard links on the same
file.


Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.


  reply	other threads:[~2008-12-23  7:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-23  3:02 Problems with the max value for create directory Zhang Xiliang
2008-12-23  4:02 ` Toshiyuki Okajima
2008-12-23  7:49   ` Andreas Dilger [this message]
2008-12-23 20:12   ` Theodore Tso
2008-12-24  1:18     ` Zhang Xiliang
2008-12-24 23:54       ` Theodore Tso
2008-12-29 13:47       ` Peng tao
2009-01-06  3:16         ` Andreas Dilger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081223074944.GH5000@webber.adilger.int \
    --to=adilger@sun.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=toshi.okajima@jp.fujitsu.com \
    --cc=zhangxiliang@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).