public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Alexander Viro <viro@math.psu.edu>
Cc: Christoph Rohland <cr@sap.com>, Larry McVoy <lm@bitmover.com>,
	Jan-Frode Myklebust <janfrode@parallab.uib.no>,
	ML-linux-kernel <linux-kernel@vger.kernel.org>,
	Wayne Scott <wscott@bitmover.com>
Subject: Re: Kernel Compile in tmpfs crumples in 2.4.12 w/epoll patch
Date: Tue, 30 Oct 2001 12:29:08 -0500	[thread overview]
Message-ID: <20011030122908.A734@thunk.org> (raw)
In-Reply-To: <m3pu7gggbf.fsf@linux.local> <Pine.GSO.4.21.0110220556150.2294-100000@weyl.math.psu.edu>
In-Reply-To: <Pine.GSO.4.21.0110220556150.2294-100000@weyl.math.psu.edu>; from viro@math.psu.edu on Mon, Oct 22, 2001 at 06:01:32AM -0400

On Mon, Oct 22, 2001 at 06:01:32AM -0400, Alexander Viro wrote:
> 
> If you are changing directory between the calls of getdents(2) - you have
> no warranty that offsets will stay stable.  It's not just Linux.
> 

Umm... it's not Linux, but it is POSIX.  POSIX states that if a file
is removed or created in a directory in the middle of a readir() scan,
that it's undefined whether or not that file which has been removed or
created will be returned by readdir().  But you're not allowed to
randomly shuffle things around and make files disappear or be returned
multiple times.  Otherwise, it becomes impossible for readdir() to be
used reliably --- after all, even if an individual process isn't
deleting or creating files while doing a readdir(), it can't protect
itself from other processes happening to create or delete files while
it's doing an readdir() scan.

> Frankly, I don't see what could be done, short of doing qsort() by inumber
> or something equivalent...

Yup, that's what you'd have to do.  Readdir() semantics are a bitch,
and a pain in the *ss for filesystems that are doing something other
than a FFS-style linear directory.  Telldir()/seedir() semantics makes
things even worse....

							- Ted

      parent reply	other threads:[~2001-10-31  5:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-19  0:06 Kernel Compile in tmpfs crumples in 2.4.12 w/epoll patch David E. Weekly
2001-10-19  0:22 ` Davide Libenzi
2001-10-19  1:26   ` safemode
2001-10-19  5:12     ` Daniel T. Chen
2001-10-19  8:28 ` Christoph Rohland
2001-10-20 15:17   ` Jan-Frode Myklebust
2001-10-21  8:25     ` Christoph Rohland
2001-10-21 10:07       ` Jan-Frode Myklebust
2001-10-20 22:35         ` wild pointer!!!!! Kalyan
2001-10-21 12:21           ` Paul Mackerras
2001-10-21 12:15         ` Kernel Compile in tmpfs crumples in 2.4.12 w/epoll patch safemode
     [not found]         ` <E15vHVx-0001Nc-00@ii.uib.no>
2001-10-21 12:34           ` Jan-Frode Myklebust
2001-10-21 12:53             ` safemode
     [not found]             ` <E15vI6n-0001oC-00@ii.uib.no>
2001-10-21 13:10               ` bk regression fails on tmpfs /tmp, was: " Jan-Frode Myklebust
2001-10-21 13:36                 ` safemode
2001-10-21 16:35       ` Larry McVoy
2001-10-21 17:50         ` Linus Torvalds
2001-10-21 20:15           ` Daniel Phillips
2001-10-22 17:03           ` bill davidsen
2001-10-22 17:12             ` Larry McVoy
2001-10-22 17:29               ` Alexander Viro
2001-10-23  5:25               ` Keith Owens
2001-10-22  9:44         ` Christoph Rohland
2001-10-22 10:01           ` Alexander Viro
2001-10-22 13:29             ` Wayne Scott
2001-10-22 17:31               ` bill davidsen
2001-10-30 17:29             ` Theodore Tso [this message]

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=20011030122908.A734@thunk.org \
    --to=tytso@mit.edu \
    --cc=cr@sap.com \
    --cc=janfrode@parallab.uib.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm@bitmover.com \
    --cc=viro@math.psu.edu \
    --cc=wscott@bitmover.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