]> git.hungrycats.org Git - linux/commitdiff
[PATCH] readdir: return value missed in getdents64
authorPrasanna Meda <pmeda@akamai.com>
Sat, 8 Jan 2005 05:41:36 +0000 (21:41 -0800)
committerLinus Torvalds <torvalds@evo.osdl.org>
Sat, 8 Jan 2005 05:41:36 +0000 (21:41 -0800)
Small issue: return value missed in getdents64, but handled in getdents.

Signed-Off-by: Prasanna Meda <pmeda@akamai.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/readdir.c

index de97df7f5e6d8bcbaea4c3a09aa2a1655c0a0666..b95ded5814714dc8ff9bd850e34e965adf4d313d 100644 (file)
@@ -287,8 +287,9 @@ asmlinkage long sys_getdents64(unsigned int fd, struct linux_dirent64 __user * d
        lastdirent = buf.previous;
        if (lastdirent) {
                typeof(lastdirent->d_off) d_off = file->f_pos;
-               __put_user(d_off, &lastdirent->d_off);
                error = count - buf.count;
+               if (__put_user(d_off, &lastdirent->d_off))
+                       error = -EFAULT;
        }
 
 out_putf: