From: tridge@samba.org
To: Anton Altaparmakov <aia21@cam.ac.uk>
Cc: Akshat Aranya <aaranya@cs.sunysb.edu>, linux-fsdevel@vger.kernel.org
Subject: Re: Expected getdents behaviour
Date: Fri, 16 Sep 2005 11:28:43 +1000 [thread overview]
Message-ID: <17194.8139.88980.19088@samba.org> (raw)
In-Reply-To: <1126793268.1676.9.camel@imp.csi.cam.ac.uk>
At the risk of thowing a spanner in the works, Samba relies pretty
heavily on seekdir()/telldir()/unlink() interacting in "nice"
ways.
The most problematic case is OS/2 clients, which use a bizarre pattern
for removing all files in a directory. I've coded up the equivalent
set of posix directory operations for a OS/2 client deleting a
directory in:
http://samba.org/ftp/unpacked/junkcode/os2_delete.c
what they do is:
1) open directory
2) read 100 entries, asking for the 'telldir' location of each
3) delete the first 4 of those entries
4) seekdir to the offset returned by the 4th entry (now deleted)
5) read another 100 entries
6) go to step 3
this continues until the read of the directory returns no entries. At
this point the client assumes the directory is empty.
This works fine on Linux. On FreeBSD systems the way libc telldir()
works means that the above pattern uses a huge amount of memory, and
ends up not deleting all entries in the directory, so we ended up
replacing telldir() on FreeBSD inside Samba4. See:
http://samba.org/ftp/unpacked/samba4/source/lib/replace/repdir/
So if this discussion leads to any changes in getdents(), please don't
use the FreeBSD method (it allocates a linked list of all telldir()
results, and doesn't correctly cope with deletions during a directory
scan).
Cheers, Tridge
prev parent reply other threads:[~2005-09-16 1:28 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-15 13:57 Expected getdents behaviour Akshat Aranya
2005-09-15 14:03 ` Peter Staubach
2005-09-15 14:07 ` Anton Altaparmakov
2005-09-15 14:12 ` Anton Altaparmakov
2005-09-15 14:45 ` Miklos Szeredi
2005-09-15 15:17 ` Anton Altaparmakov
2005-09-15 16:41 ` Jan Blunck
2005-09-15 17:46 ` Jörn Engel
2005-09-15 18:19 ` Theodore Ts'o
2005-09-15 21:04 ` Anton Altaparmakov
2005-09-16 7:50 ` Nikita Danilov
2005-09-15 21:47 ` Jörn Engel
2005-09-16 7:29 ` Nikita Danilov
2005-09-16 11:58 ` Theodore Ts'o
2005-09-15 21:00 ` Anton Altaparmakov
2005-09-15 21:15 ` Charles P. Wright
2005-09-15 21:19 ` Anton Altaparmakov
2005-09-15 20:28 ` Anton Altaparmakov
2005-09-15 16:51 ` Miklos Szeredi
2005-09-15 21:17 ` Anton Altaparmakov
2005-09-15 15:51 ` Theodore Ts'o
2005-09-15 16:52 ` Bryan Henderson
2005-09-15 16:57 ` Jeremy Allison
2005-09-15 20:51 ` Anton Altaparmakov
2005-09-15 20:50 ` Anton Altaparmakov
2005-09-15 23:41 ` Bryan Henderson
2005-09-15 20:25 ` Anton Altaparmakov
2005-09-16 3:39 ` Theodore Ts'o
2005-09-16 11:57 ` Dave Kleikamp
2005-09-15 18:08 ` Nikita Danilov
2005-09-16 11:23 ` Miklos Szeredi
2005-09-16 1:28 ` tridge [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=17194.8139.88980.19088@samba.org \
--to=tridge@samba.org \
--cc=aaranya@cs.sunysb.edu \
--cc=aia21@cam.ac.uk \
--cc=linux-fsdevel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).