diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-04-12 23:47:00 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-04-13 10:12:00 -0400 |
commit | 96f6f98501196d46ce52c2697dd758d9300c63f5 (patch) | |
tree | 08d3795842459047a88ade0708fc10c8b91656bb /fs/nfsd | |
parent | ecca5c3acc0d0933d89abc44e60afb0cc8170e35 (diff) |
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: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 2ed14dfd00a2..694d526c8f19 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -841,6 +841,7 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
841 | struct nfsd4_setattr *setattr) | 841 | struct nfsd4_setattr *setattr) |
842 | { | 842 | { |
843 | __be32 status = nfs_ok; | 843 | __be32 status = nfs_ok; |
844 | int err; | ||
844 | 845 | ||
845 | if (setattr->sa_iattr.ia_valid & ATTR_SIZE) { | 846 | if (setattr->sa_iattr.ia_valid & ATTR_SIZE) { |
846 | nfs4_lock_state(); | 847 | nfs4_lock_state(); |
@@ -852,9 +853,9 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
852 | return status; | 853 | return status; |
853 | } | 854 | } |
854 | } | 855 | } |
855 | status = fh_want_write(&cstate->current_fh); | 856 | err = fh_want_write(&cstate->current_fh); |
856 | if (status) | 857 | if (err) |
857 | return status; | 858 | return nfserrno(err); |
858 | status = nfs_ok; | 859 | status = nfs_ok; |
859 | 860 | ||
860 | status = check_attr_support(rqstp, cstate, setattr->sa_bmval, | 861 | status = check_attr_support(rqstp, cstate, setattr->sa_bmval, |