From 31be83aeaee22fa165862ad449c7131ceaf1cf91 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 4 Mar 2011 01:43:36 -0500 Subject: 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 Signed-off-by: Bob Copeland --- fs/omfs/dir.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fs/omfs') diff --git a/fs/omfs/dir.c b/fs/omfs/dir.c index fd91f629ceb..de4ff29f1e0 100644 --- a/fs/omfs/dir.c +++ b/fs/omfs/dir.c @@ -361,9 +361,10 @@ static int omfs_fill_chain(struct file *filp, void *dirent, filldir_t filldir, res = filldir(dirent, oi->i_name, strnlen(oi->i_name, OMFS_NAMELEN), filp->f_pos, self, d_type); - if (res == 0) - filp->f_pos++; brelse(bh); + if (res < 0) + break; + filp->f_pos++; } out: return res; -- cgit v1.2.3