befs_readdir(): do not increment ->f_pos if filldir tells us to stop
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 22 May 2013 17:41:26 +0000 (13:41 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 31 May 2013 19:17:56 +0000 (15:17 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/befs/linuxvfs.c

index 8615ee89ab55d8c6d96a26556327b31c3967c0b6..f95dddced968f6f4509f1536b80462baa1c4393b 100644 (file)
@@ -265,8 +265,8 @@ befs_readdir(struct file *filp, void *dirent, filldir_t filldir)
                result = filldir(dirent, keybuf, keysize, filp->f_pos,
                                 (ino_t) value, d_type);
        }
-
-       filp->f_pos++;
+       if (!result)
+               filp->f_pos++;
 
        befs_debug(sb, "<--- befs_readdir() filp->f_pos %Ld", filp->f_pos);