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>
diff --git a/fs/omfs/dir.c b/fs/omfs/dir.c
index fd91f62..de4ff29 100644
--- a/fs/omfs/dir.c
+++ b/fs/omfs/dir.c
@@ -361,9 +361,10 @@
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;