diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-04-27 18:42:43 -0400 |
---|---|---|
committer | Luis Henriques <luis.henriques@canonical.com> | 2012-05-25 12:24:36 -0400 |
commit | 546ece5725ef2feb9ad85de554ed6f54d6f31c79 (patch) | |
tree | 1a8d8fc8832a19139df00408d22dac957ab1733e | |
parent | 1802ef5d26944e31f8d10c6bc7d3c2b3dc8be9bc (diff) |
nfsd: fix b0rken error value for setattr on read-only mount
BugLink: http://bugs.launchpad.net/bugs/996109
commit 96f6f98501196d46ce52c2697dd758d9300c63f5 upstream.
..._want_write() returns -EROFS on failure, _not_ an NFS error value.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 0b8830c9de7..d06a02c1b1a 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -812,6 +812,7 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
812 | struct nfsd4_setattr *setattr) | 812 | struct nfsd4_setattr *setattr) |
813 | { | 813 | { |
814 | __be32 status = nfs_ok; | 814 | __be32 status = nfs_ok; |
815 | int err; | ||
815 | 816 | ||
816 | if (setattr->sa_iattr.ia_valid & ATTR_SIZE) { | 817 | if (setattr->sa_iattr.ia_valid & ATTR_SIZE) { |
817 | nfs4_lock_state(); | 818 | nfs4_lock_state(); |
@@ -823,9 +824,9 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
823 | return status; | 824 | return status; |
824 | } | 825 | } |
825 | } | 826 | } |
826 | status = mnt_want_write(cstate->current_fh.fh_export->ex_path.mnt); | 827 | err = mnt_want_write(cstate->current_fh.fh_export->ex_path.mnt); |
827 | if (status) | 828 | if (err) |
828 | return status; | 829 | return nfserrno(err); |
829 | status = nfs_ok; | 830 | status = nfs_ok; |
830 | 831 | ||
831 | status = check_attr_support(rqstp, cstate, setattr->sa_bmval, | 832 | status = check_attr_support(rqstp, cstate, setattr->sa_bmval, |