提交 721ccfb7 编写于 作者: T Trond Myklebust

NFSv4: Warn once about servers that incorrectly apply open mode to setattr

Debugging aid to help identify servers that incorrectly apply open mode
checks to setattr requests that are not changing the file size.
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 ee3ae84e
......@@ -2184,6 +2184,13 @@ static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
err = _nfs4_do_setattr(inode, cred, fattr, sattr, state);
switch (err) {
case -NFS4ERR_OPENMODE:
if (!(sattr->ia_valid & ATTR_SIZE)) {
pr_warn_once("NFSv4: server %s is incorrectly "
"applying open mode checks to "
"a SETATTR that is not "
"changing file size.\n",
server->nfs_client->cl_hostname);
}
if (state && !(state->state & FMODE_WRITE)) {
err = -EBADF;
if (sattr->ia_valid & ATTR_OPEN)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册