git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git]
/
fs
/
nfsd
/
nfs4state.c
diff --git
a/fs/nfsd/nfs4state.c
b/fs/nfsd/nfs4state.c
index
e280ad4
..
e11b9cd
100644
(file)
--- a/
fs/nfsd/nfs4state.c
+++ b/
fs/nfsd/nfs4state.c
@@
-123,7
+123,7
@@
static void release_stateid(struct nfs4_stateid *stp, int flags);
*/
/* recall_lock protects the del_recall_lru */
*/
/* recall_lock protects the del_recall_lru */
-static
DEFINE_SPINLOCK(recall_lock)
;
+static
spinlock_t recall_lock = SPIN_LOCK_UNLOCKED
;
static struct list_head del_recall_lru;
static void
static struct list_head del_recall_lru;
static void
@@
-529,7
+529,8
@@
move_to_confirmed(struct nfs4_client *clp)
dprintk("NFSD: move_to_confirm nfs4_client %p\n", clp);
list_del_init(&clp->cl_strhash);
dprintk("NFSD: move_to_confirm nfs4_client %p\n", clp);
list_del_init(&clp->cl_strhash);
- list_move(&clp->cl_idhash, &conf_id_hashtbl[idhashval]);
+ list_del_init(&clp->cl_idhash);
+ list_add(&clp->cl_idhash, &conf_id_hashtbl[idhashval]);
strhashval = clientstr_hashval(clp->cl_recdir);
list_add(&clp->cl_strhash, &conf_str_hashtbl[strhashval]);
renew_client(clp);
strhashval = clientstr_hashval(clp->cl_recdir);
list_add(&clp->cl_strhash, &conf_str_hashtbl[strhashval]);
renew_client(clp);
@@
-1237,15
+1238,8
@@
find_file(struct inode *ino)
return NULL;
}
return NULL;
}
-static int access_valid(u32 x)
-{
- return (x > 0 && x < 4);
-}
-
-static int deny_valid(u32 x)
-{
- return (x >= 0 && x < 5);
-}
+#define TEST_ACCESS(x) ((x > 0 || x < 4)?1:0)
+#define TEST_DENY(x) ((x >= 0 || x < 5)?1:0)
static void
set_access(unsigned int *access, unsigned long bmap) {
static void
set_access(unsigned int *access, unsigned long bmap) {
@@
-1752,8
+1746,7
@@
nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
int status;
status = nfserr_inval;
int status;
status = nfserr_inval;
- if (!access_valid(open->op_share_access)
- || !deny_valid(open->op_share_deny))
+ if (!TEST_ACCESS(open->op_share_access) || !TEST_DENY(open->op_share_deny))
goto out;
/*
* Lookup file; if found, lookup stateid and check open request,
goto out;
/*
* Lookup file; if found, lookup stateid and check open request,
@@
-1790,10
+1783,10
@@
nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
} else {
/* Stateid was not found, this is a new OPEN */
int flags = 0;
} else {
/* Stateid was not found, this is a new OPEN */
int flags = 0;
- if (open->op_share_access & NFS4_SHARE_ACCESS_READ)
- flags |= MAY_READ;
if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE)
if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE)
- flags |= MAY_WRITE;
+ flags = MAY_WRITE;
+ else
+ flags = MAY_READ;
status = nfs4_new_open(rqstp, &stp, dp, current_fh, flags);
if (status)
goto out;
status = nfs4_new_open(rqstp, &stp, dp, current_fh, flags);
if (status)
goto out;
@@
-2078,12
+2071,16
@@
nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int fl
if (!stateid->si_fileid) { /* delegation stateid */
if(!(dp = find_delegation_stateid(ino, stateid))) {
dprintk("NFSD: delegation stateid not found\n");
if (!stateid->si_fileid) { /* delegation stateid */
if(!(dp = find_delegation_stateid(ino, stateid))) {
dprintk("NFSD: delegation stateid not found\n");
+ if (nfs4_in_grace())
+ status = nfserr_grace;
goto out;
}
stidp = &dp->dl_stateid;
} else { /* open or lock stateid */
if (!(stp = find_stateid(stateid, flags))) {
dprintk("NFSD: open or lock stateid not found\n");
goto out;
}
stidp = &dp->dl_stateid;
} else { /* open or lock stateid */
if (!(stp = find_stateid(stateid, flags))) {
dprintk("NFSD: open or lock stateid not found\n");
+ if (nfs4_in_grace())
+ status = nfserr_grace;
goto out;
}
if ((flags & CHECK_FH) && nfs4_check_fh(current_fh, stp))
goto out;
}
if ((flags & CHECK_FH) && nfs4_check_fh(current_fh, stp))
@@
-2256,9
+2253,8
@@
nfsd4_open_confirm(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfs
(int)current_fh->fh_dentry->d_name.len,
current_fh->fh_dentry->d_name.name);
(int)current_fh->fh_dentry->d_name.len,
current_fh->fh_dentry->d_name.name);
- status = fh_verify(rqstp, current_fh, S_IFREG, 0);
- if (status)
- return status;
+ if ((status = fh_verify(rqstp, current_fh, S_IFREG, 0)))
+ goto out;
nfs4_lock_state();
nfs4_lock_state();
@@
-2325,8
+2321,7
@@
nfsd4_open_downgrade(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct n
(int)current_fh->fh_dentry->d_name.len,
current_fh->fh_dentry->d_name.name);
(int)current_fh->fh_dentry->d_name.len,
current_fh->fh_dentry->d_name.name);
- if (!access_valid(od->od_share_access)
- || !deny_valid(od->od_share_deny))
+ if (!TEST_ACCESS(od->od_share_access) || !TEST_DENY(od->od_share_deny))
return nfserr_inval;
nfs4_lock_state();
return nfserr_inval;
nfs4_lock_state();