Skip to content

Commit 31be83a

Browse files
Al Virobcopeland
authored andcommitted
omfs: make readdir stop when filldir says so
filldir returning an error does *not* mean "skip this entry, try the next one"... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Bob Copeland <me@bobcopeland.com>
1 parent d932805 commit 31be83a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎fs/omfs/dir.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,10 @@ static int omfs_fill_chain(struct file *filp, void *dirent, filldir_t filldir,
361361

362362
res = filldir(dirent, oi->i_name, strnlen(oi->i_name,
363363
OMFS_NAMELEN), filp->f_pos, self, d_type);
364-
if (res == 0)
365-
filp->f_pos++;
366364
brelse(bh);
365+
if (res < 0)
366+
break;
367+
filp->f_pos++;
367368
}
368369
out:
369370
return res;

0 commit comments

Comments
 (0)