ovl: update ctx->pos on impure dir iteration
Amir Goldstein
maintainerPATCH 1/1 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 <[email protected]>
Fixes 4edb83bb1041 ("ovl: constant d_ino for non-merge dirs")
Cc <[email protected]> #4.14
Signed-off-by Amir Goldstein <[email protected]>
--- fs/overlayfs/readdir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/overlayfs/readdir.c +4 -1
@@ -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; }
Signature · 1 line
2.7.4
Quoted 16 lines · Amir Goldstein
This fixes a regression with readdir of impure dir in overlayfs that is shared to VM via 9p fs.
Reported-by Miguel Bernal Marin <[email protected]>Fixes 4edb83bb1041 ("ovl: constant d_ino for non-merge dirs")Cc <[email protected]> #4.14Signed-off-by Amir Goldstein <[email protected]>--- fs/overlayfs/readdir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)fs/overlayfs/readdir.c +0
-0
fs/overlayfs/readdir.c static int ovl_iterate_real(struct file *file, struct dir_context *ctx) · line 670
Quoted 9 lines
fs/overlayfs/readdir.c +4
-1@@ -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; }
This fix the issue with 9P and Overlay
Tested-by Miguel Bernal Marin <[email protected]>
Signature · 4 lines
Thanks, Miguel Bernal Marin Open Source Technology Center https://clearlinux.org Intel Corporation
Quoted 29 lines · Miguel Bernal Marin
Quoted 16 lines · Amir Goldstein
This fixes a regression with readdir of impure dir in overlayfs that is shared to VM via 9p fs.
Reported-by Miguel Bernal Marin <[email protected]>Fixes 4edb83bb1041 ("ovl: constant d_ino for non-merge dirs")Cc <[email protected]> #4.14Signed-off-by Amir Goldstein <[email protected]>--- fs/overlayfs/readdir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)fs/overlayfs/readdir.c +0
-0fs/overlayfs/readdir.c static int ovl_iterate_real(struct file *file, struct dir_context *ctx) · line 670
Quoted 9 lines
fs/overlayfs/readdir.c +4
-1@@ -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; }This fix the issue with 9P and Overlay
Quoted 1 line
Tested-by Miguel Bernal Marin <[email protected]>
Thanks, applied.
Miklos