From: Andreas Dilger <adilger@turbolinux.com>
To: Daniel Phillips <phillips@bonn-fries.net>
Cc: Andreas Dilger <adilger@turbolinux.com>,
linux-kernel@vger.kernel.org, ext2-devel@lists.sourceforge.net,
Alexander Viro <viro@math.psu.edu>
Subject: Re: [Ext2-devel] [UPDATE] Directory index for ext2
Date: Thu, 31 May 2001 16:42:02 -0600 (MDT) [thread overview]
Message-ID: <200105312242.f4VMg2S3017158@webber.adilger.int> (raw)
In-Reply-To: <0105312302061N.06233@starship> "from Daniel Phillips at May 31, 2001 11:02:06 pm"
Daniel writes:
> On Thursday 31 May 2001 21:44, Andreas Dilger wrote:
> > I think Al's idea of doing the validation once on the initial
> > read is a good one.
>
> I'm doing that in the current patch, for leaf blocks, look at
> ext2_bread. For index blocks, ext2_bread needs help to know that a
> block is supposed to be an index block. Add a parameter?
I think we should just get rid of the misconception that ext2_bread()
is a block read function. It is only used by directory functions.
Instead we should have separate ext2_bread_leaf(), ext2_bread_root(),
ext2_bread_node() which do the appropriate validation for each type
of block.
In ext2_bread_dir() if we really think directory block prealloc is a win
(in addition to the existing in-memory contiguous block prealloc), we
may as well do it each time we split a leaf block, and make them valid
in-use leaf blocks instead of just wasting space on disk (i.e. each split
block has the hash space split into 1/N of the existing space, and we
distribute existing entries across all N blocks).
This way we don't have to split the each directory block so many times.
For indexed directories this is (probably) a net win because we avoid
N extra block splits (i.e. extra copying of leaf blocks), and make the
leaf search space smaller. On non-indexed ext2 it would be a net loss
because we would still have to read and search each directory block,
even if they are empty.
> It's normal for it to start by putting all the entries into the first
> two blocks, but after those are split it should be pretty uniform
> across the resulting 4, and so on. Can you confirm it's unbalanced?
I don't think that is what I was seeing, because the hash block numbers
were not "->1" and "->2" (which would be the case right after a split),
but rather 30's, 40's, etc.
> > Running mongo has shown up another bug, I see, but haven't had a
> > chance to look into yet. It involves not being able to delete files
> > from an indexed directory:
> >
> > rm: cannot remove `/mnt/tmp/testdir1-0-0/d0/d1/d2/d3/509.r':
> > Input/output error
> >
> > This is after the files had been renamed (.r suffix). Do we re-hash
> > directory entries if the file is renamed? If not, then that would
> > explain this problem. It _looks_ like we do the right thing, but the
> > mongo testing wipes out the filesystem after each test, and the above
> > message is from a logfile only.
>
> The rename creates the new entry via ext2_add_entry so the hash must be
> correct. Time to get out the bug swatter. I'll get mongo and try it.
One other point of information. In the test I was running, it was
always the file "509.r" which had the I/O error (new filesystem each
test run, btw, and no IDE errors in the log).
Cheers, Andreas
--
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert
next prev parent reply other threads:[~2001-05-31 22:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-31 16:13 Daniel Phillips
2001-05-31 19:44 ` [Ext2-devel] " Andreas Dilger
2001-05-31 21:02 ` Daniel Phillips
2001-05-31 22:42 ` Andreas Dilger [this message]
2001-06-03 0:19 ` Daniel Phillips
2001-06-20 14:59 ` Tony Gale
2001-06-20 16:02 ` [Ext2-devel] " Theodore Tso
2001-06-20 17:27 ` Daniel Phillips
2001-06-20 16:58 ` Daniel Phillips
2001-06-25 9:46 ` Tony Gale
2001-06-25 16:10 ` Daniel Phillips
2001-06-25 19:51 ` [Ext2-devel] " Andreas Dilger
2001-06-25 22:25 ` Daniel Phillips
2001-06-26 23:49 ` Theodore Tso
2001-06-27 0:08 ` [RFC] Checks in ext2_new_block() Alexander Viro
2001-07-03 10:00 ` [Ext2-devel] Re: [UPDATE] Directory index for ext2 Tony Gale
2001-06-26 9:27 ` Tony Gale
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=200105312242.f4VMg2S3017158@webber.adilger.int \
--to=adilger@turbolinux.com \
--cc=ext2-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=phillips@bonn-fries.net \
--cc=viro@math.psu.edu \
/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
all inboxes | Powered by JetHome®