Skip to content

Commit

Permalink
cifs: fix dentry hash calculation for case-insensitive mounts
Browse files Browse the repository at this point in the history
case-insensitive mounts shouldn't use full_name_hash(). Make sure we
use the parent dentry's d_hash routine when one is set.

Reported-by: Dave Kleikamp <[email protected]>
Signed-off-by: Jeff Layton <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
jtlayton authored and Steve French committed Feb 8, 2010
1 parent ccd4bb1 commit 05507fa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fs/cifs/readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ cifs_readdir_lookup(struct dentry *parent, struct qstr *name,

cFYI(1, ("For %s", name->name));

if (parent->d_op && parent->d_op->d_hash)
parent->d_op->d_hash(parent, name);
else
name->hash = full_name_hash(name->name, name->len);

dentry = d_lookup(parent, name);
if (dentry) {
/* FIXME: check for inode number changes? */
Expand Down Expand Up @@ -671,8 +676,6 @@ static int cifs_get_name_from_search_buf(struct qstr *pqst,
pqst->name = filename;
pqst->len = len;
}
pqst->hash = full_name_hash(pqst->name, pqst->len);
/* cFYI(1, ("filldir on %s",pqst->name)); */
return rc;
}

Expand Down

0 comments on commit 05507fa

Please sign in to comment.