projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NFS: Fix an Oops in encode_lookup()
[deliverable/linux.git]
/
fs
/
nfs
/
dir.c
diff --git
a/fs/nfs/dir.c
b/fs/nfs/dir.c
index c27258b5d3e16a55f16f85981e92a22854de3583..e4a04d16b8b06fd4faf22b7ba238f404403a8c7f 100644
(file)
--- a/
fs/nfs/dir.c
+++ b/
fs/nfs/dir.c
@@
-654,7
+654,7
@@
static int nfs_check_verifier(struct inode *dir, struct dentry *dentry)
if (IS_ROOT(dentry))
return 1;
if (IS_ROOT(dentry))
return 1;
- verf =
(unsigned long)dentry->d_fsdata
;
+ verf =
dentry->d_time
;
if (nfs_caches_unstable(dir)
|| verf != NFS_I(dir)->cache_change_attribute)
return 0;
if (nfs_caches_unstable(dir)
|| verf != NFS_I(dir)->cache_change_attribute)
return 0;
@@
-663,7
+663,7
@@
static int nfs_check_verifier(struct inode *dir, struct dentry *dentry)
static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf)
{
static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf)
{
- dentry->d_
fsdata = (void *)
verf;
+ dentry->d_
time =
verf;
}
static void nfs_refresh_verifier(struct dentry * dentry, unsigned long verf)
}
static void nfs_refresh_verifier(struct dentry * dentry, unsigned long verf)
@@
-869,7
+869,7
@@
static void nfs_dentry_iput(struct dentry *dentry, struct inode *inode)
if (dentry->d_flags & DCACHE_NFSFS_RENAMED) {
lock_kernel();
drop_nlink(inode);
if (dentry->d_flags & DCACHE_NFSFS_RENAMED) {
lock_kernel();
drop_nlink(inode);
- nfs_complete_unlink(dentry);
+ nfs_complete_unlink(dentry
, inode
);
unlock_kernel();
}
/* When creating a negative dentry, we want to renew d_time */
unlock_kernel();
}
/* When creating a negative dentry, we want to renew d_time */
@@
-897,14
+897,13
@@
int nfs_is_exclusive_create(struct inode *dir, struct nameidata *nd)
return (nd->intent.open.flags & O_EXCL) != 0;
}
return (nd->intent.open.flags & O_EXCL) != 0;
}
-static inline int nfs_reval_fsid(struct vfsmount *mnt, struct inode *dir,
- struct nfs_fh *fh, struct nfs_fattr *fattr)
+static inline int nfs_reval_fsid(struct inode *dir, const struct nfs_fattr *fattr)
{
struct nfs_server *server = NFS_SERVER(dir);
if (!nfs_fsid_equal(&server->fsid, &fattr->fsid))
{
struct nfs_server *server = NFS_SERVER(dir);
if (!nfs_fsid_equal(&server->fsid, &fattr->fsid))
- /* Revalidate fsid
on root dir
*/
- return __nfs_revalidate_inode(server,
mnt->mnt_root->d_inode
);
+ /* Revalidate fsid
using the parent directory
*/
+ return __nfs_revalidate_inode(server,
dir
);
return 0;
}
return 0;
}
@@
-946,7
+945,7
@@
static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
res = ERR_PTR(error);
goto out_unlock;
}
res = ERR_PTR(error);
goto out_unlock;
}
- error = nfs_reval_fsid(
nd->mnt, dir, &fhandle
, &fattr);
+ error = nfs_reval_fsid(
dir
, &fattr);
if (error < 0) {
res = ERR_PTR(error);
goto out_unlock;
if (error < 0) {
res = ERR_PTR(error);
goto out_unlock;
@@
-1163,6
+1162,8
@@
static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc)
}
if (!desc->plus || !(entry->fattr->valid & NFS_ATTR_FATTR))
return NULL;
}
if (!desc->plus || !(entry->fattr->valid & NFS_ATTR_FATTR))
return NULL;
+ if (name.len > NFS_SERVER(dir)->namelen)
+ return NULL;
/* Note: caller is already holding the dir->i_mutex! */
dentry = d_alloc(parent, &name);
if (dentry == NULL)
/* Note: caller is already holding the dir->i_mutex! */
dentry = d_alloc(parent, &name);
if (dentry == NULL)
@@
-1244,7
+1245,7
@@
static int nfs_create(struct inode *dir, struct dentry *dentry, int mode,
attr.ia_mode = mode;
attr.ia_valid = ATTR_MODE;
attr.ia_mode = mode;
attr.ia_valid = ATTR_MODE;
- if (
nd && (nd->flags & LOOKUP_CREATE)
)
+ if (
(nd->flags & LOOKUP_CREATE) != 0
)
open_flags = nd->intent.open.flags;
lock_kernel();
open_flags = nd->intent.open.flags;
lock_kernel();
@@
-1412,7
+1413,7
@@
static int nfs_sillyrename(struct inode *dir, struct dentry *dentry)
nfs_renew_times(dentry);
nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
d_move(dentry, sdentry);
nfs_renew_times(dentry);
nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
d_move(dentry, sdentry);
- error = nfs_async_unlink(dentry);
+ error = nfs_async_unlink(d
ir, d
entry);
/* If we return 0 we don't unlink */
}
dput(sdentry);
/* If we return 0 we don't unlink */
}
dput(sdentry);
@@
-1535,7
+1536,7
@@
static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *sym
lock_kernel();
lock_kernel();
- page = alloc_page(GFP_
KERNEL
);
+ page = alloc_page(GFP_
HIGHUSER
);
if (!page) {
unlock_kernel();
return -ENOMEM;
if (!page) {
unlock_kernel();
return -ENOMEM;
@@
-1744,8
+1745,8
@@
int nfs_access_cache_shrinker(int nr_to_scan, gfp_t gfp_mask)
struct nfs_inode *nfsi;
struct nfs_access_entry *cache;
struct nfs_inode *nfsi;
struct nfs_access_entry *cache;
- spin_lock(&nfs_access_lru_lock);
restart:
restart:
+ spin_lock(&nfs_access_lru_lock);
list_for_each_entry(nfsi, &nfs_access_lru_list, access_cache_inode_lru) {
struct inode *inode;
list_for_each_entry(nfsi, &nfs_access_lru_list, access_cache_inode_lru) {
struct inode *inode;
@@
-1770,6
+1771,7
@@
remove_lru_entry:
clear_bit(NFS_INO_ACL_LRU_SET, &nfsi->flags);
}
spin_unlock(&inode->i_lock);
clear_bit(NFS_INO_ACL_LRU_SET, &nfsi->flags);
}
spin_unlock(&inode->i_lock);
+ spin_unlock(&nfs_access_lru_lock);
iput(inode);
goto restart;
}
iput(inode);
goto restart;
}
This page took
0.026154 seconds
and
5
git commands to generate.