diff options
-rw-r--r-- | fs/reiserfs/dir.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c index 6c2d136561cb..2b96b59f75da 100644 --- a/fs/reiserfs/dir.c +++ b/fs/reiserfs/dir.c | |||
@@ -128,6 +128,7 @@ int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent, | |||
128 | char *d_name; | 128 | char *d_name; |
129 | off_t d_off; | 129 | off_t d_off; |
130 | ino_t d_ino; | 130 | ino_t d_ino; |
131 | loff_t cur_pos = deh_offset(deh); | ||
131 | 132 | ||
132 | if (!de_visible(deh)) | 133 | if (!de_visible(deh)) |
133 | /* it is hidden entry */ | 134 | /* it is hidden entry */ |
@@ -200,8 +201,9 @@ int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent, | |||
200 | if (local_buf != small_buf) { | 201 | if (local_buf != small_buf) { |
201 | kfree(local_buf); | 202 | kfree(local_buf); |
202 | } | 203 | } |
203 | // next entry should be looked for with such offset | 204 | |
204 | next_pos = deh_offset(deh) + 1; | 205 | /* deh_offset(deh) may be invalid now. */ |
206 | next_pos = cur_pos + 1; | ||
205 | 207 | ||
206 | if (item_moved(&tmp_ih, &path_to_entry)) { | 208 | if (item_moved(&tmp_ih, &path_to_entry)) { |
207 | set_cpu_key_k_offset(&pos_key, | 209 | set_cpu_key_k_offset(&pos_key, |