[Devel] [PATCH RH7 1/4] prepend_path() needs to reinitialize dentry/vfsmount/mnt on restarts

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Wed Jun 17 07:05:10 PDT 2015


From: Al Viro <viro at zeniv.linux.org.uk>

Port mainstream commit:

  commit ede4cebce16f5643c61aedd6d88d9070a1d23a68
  Author: Al Viro <viro at zeniv.linux.org.uk>
  Date:   Wed Nov 13 07:45:40 2013 -0500

      prepend_path() needs to reinitialize dentry/vfsmount/mnt on

      ... and equivalent is needed in 3.12; it's broken there as

      Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>

https://jira.sw.ru/browse/PSBM-34245
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 fs/dcache.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 3670260..27c3a3a 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2875,9 +2875,9 @@ static int prepend_path(const struct path *path,
 			const struct path *root,
 			char **buffer, int *buflen)
 {
-	struct dentry *dentry = path->dentry;
-	struct vfsmount *vfsmnt = path->mnt;
-	struct mount *mnt = real_mount(vfsmnt);
+	struct dentry *dentry;
+	struct vfsmount *vfsmnt;
+	struct mount *mnt;
 	int error = 0;
 	unsigned seq = 0;
 	char *bptr;
@@ -2887,6 +2887,9 @@ static int prepend_path(const struct path *path,
 restart:
 	bptr = *buffer;
 	blen = *buflen;
+	dentry = path->dentry;
+	vfsmnt = path->mnt;
+	mnt = real_mount(vfsmnt);
 	read_seqbegin_or_lock(&rename_lock, &seq);
 	while (dentry != root->dentry || vfsmnt != root->mnt) {
 		struct dentry * parent;
-- 
1.9.3




More information about the Devel mailing list