From: Amir Goldstein Date: Wed, 29 Nov 2017 05:35:21 +0000 (+0200) Subject: ovl: update ctx->pos on impure dir iteration X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cb6ee0f3c19980328529d5ed7a1650e41164ca49;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ovl: update ctx->pos on impure dir iteration commit b02a16e6413a2f782e542ef60bad9ff6bf212f8a upstream. This fixes a regression with readdir of impure dir in overlayfs that is shared to VM via 9p fs. Reported-by: Miguel Bernal Marin Fixes: 4edb83bb1041 ("ovl: constant d_ino for non-merge dirs") Signed-off-by: Amir Goldstein Tested-by: Miguel Bernal Marin Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c index 698b74dd750e..b2c7f33e08fc 100644 --- a/fs/overlayfs/readdir.c +++ b/fs/overlayfs/readdir.c @@ -645,7 +645,10 @@ static int ovl_iterate_real(struct file *file, struct dir_context *ctx) return PTR_ERR(rdt.cache); } - return iterate_dir(od->realfile, &rdt.ctx); + err = iterate_dir(od->realfile, &rdt.ctx); + ctx->pos = rdt.ctx.pos; + + return err; }