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>
This commit is contained in:
Al Viro 2011-03-04 01:43:36 -05:00 committed by Bob Copeland
parent d932805b3d
commit 31be83aeae

View File

@ -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, res = filldir(dirent, oi->i_name, strnlen(oi->i_name,
OMFS_NAMELEN), filp->f_pos, self, d_type); OMFS_NAMELEN), filp->f_pos, self, d_type);
if (res == 0)
filp->f_pos++;
brelse(bh); brelse(bh);
if (res < 0)
break;
filp->f_pos++;
} }
out: out:
return res; return res;