diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-11-03 21:03:50 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-01-01 00:07:40 +0100 |
commit | dc711ca35f9d95a1eec02118e0c298b5e3068315 (patch) | |
tree | 0224900b89471b719a9abcd3e43b334e3d993df9 | |
parent | befs: ensure fast symlinks are NUL-terminated (diff) | |
download | linux-dc711ca35f9d95a1eec02118e0c298b5e3068315.tar.xz linux-dc711ca35f9d95a1eec02118e0c298b5e3068315.zip |
fix switch_names() breakage in short-to-short case
We want ->name.len to match the resulting name on *both*
source and target
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/dcache.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index fd244c7a7cc0..eeafc14c2a14 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1616,8 +1616,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); } /* @@ -1677,7 +1680,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 */ @@ -1787,7 +1789,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; |