diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-11-03 15:03:50 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-12-31 18:07:40 -0500 |
commit | dc711ca35f9d95a1eec02118e0c298b5e3068315 (patch) | |
tree | 0224900b89471b719a9abcd3e43b334e3d993df9 /fs/dcache.c | |
parent | 7df5fa06de89a4ac311957e0cb9c1d87552b4325 (diff) |
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>
Diffstat (limited to 'fs/dcache.c')
-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 fd244c7a7cc..eeafc14c2a1 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -1616,8 +1616,11 @@ static void switch_names(struct dentry *dentry, struct dentry *target) | |||
1616 | */ | 1616 | */ |
1617 | memcpy(dentry->d_iname, target->d_name.name, | 1617 | memcpy(dentry->d_iname, target->d_name.name, |
1618 | target->d_name.len + 1); | 1618 | target->d_name.len + 1); |
1619 | dentry->d_name.len = target->d_name.len; | ||
1620 | return; | ||
1619 | } | 1621 | } |
1620 | } | 1622 | } |
1623 | do_switch(dentry->d_name.len, target->d_name.len); | ||
1621 | } | 1624 | } |
1622 | 1625 | ||
1623 | /* | 1626 | /* |
@@ -1677,7 +1680,6 @@ already_unhashed: | |||
1677 | 1680 | ||
1678 | /* Switch the names.. */ | 1681 | /* Switch the names.. */ |
1679 | switch_names(dentry, target); | 1682 | switch_names(dentry, target); |
1680 | do_switch(dentry->d_name.len, target->d_name.len); | ||
1681 | do_switch(dentry->d_name.hash, target->d_name.hash); | 1683 | do_switch(dentry->d_name.hash, target->d_name.hash); |
1682 | 1684 | ||
1683 | /* ... and switch the parents */ | 1685 | /* ... and switch the parents */ |
@@ -1787,7 +1789,6 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon) | |||
1787 | struct dentry *dparent, *aparent; | 1789 | struct dentry *dparent, *aparent; |
1788 | 1790 | ||
1789 | switch_names(dentry, anon); | 1791 | switch_names(dentry, anon); |
1790 | do_switch(dentry->d_name.len, anon->d_name.len); | ||
1791 | do_switch(dentry->d_name.hash, anon->d_name.hash); | 1792 | do_switch(dentry->d_name.hash, anon->d_name.hash); |
1792 | 1793 | ||
1793 | dparent = dentry->d_parent; | 1794 | dparent = dentry->d_parent; |