Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226696
b: refs/heads/master
c: 79eb4dd
h: refs/heads/master
v: v3
  • Loading branch information
Nick Piggin committed Jan 7, 2011
1 parent 9481e36 commit 1fbefc7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe15ce446beb3a33583af81ffe6c9d01a75314ed
refs/heads/master: 79eb4dde742fe2e9c9e301432b894a7410261ce7
43 changes: 24 additions & 19 deletions trunk/fs/cifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,22 +656,34 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
static int
cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
{
int isValid = 1;

if (direntry->d_inode) {
if (cifs_revalidate_dentry(direntry))
return 0;
} else {
cFYI(1, "neg dentry 0x%p name = %s",
direntry, direntry->d_name.name);
if (time_after(jiffies, direntry->d_time + HZ) ||
!lookupCacheEnabled) {
d_drop(direntry);
isValid = 0;
}
else
return 1;
}

return isValid;
/*
* This may be nfsd (or something), anyway, we can't see the
* intent of this. So, since this can be for creation, drop it.
*/
if (!nd)
return 0;

/*
* Drop the negative dentry, in order to make sure to use the
* case sensitive name which is specified by user if this is
* for creation.
*/
if (!(nd->flags & (LOOKUP_CONTINUE | LOOKUP_PARENT))) {
if (nd->flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET))
return 0;
}

if (time_after(jiffies, direntry->d_time + HZ) || !lookupCacheEnabled)
return 0;

return 1;
}

/* static int cifs_d_delete(struct dentry *direntry)
Expand Down Expand Up @@ -709,15 +721,8 @@ static int cifs_ci_compare(struct dentry *dentry, struct qstr *a,
struct nls_table *codepage = CIFS_SB(dentry->d_inode->i_sb)->local_nls;

if ((a->len == b->len) &&
(nls_strnicmp(codepage, a->name, b->name, a->len) == 0)) {
/*
* To preserve case, don't let an existing negative dentry's
* case take precedence. If a is not a negative dentry, this
* should have no side effects
*/
memcpy((void *)a->name, b->name, a->len);
(nls_strnicmp(codepage, a->name, b->name, a->len) == 0))
return 0;
}
return 1;
}

Expand Down

0 comments on commit 1fbefc7

Please sign in to comment.