public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: "Jörn Engel" <joern@logfs.org>
Cc: 'Linux-MTD Mailing List' <linux-mtd@lists.infradead.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Joakim Tjernlund <joakim.tjernlund@transmode.se>
Subject: Re: getdents64 problem in 2.6.23
Date: Sun, 28 Oct 2007 18:28:36 +0000	[thread overview]
Message-ID: <20071028182836.GE14076@mail.shareable.org> (raw)
In-Reply-To: <20071027231812.GA21216@lazybastard.org>

Jörn Engel wrote:
> > We probably need to implement a release() operation in the
> > jffs2_dir_operations (top of dir.c), which will remove the fake
> > 'deletion' dirents if !atomic_read(&inode->i_count). Or something like
> > that.
> 
> I hate to spoil the fun, but this can cause problems with nfs.
> 
> It is legal for nfs to call telldir, close the directory, wait for half
> a year, then open the directory, call seekdir and expect sane results.
> Not pretty at all for filesystem implementors.
> 
> So either these deletion dirents need to stay around or you have to
> convert the i_pos "cookie" to a hash of the filename or so or at least
> explicitly document that you have broken nfs under some circumstances.
> 
> Of course any other program could do the telldir/seekdir stunt as well.
> Nfs just appears to be the only one doing this madness in practice.

Indeed.

However, I think it's fine to _overwrite_ the deletion dirents with
new ones.  getdentds() allows new names created during a directory
read to appear or not in the lsit.

Also, I think it's fine to _coalesce_ deletion dirents into one, as
long as the number of entries they represent is retained as a count.

If to, the number of deletion dirent structures could be bounded to be
no more than the number of active dirents.

In which case, perhaps the storage on flash needed for them could
simply be (at most) one integer per active dirent?  If that's
possible, it would provide the correct semantics for telldir/readdir
even across unmounts/reboots, without using much storage even in
pathological cases.

-- Jamie

  parent reply	other threads:[~2007-10-28 21:27 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
2007-10-28 18:28         ` Jamie Lokier [this message]
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=20071028182836.GE14076@mail.shareable.org \
    --to=jamie@shareable.org \
    --cc=dwmw2@infradead.org \
    --cc=joakim.tjernlund@transmode.se \
    --cc=joern@logfs.org \
    --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