All of lore.kernel.org
 help / color / mirror / Atom feed
From: Edgar Toernig <froese@gmx.de>
To: Pavel Roskin <proski@gnu.org>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: readdir() loses entries on ramfs and tmpfs
Date: Thu, 27 Dec 2001 02:52:42 +0100	[thread overview]
Message-ID: <3C2A7EEA.44EAE386@gmx.de> (raw)
In-Reply-To: <Pine.LNX.4.43.0112261932350.26802-100000@marabou.research.att.com>

Pavel Roskin wrote:
> 
>     while ((d = readdir(dir)) != NULL) {
>         printf("%s\n", d->d_name);
>         rmdir(d->d_name);
>     }
>[...]
> Basically, removing a subdirectory in a directory open with opendir()
> causes an entry (file or directory) 168 entries later to be skipped by
> readdir().
> 
> I'm sorry, I cannot elaborate more, but the issue seems to be very
> serious.

Not nice but not serious.  Modifying the directory you scan is
never save and programs relying on this are broken.  You can
build a list of items to work on but even then another process
may add new entries or remove some and you have to handle that.
One could "fix" your "bug" but the program will still be broken.

Ciao, ET.

  reply	other threads:[~2001-12-27  1:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-27  0:50 readdir() loses entries on ramfs and tmpfs Pavel Roskin
2001-12-27  1:52 ` Edgar Toernig [this message]
2001-12-27  3:08 ` Legacy Fishtank

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=3C2A7EEA.44EAE386@gmx.de \
    --to=froese@gmx.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=proski@gnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.