lkml.org 
[lkml]   [2008]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [RFC] readdir mess


On Sun, 24 Aug 2008, Al Viro wrote:
>
> The fact that coda_readdir() will _not_ be returning 0 with your change
> when called with the arguments old_readdir() gives it? You'll get ret
> from filldir, i.e. what you'll normally see will be -EINVAL in case of
> fillonedir as callback.

Ahh. A light finally goes on. No on the first filldir() callback, but on
the second.

Yeah, so this should fix it.

Linus
---
fs/readdir.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/readdir.c b/fs/readdir.c
index 4e026e5..4899ba4 100644
--- a/fs/readdir.c
+++ b/fs/readdir.c
@@ -115,7 +115,7 @@ asmlinkage long old_readdir(unsigned int fd, struct old_linux_dirent __user * di
buf.dirent = dirent;

error = vfs_readdir(file, fillonedir, &buf);
- if (error >= 0)
+ if (buf.result || error >= 0)
error = buf.result;

fput(file);

\
 
 \ /
  Last update: 2008-08-25 01:55    [W:0.068 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site