From 1707a04405c3bfd626ade68b636863003e5e37ea Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 19 Aug 2008 21:57:43 -0400 Subject: [PATCH] --- yaml --- r: 109059 b: refs/heads/master c: d015641734cde55d2fce48a6db3983c8a029fe05 h: refs/heads/master i: 109057: afacd22299ad19be919446d28ec0a57d1d0dddfc 109055: d9ee509183f6070b7f9d39b764c18684a3c160fb v: v3 --- [refs] | 2 +- trunk/fs/ext4/dir.c | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index f6b6afb681c9..42cc97f6c769 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cd21322616c3af265d39bf15321d436e667a5dd1 +refs/heads/master: d015641734cde55d2fce48a6db3983c8a029fe05 diff --git a/trunk/fs/ext4/dir.c b/trunk/fs/ext4/dir.c index d3d23d73c08b..ec8e33b45219 100644 --- a/trunk/fs/ext4/dir.c +++ b/trunk/fs/ext4/dir.c @@ -411,7 +411,7 @@ static int call_filldir(struct file * filp, void * dirent, get_dtype(sb, fname->file_type)); if (error) { filp->f_pos = curr_pos; - info->extra_fname = fname->next; + info->extra_fname = fname; return error; } fname = fname->next; @@ -450,11 +450,21 @@ static int ext4_dx_readdir(struct file * filp, * If there are any leftover names on the hash collision * chain, return them first. */ - if (info->extra_fname && - call_filldir(filp, dirent, filldir, info->extra_fname)) - goto finished; + if (info->extra_fname) { + if (call_filldir(filp, dirent, filldir, info->extra_fname)) + goto finished; - if (!info->curr_node) + info->extra_fname = NULL; + info->curr_node = rb_next(info->curr_node); + if (!info->curr_node) { + if (info->next_hash == ~0) { + filp->f_pos = EXT4_HTREE_EOF; + goto finished; + } + info->curr_hash = info->next_hash; + info->curr_minor_hash = 0; + } + } else if (!info->curr_node) info->curr_node = rb_first(&info->root); while (1) {