From: Erez Zadok Date: Fri, 9 May 2014 18:54:11 +0000 (-0400) Subject: Unionfs: fix ->readdir X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=ea37a67f579776d0b11434776910c8b1b03df57f;p=unionfs-3.13.y.git Unionfs: fix ->readdir It's enough to use llseek to set lower dir pos. No need to also set lower_file->f_pos directly, as it breaks readdir for ext4 and other ext-based file systems. Reported by Vaibhav Nagarnaik and Ted Ts'o. Signed-off-by: Erez Zadok --- diff --git a/fs/unionfs/dirfops.c b/fs/unionfs/dirfops.c index d29b50d754a..bf609ce1f8e 100644 --- a/fs/unionfs/dirfops.c +++ b/fs/unionfs/dirfops.c @@ -156,9 +156,8 @@ static int unionfs_readdir(struct file *file, struct dir_context *ctx) goto out; } - lower_file->f_pos = ctx->pos; err = iterate_dir(lower_file, &buf.ctx); - ctx->pos = buf.ctx.pos; + ctx->pos = buf.ctx.pos; /* XXX: not sure if needed (cf. ecryptfs) */ /* Save the position for when we continue. */ offset = vfs_llseek(lower_file, 0, SEEK_CUR);