Commit f3115798 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: setattr, close and open_downgrade should use the state_owner's

       credentials when they are available.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@fys.uio.no>
parent 4c1b4756
...@@ -635,6 +635,8 @@ static int _nfs4_do_setattr(struct nfs_server *server, struct nfs_fattr *fattr, ...@@ -635,6 +635,8 @@ static int _nfs4_do_setattr(struct nfs_server *server, struct nfs_fattr *fattr,
fattr->valid = 0; fattr->valid = 0;
if (state != NULL)
msg.rpc_cred = state->owner->so_cred;
if (sattr->ia_valid & ATTR_SIZE) if (sattr->ia_valid & ATTR_SIZE)
nfs4_copy_stateid(&arg.stateid, state, NULL); nfs4_copy_stateid(&arg.stateid, state, NULL);
else else
...@@ -681,6 +683,7 @@ static int _nfs4_do_close(struct inode *inode, struct nfs4_state *state) ...@@ -681,6 +683,7 @@ static int _nfs4_do_close(struct inode *inode, struct nfs4_state *state)
.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CLOSE], .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CLOSE],
.rpc_argp = &arg, .rpc_argp = &arg,
.rpc_resp = &res, .rpc_resp = &res,
.rpc_cred = sp->so_cred,
}; };
if (test_bit(NFS_DELEGATED_STATE, &state->flags)) if (test_bit(NFS_DELEGATED_STATE, &state->flags))
...@@ -734,6 +737,7 @@ static int _nfs4_do_downgrade(struct inode *inode, struct nfs4_state *state, mod ...@@ -734,6 +737,7 @@ static int _nfs4_do_downgrade(struct inode *inode, struct nfs4_state *state, mod
.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_DOWNGRADE], .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_DOWNGRADE],
.rpc_argp = &arg, .rpc_argp = &arg,
.rpc_resp = &res, .rpc_resp = &res,
.rpc_cred = sp->so_cred,
}; };
if (test_bit(NFS_DELEGATED_STATE, &state->flags)) if (test_bit(NFS_DELEGATED_STATE, &state->flags))
......
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