Skip to content

Commit

Permalink
nfsd: fix b0rken error value for setattr on read-only mount
Browse files Browse the repository at this point in the history
..._want_write() returns -EROFS on failure, _not_ an NFS error value.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Apr 13, 2012
1 parent ecca5c3 commit 96f6f98
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fs/nfsd/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,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();
Expand All @@ -852,9 +853,9 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
return status;
}
}
status = fh_want_write(&cstate->current_fh);
if (status)
return status;
err = fh_want_write(&cstate->current_fh);
if (err)
return nfserrno(err);
status = nfs_ok;

status = check_attr_support(rqstp, cstate, setattr->sa_bmval,
Expand Down

0 comments on commit 96f6f98

Please sign in to comment.