summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2017-11-29 07:35:21 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2017-12-11 11:28:11 +0100
commitb02a16e6413a2f782e542ef60bad9ff6bf212f8a (patch)
tree515434bdb7d07018dff9f0d37d6909276da9ffa9 /fs
parent08d8f8a5b094b66b29936e8751b4a818b8db1207 (diff)
downloadlinux-b02a16e6413a2f782e542ef60bad9ff6bf212f8a.tar.gz
linux-b02a16e6413a2f782e542ef60bad9ff6bf212f8a.tar.bz2
linux-b02a16e6413a2f782e542ef60bad9ff6bf212f8a.zip
ovl: update ctx->pos on impure dir iteration
This fixes a regression with readdir of impure dir in overlayfs that is shared to VM via 9p fs. Reported-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> Fixes: 4edb83bb1041 ("ovl: constant d_ino for non-merge dirs") Cc: <stable@vger.kernel.org> #4.14 Signed-off-by: Amir Goldstein <amir73il@gmail.com> Tested-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/overlayfs/readdir.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c
index 0daa4354fec4..51088849ce97 100644
--- a/fs/overlayfs/readdir.c
+++ b/fs/overlayfs/readdir.c
@@ -663,7 +663,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;
}