summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-11-03 15:03:50 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-18 10:35:41 -0800
commitc9bb99e4921c92adfbfee5c17b2bfdd512da33c7 (patch)
treeee95c963e2494a09deb196fd10cd7d32f6322810
parenta48a68982ebfabe032a0ae8a60c4ca6f1b180ade (diff)
fix switch_names() breakage in short-to-short case
commit dc711ca35f9d95a1eec02118e0c298b5e3068315 upstream. We want ->name.len to match the resulting name on *both* source and target Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--fs/dcache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 1c016006490b..1c12fcc30f17 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1615,8 +1615,11 @@ static void switch_names(struct dentry *dentry, struct dentry *target)
*/
memcpy(dentry->d_iname, target->d_name.name,
target->d_name.len + 1);
+ dentry->d_name.len = target->d_name.len;
+ return;
}
}
+ do_switch(dentry->d_name.len, target->d_name.len);
}
/*
@@ -1676,7 +1679,6 @@ already_unhashed:
/* Switch the names.. */
switch_names(dentry, target);
- do_switch(dentry->d_name.len, target->d_name.len);
do_switch(dentry->d_name.hash, target->d_name.hash);
/* ... and switch the parents */
@@ -1781,7 +1783,6 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
struct dentry *dparent, *aparent;
switch_names(dentry, anon);
- do_switch(dentry->d_name.len, anon->d_name.len);
do_switch(dentry->d_name.hash, anon->d_name.hash);
dparent = dentry->d_parent;