mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 00:51:35 +00:00
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: Fix duplicate entries returned from getdents() system call ext3: Fix duplicate entries returned from getdents() system call
This commit is contained in:
commit
23cf24c0c8
2 changed files with 16 additions and 24 deletions
|
@ -456,17 +456,8 @@ static int ext3_dx_readdir(struct file * filp,
|
||||||
if (info->extra_fname) {
|
if (info->extra_fname) {
|
||||||
if (call_filldir(filp, dirent, filldir, info->extra_fname))
|
if (call_filldir(filp, dirent, filldir, info->extra_fname))
|
||||||
goto finished;
|
goto finished;
|
||||||
|
|
||||||
info->extra_fname = NULL;
|
info->extra_fname = NULL;
|
||||||
info->curr_node = rb_next(info->curr_node);
|
goto next_node;
|
||||||
if (!info->curr_node) {
|
|
||||||
if (info->next_hash == ~0) {
|
|
||||||
filp->f_pos = EXT3_HTREE_EOF;
|
|
||||||
goto finished;
|
|
||||||
}
|
|
||||||
info->curr_hash = info->next_hash;
|
|
||||||
info->curr_minor_hash = 0;
|
|
||||||
}
|
|
||||||
} else if (!info->curr_node)
|
} else if (!info->curr_node)
|
||||||
info->curr_node = rb_first(&info->root);
|
info->curr_node = rb_first(&info->root);
|
||||||
|
|
||||||
|
@ -498,9 +489,14 @@ static int ext3_dx_readdir(struct file * filp,
|
||||||
info->curr_minor_hash = fname->minor_hash;
|
info->curr_minor_hash = fname->minor_hash;
|
||||||
if (call_filldir(filp, dirent, filldir, fname))
|
if (call_filldir(filp, dirent, filldir, fname))
|
||||||
break;
|
break;
|
||||||
|
next_node:
|
||||||
info->curr_node = rb_next(info->curr_node);
|
info->curr_node = rb_next(info->curr_node);
|
||||||
if (!info->curr_node) {
|
if (info->curr_node) {
|
||||||
|
fname = rb_entry(info->curr_node, struct fname,
|
||||||
|
rb_hash);
|
||||||
|
info->curr_hash = fname->hash;
|
||||||
|
info->curr_minor_hash = fname->minor_hash;
|
||||||
|
} else {
|
||||||
if (info->next_hash == ~0) {
|
if (info->next_hash == ~0) {
|
||||||
filp->f_pos = EXT3_HTREE_EOF;
|
filp->f_pos = EXT3_HTREE_EOF;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -459,17 +459,8 @@ static int ext4_dx_readdir(struct file *filp,
|
||||||
if (info->extra_fname) {
|
if (info->extra_fname) {
|
||||||
if (call_filldir(filp, dirent, filldir, info->extra_fname))
|
if (call_filldir(filp, dirent, filldir, info->extra_fname))
|
||||||
goto finished;
|
goto finished;
|
||||||
|
|
||||||
info->extra_fname = NULL;
|
info->extra_fname = NULL;
|
||||||
info->curr_node = rb_next(info->curr_node);
|
goto next_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)
|
} else if (!info->curr_node)
|
||||||
info->curr_node = rb_first(&info->root);
|
info->curr_node = rb_first(&info->root);
|
||||||
|
|
||||||
|
@ -501,9 +492,14 @@ static int ext4_dx_readdir(struct file *filp,
|
||||||
info->curr_minor_hash = fname->minor_hash;
|
info->curr_minor_hash = fname->minor_hash;
|
||||||
if (call_filldir(filp, dirent, filldir, fname))
|
if (call_filldir(filp, dirent, filldir, fname))
|
||||||
break;
|
break;
|
||||||
|
next_node:
|
||||||
info->curr_node = rb_next(info->curr_node);
|
info->curr_node = rb_next(info->curr_node);
|
||||||
if (!info->curr_node) {
|
if (info->curr_node) {
|
||||||
|
fname = rb_entry(info->curr_node, struct fname,
|
||||||
|
rb_hash);
|
||||||
|
info->curr_hash = fname->hash;
|
||||||
|
info->curr_minor_hash = fname->minor_hash;
|
||||||
|
} else {
|
||||||
if (info->next_hash == ~0) {
|
if (info->next_hash == ~0) {
|
||||||
filp->f_pos = EXT4_HTREE_EOF;
|
filp->f_pos = EXT4_HTREE_EOF;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue