public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@logfs.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: "Jörn Engel" <joern@logfs.org>,
	"'Linux-MTD Mailing List'" <linux-mtd@lists.infradead.org>,
	"Joakim Tjernlund" <joakim.tjernlund@transmode.se>
Subject: Re: getdents64 problem in 2.6.23
Date: Sun, 28 Oct 2007 12:52:41 +0100	[thread overview]
Message-ID: <20071028115240.GA23227@lazybastard.org> (raw)
In-Reply-To: <1193536844.2915.36.camel@shinybook.infradead.org>

On Sat, 27 October 2007 22:00:44 -0400, David Woodhouse wrote:
> 
> Well, the f->dents list is _already_ ordered by the hash of the
> filename. The only reason we _don't_ use the hash as the i_pos 'cookie'
> is because of the potential for hash collisions.
> 
> If we could deal with that, we could use trees for it instead of a
> linked list.

I'd say just do it.  You are already breaking nfs as-is.  The i_pos
cookie is required to be stable across reboots.  And since you no longer
store deletion dirents on the medium, the only thing you can do is try
to use relatively robust non-standard(1) behaviour.

One way of doing that is to favor returning the same dentries twice over
not returning them at all (and try to make it a rare event, of course).
So you can just use the hash (32bit, due to nfs protocol limitations)
as a cookie and in case of hash collision, return all colliding
dentries.  Drawback: endless loop when getdents only has enough room for
a single dentry.

Second variant is Neil Browns approach of using a 24bit hash and an 8bit
sequence number.  In case of a hash collision, all colliding dentries
are kept in a list and the sequence number is used just a i_pos is used
currently for the collision chain.  Since all these structure are not
stable across reboot, you would probably want to reset the sequence
number to zero whenever seekdir is called.

(1) Non-standard behaviour is nothing unusual.  Afaiks even ext3 with
dirhash is non-standard.

Jörn

-- 
"Translations are and will always be problematic. They inflict violence
upon two languages." (translation from German)

  reply	other threads:[~2007-10-28 13:31 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-24 13:47 getdents64 problem in 2.6.23 Joakim Tjernlund
2007-10-25 21:36 ` Joakim Tjernlund
2007-10-26 19:13 ` David Woodhouse
2007-10-26 23:03   ` Joakim Tjernlund
2007-10-26 23:17     ` David Woodhouse
2007-10-27 11:02       ` Joakim Tjernlund
2007-10-27 12:44         ` David Woodhouse
2007-10-27 15:01           ` Joakim Tjernlund
2007-10-27 17:09             ` David Woodhouse
2007-10-27 17:20               ` Joakim Tjernlund
2007-10-27 20:31                 ` Joakim Tjernlund
2007-10-27 22:36                   ` David Woodhouse
2007-10-28  0:04                     ` Joakim Tjernlund
2007-10-27 23:18       ` Jörn Engel
2007-10-28  2:00         ` David Woodhouse
2007-10-28 11:52           ` Jörn Engel [this message]
2007-10-28 18:28         ` Jamie Lokier
2007-10-28 23:49           ` Jörn Engel
2007-10-28 23:58             ` Joakim Tjernlund
2007-10-29  0:26               ` David Woodhouse
2007-10-29 12:58                 ` Joakim Tjernlund
2007-10-29 17:30                   ` Joakim Tjernlund
2007-10-29 23:41                     ` Joakim Tjernlund
2007-10-30 17:42                       ` Joakim Tjernlund
2007-10-31  2:08                         ` David Woodhouse

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=20071028115240.GA23227@lazybastard.org \
    --to=joern@logfs.org \
    --cc=dwmw2@infradead.org \
    --cc=joakim.tjernlund@transmode.se \
    --cc=linux-mtd@lists.infradead.org \
    /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