lkml.org 
[lkml]   [2014]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
SubjectRe: [PATCH v2] vfs: Don't exchange "short" filenames unconditionally.
From
On Wed, Sep 24, 2014 at 12:20 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> There's no way that patch is correct.

Something like the appended might be a good idea regardless. And might
have made people notice that the len and the hash go together with the
name.

Linus

----

diff --git a/fs/dcache.c b/fs/dcache.c
index 7a5b51440afa..aa1b045b997c 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2412,7 +2412,7 @@ static void switch_names(struct dentry
*dentry, struct dentry *target)
}
}
}
- swap(dentry->d_name.len, target->d_name.len);
+ swap(dentry->d_name.hash_len, target->d_name.hash_len);
}
static void dentry_lock_for_move(struct dentry *dentry, struct
dentry *target)
@@ -2511,7 +2511,6 @@ static void __d_move(struct dentry *dentry,
struct dentry *target,

/* Switch the names.. */
switch_names(dentry, target);
- swap(dentry->d_name.hash, target->d_name.hash);
/* ... and switch the parents */
if (IS_ROOT(dentry)) {
@@ -2650,7 +2649,6 @@ static void __d_materialise_dentry(struct
dentry *dentry, struct dentry *anon)
dparent = dentry->d_parent;

switch_names(dentry, anon);
- swap(dentry->d_name.hash, anon->d_name.hash);

dentry->d_parent = dentry;
list_del_init(&dentry->d_u.d_child);

\
 
 \ /
  Last update: 2014-09-24 22:01    [W:0.131 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site