* [PATCH] ext2/3 bugfix 2/6: readdir() needs to return '.' and '..'
@ 2002-11-07 3:58 tytso
0 siblings, 0 replies; only message in thread
From: tytso @ 2002-11-07 3:58 UTC (permalink / raw)
To: torvalds, linux-kernel
Add '.' and '..' entries to be returned by readdir of htree directories
This patch from Chris Li adds '.' and '..' to the rbtree so that they
are properly returned by readdir.
namei.c | 9 +++++++++
1 files changed, 9 insertions(+)
diff -Nru a/fs/ext3/namei.c b/fs/ext3/namei.c
--- a/fs/ext3/namei.c Wed Nov 6 17:29:46 2002
+++ b/fs/ext3/namei.c Wed Nov 6 17:29:46 2002
@@ -549,6 +549,15 @@
if (!frame)
return err;
+ /* Add '.' and '..' from the htree header */
+ if (!start_hash && !start_minor_hash) {
+ de = (struct ext3_dir_entry_2 *) frames[0].bh->b_data;
+ ext3_htree_store_dirent(dir_file, 0, 0, de);
+ de = ext3_next_entry(de);
+ ext3_htree_store_dirent(dir_file, 0, 0, de);
+ count += 2;
+ }
+
while (1) {
block = dx_get_block(frame->at);
dxtrace(printk("Reading block %d\n", block));
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-11-07 3:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-07 3:58 [PATCH] ext2/3 bugfix 2/6: readdir() needs to return '.' and '..' tytso
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.