Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3091
b: refs/heads/master
c: c44c5ee
h: refs/heads/master
i:
  3089: 4c765c8
  3087: c8f706b
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jun 24, 2005
1 parent ac0a6ce commit 6ac0cb5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 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: 567d98292e81033182e3da4c33b41ada9c113447
refs/heads/master: c44c5eeb2c022ddac98a8543c08dc8ff820561dc
21 changes: 16 additions & 5 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1547,22 +1547,28 @@ find_delegation_file(struct nfs4_file *fp, stateid_t *stid)
return NULL;
}

static void
static int
nfs4_check_deleg(struct nfs4_file *fp, struct nfsd4_open *open,
struct nfs4_delegation **dp)
{
int flags;
int status;
int status = nfserr_bad_stateid;

*dp = find_delegation_file(fp, &open->op_delegate_stateid);
if (*dp == NULL)
return;
goto out;
flags = open->op_share_access == NFS4_SHARE_ACCESS_READ ?
RD_STATE : WR_STATE;
status = nfs4_check_delegmode(*dp, flags);
if (status)
*dp = NULL;
return;
out:
if (open->op_claim_type != NFS4_OPEN_CLAIM_DELEGATE_CUR)
return nfs_ok;
if (status)
return status;
open->op_stateowner->so_confirmed = 1;
return nfs_ok;
}

static int
Expand Down Expand Up @@ -1760,8 +1766,13 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
if (fp) {
if ((status = nfs4_check_open(fp, open, &stp)))
goto out;
nfs4_check_deleg(fp, open, &dp);
status = nfs4_check_deleg(fp, open, &dp);
if (status)
goto out;
} else {
status = nfserr_bad_stateid;
if (open->op_claim_type == NFS4_OPEN_CLAIM_DELEGATE_CUR)
goto out;
status = nfserr_resource;
fp = alloc_init_file(ino);
if (fp == NULL)
Expand Down

0 comments on commit 6ac0cb5

Please sign in to comment.