diff options
author | NeilBrown <neilb@cse.unsw.edu.au> | 2005-07-08 02:59:27 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-08 03:24:11 +0200 |
commit | 4c4cd222ee329025840bc2f8cebf71d36c62440c (patch) | |
tree | 70d1d8e754e7ab7226a6eee6afeab8b892072600 /include/linux/nfsd/state.h | |
parent | [PATCH] nfsd4: clean up nfs4_preprocess_seqid_op (diff) | |
download | linux-4c4cd222ee329025840bc2f8cebf71d36c62440c.tar.xz linux-4c4cd222ee329025840bc2f8cebf71d36c62440c.zip |
[PATCH] nfsd4: check lock type against openmode.
We shouldn't be allowing, e.g., write locks on files not open for read. To
enforce this, we add a pointer from the lock stateid back to the open stateid
it came from, so that the check will continue to be correct even after the
open is upgraded or downgraded.
Signed-off-by: Andy Adamson <andros@citi.umich.edu>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to '')
-rw-r--r-- | include/linux/nfsd/state.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index 2d19431f47ea..8bf23cf8b603 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h @@ -237,6 +237,10 @@ struct nfs4_file { * st_perlockowner: (open stateid) list of lock nfs4_stateowners * st_access_bmap: used only for open stateid * st_deny_bmap: used only for open stateid +* st_openstp: open stateid lock stateid was derived from +* +* XXX: open stateids and lock stateids have diverged sufficiently that +* we should consider defining separate structs for the two cases. */ struct nfs4_stateid { @@ -250,6 +254,7 @@ struct nfs4_stateid { struct file * st_vfs_file; unsigned long st_access_bmap; unsigned long st_deny_bmap; + struct nfs4_stateid * st_openstp; }; /* flags for preprocess_seqid_op() */ |