aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-08 17:42:01 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-08 22:38:55 -0500
commit4fc8796d23819da814ec25b7793bde8f104f1a2a (patch)
treed86513109dd792087091b6054a983271b2536f60 /fs/nfs/nfs4proc.c
parent0032a7a749a49b2c044092a1d0af5cfd0077f35d (diff)
NFSv4: Clean up nfs4_select_rw_stateid()
Ensure that we select delegation stateids first, then lock stateids and then open stateids. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 3578ad36a5b8..3bf5593741ee 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1929,10 +1929,12 @@ static int _nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
1929 1929
1930 nfs_fattr_init(fattr); 1930 nfs_fattr_init(fattr);
1931 1931
1932 if (nfs4_copy_delegation_stateid(&arg.stateid, inode, FMODE_WRITE)) { 1932 if (state != NULL) {
1933 nfs4_select_rw_stateid(&arg.stateid, state, FMODE_WRITE,
1934 current->files, current->tgid);
1935 } else if (nfs4_copy_delegation_stateid(&arg.stateid, inode,
1936 FMODE_WRITE)) {
1933 /* Use that stateid */ 1937 /* Use that stateid */
1934 } else if (state != NULL) {
1935 nfs4_select_rw_stateid(&arg.stateid, state, current->files, current->tgid);
1936 } else 1938 } else
1937 nfs4_stateid_copy(&arg.stateid, &zero_stateid); 1939 nfs4_stateid_copy(&arg.stateid, &zero_stateid);
1938 1940