Commit 55d06611 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] knfsd: check for openmode violations given a delegation stateid.

Signed-off-by: default avatarAndy Adamson <andros@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 40ccba5f
......@@ -1956,6 +1956,20 @@ int check_openmode(struct nfs4_stateid *stp, int flags)
return status;
}
static int
nfs4_check_delegmode(struct nfs4_delegation *dp, int flags)
{
int status = nfserr_openmode;
if ((flags & WR_STATE) & (dp->dl_type == NFS4_OPEN_DELEGATE_READ))
goto out;
if ((flags & RD_STATE) & (dp->dl_type == NFS4_OPEN_DELEGATE_WRITE))
goto out;
status = nfs_ok;
out:
return status;
}
/*
* Checks for stateid operations
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment