Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336181
b: refs/heads/master
c: 3c46f3d
h: refs/heads/master
i:
  336179: 5f2703c
v: v3
  • Loading branch information
Linus Torvalds committed Dec 2, 2012
1 parent 50b1d3d commit 789d216
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 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: 8852aac25e79e38cc6529f20298eed154f60b574
refs/heads/master: 3c46f3d6406b1d0c53575774b2d1fd013cd7f76f
5 changes: 4 additions & 1 deletion trunk/fs/cifs/readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,17 @@ cifs_readdir_lookup(struct dentry *parent, struct qstr *name,

dentry = d_lookup(parent, name);
if (dentry) {
int err;
inode = dentry->d_inode;
/* update inode in place if i_ino didn't change */
if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) {
cifs_fattr_to_inode(inode, fattr);
return dentry;
}
d_drop(dentry);
err = d_invalidate(dentry);
dput(dentry);
if (err)
return NULL;
}

dentry = d_alloc(parent, name);
Expand Down
14 changes: 8 additions & 6 deletions trunk/fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,16 +994,18 @@ int iterate_fd(struct files_struct *files, unsigned n,
const void *p)
{
struct fdtable *fdt;
struct file *file;
int res = 0;
if (!files)
return 0;
spin_lock(&files->file_lock);
fdt = files_fdtable(files);
while (!res && n < fdt->max_fds) {
file = rcu_dereference_check_fdtable(files, fdt->fd[n++]);
if (file)
res = f(p, file, n);
for (fdt = files_fdtable(files); n < fdt->max_fds; n++) {
struct file *file;
file = rcu_dereference_check_fdtable(files, fdt->fd[n]);
if (!file)
continue;
res = f(p, file, n);
if (res)
break;
}
spin_unlock(&files->file_lock);
return res;
Expand Down
5 changes: 5 additions & 0 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2131,6 +2131,11 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
if (!len)
return ERR_PTR(-EACCES);

if (unlikely(name[0] == '.')) {
if (len < 2 || (len == 2 && name[1] == '.'))
return ERR_PTR(-EACCES);
}

while (len--) {
c = *(const unsigned char *)name++;
if (c == '/' || c == '\0')
Expand Down
7 changes: 4 additions & 3 deletions trunk/fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry)
nfs_refresh_inode(dentry->d_inode, entry->fattr);
goto out;
} else {
d_drop(dentry);
if (d_invalidate(dentry) != 0)
goto out;
dput(dentry);
}
}
Expand Down Expand Up @@ -1100,6 +1101,8 @@ static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
out_zap_parent:
nfs_zap_caches(dir);
out_bad:
nfs_free_fattr(fattr);
nfs_free_fhandle(fhandle);
nfs_mark_for_revalidate(dir);
if (inode && S_ISDIR(inode->i_mode)) {
/* Purge readdir caches. */
Expand All @@ -1112,8 +1115,6 @@ static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
shrink_dcache_parent(dentry);
}
d_drop(dentry);
nfs_free_fattr(fattr);
nfs_free_fhandle(fhandle);
dput(parent);
dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) is invalid\n",
__func__, dentry->d_parent->d_name.name,
Expand Down

0 comments on commit 789d216

Please sign in to comment.