Commit 0d476b05 authored by Al Viro's avatar Al Viro Committed by Ben Hutchings

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

commit 96f6f985 upstream.

..._want_write() returns -EROFS on failure, _not_ an NFS error value.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarJonathan Nieder <jrnieder@gmail.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 7af21761
......@@ -827,6 +827,7 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
struct nfsd4_setattr *setattr)
{
__be32 status = nfs_ok;
int err;
if (setattr->sa_iattr.ia_valid & ATTR_SIZE) {
nfs4_lock_state();
......@@ -838,9 +839,9 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
return status;
}
}
status = mnt_want_write(cstate->current_fh.fh_export->ex_path.mnt);
if (status)
return status;
err = mnt_want_write(cstate->current_fh.fh_export->ex_path.mnt);
if (err)
return nfserrno(err);
status = nfs_ok;
status = check_attr_support(rqstp, cstate, setattr->sa_bmval,
......
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