提交 96f6f985 编写于 作者: A Al Viro

nfsd: fix b0rken error value for setattr on read-only mount

..._want_write() returns -EROFS on failure, _not_ an NFS error value.
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 ecca5c3a
...@@ -841,6 +841,7 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -841,6 +841,7 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
struct nfsd4_setattr *setattr) struct nfsd4_setattr *setattr)
{ {
__be32 status = nfs_ok; __be32 status = nfs_ok;
int err;
if (setattr->sa_iattr.ia_valid & ATTR_SIZE) { if (setattr->sa_iattr.ia_valid & ATTR_SIZE) {
nfs4_lock_state(); nfs4_lock_state();
...@@ -852,9 +853,9 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -852,9 +853,9 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
return status; return status;
} }
} }
status = fh_want_write(&cstate->current_fh); err = fh_want_write(&cstate->current_fh);
if (status) if (err)
return status; return nfserrno(err);
status = nfs_ok; status = nfs_ok;
status = check_attr_support(rqstp, cstate, setattr->sa_bmval, status = check_attr_support(rqstp, cstate, setattr->sa_bmval,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册