From: Al Viro Date: Wed, 22 May 2013 17:41:26 +0000 (-0400) Subject: befs_readdir(): do not increment ->f_pos if filldir tells us to stop X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=448293aadb54ab38b9c053bf9f1eecafdc0ed214;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git befs_readdir(): do not increment ->f_pos if filldir tells us to stop Signed-off-by: Al Viro --- diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index 8615ee89ab55..f95dddced968 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -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);