Skip to contentSkip to conversation

ovl: update ctx->pos on impure dir iteration

PATCH Applied Amir Goldstein 3 participants 3 messages Nov 29, 2017 – Dec 6, 2017 Overlay filesystem

lore
Share & tools
lore

Amir Goldstein

author maintainer
#0 lore raw

PATCH 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.

Fixes 4edb83bb1041 ("ovl: constant d_ino for non-merge dirs")
---
 fs/overlayfs/readdir.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
fs/overlayfs/readdir.c +4 -1
index 502dc0966f91..b98f1efe50c1 100644
@@ -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
Tested-by on v1 1/1
#1 lore raw
Quoted 16 lines · Amir Goldstein

This fixes a regression with readdir of impure dir in overlayfs that is shared to VM via 9p fs.

Fixes 4edb83bb1041 ("ovl: constant d_ino for non-merge dirs")
---
 fs/overlayfs/readdir.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
fs/overlayfs/readdir.c +0 -0
index 502dc0966f91..b98f1efe50c1 100644

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

Signature · 4 lines
Thanks,

Miguel Bernal Marin                     Open Source Technology Center
https://clearlinux.org                              Intel Corporation
maintainer Applied
#2 lore raw
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.

Fixes 4edb83bb1041 ("ovl: constant d_ino for non-merge dirs")
---
 fs/overlayfs/readdir.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
fs/overlayfs/readdir.c +0 -0
index 502dc0966f91..b98f1efe50c1 100644

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

Quoted 1 line

Thanks, applied.

Miklos