aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/vfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r--fs/nfsd/vfs.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index e6dfa149a300..5320e5afaddb 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -891,9 +891,9 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
891 int err = 0; 891 int err = 0;
892 int stable = *stablep; 892 int stable = *stablep;
893 893
894#ifdef MSNFS
894 err = nfserr_perm; 895 err = nfserr_perm;
895 896
896#ifdef MSNFS
897 if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) && 897 if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
898 (!lock_may_write(file->f_dentry->d_inode, offset, cnt))) 898 (!lock_may_write(file->f_dentry->d_inode, offset, cnt)))
899 goto out; 899 goto out;
@@ -1065,8 +1065,7 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp,
1065 return err; 1065 return err;
1066 if (EX_ISSYNC(fhp->fh_export)) { 1066 if (EX_ISSYNC(fhp->fh_export)) {
1067 if (file->f_op && file->f_op->fsync) { 1067 if (file->f_op && file->f_op->fsync) {
1068 err = nfsd_sync(file); 1068 err = nfserrno(nfsd_sync(file));
1069 err = nfserrno(err);
1070 } else { 1069 } else {
1071 err = nfserr_notsupp; 1070 err = nfserr_notsupp;
1072 } 1071 }
@@ -1177,7 +1176,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
1177 goto out_nfserr; 1176 goto out_nfserr;
1178 1177
1179 if (EX_ISSYNC(fhp->fh_export)) { 1178 if (EX_ISSYNC(fhp->fh_export)) {
1180 err = nfsd_sync_dir(dentry); 1179 err = nfserrno(nfsd_sync_dir(dentry));
1181 write_inode_now(dchild->d_inode, 1); 1180 write_inode_now(dchild->d_inode, 1);
1182 } 1181 }
1183 1182
@@ -1310,9 +1309,7 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
1310 goto out_nfserr; 1309 goto out_nfserr;
1311 1310
1312 if (EX_ISSYNC(fhp->fh_export)) { 1311 if (EX_ISSYNC(fhp->fh_export)) {
1313 err = nfsd_sync_dir(dentry); 1312 err = nfserrno(nfsd_sync_dir(dentry));
1314 if (err)
1315 err = nfserrno(err);
1316 /* setattr will sync the child (or not) */ 1313 /* setattr will sync the child (or not) */
1317 } 1314 }
1318 1315
@@ -1339,7 +1336,7 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
1339 if ((iap->ia_valid &= ~(ATTR_UID|ATTR_GID)) != 0) { 1336 if ((iap->ia_valid &= ~(ATTR_UID|ATTR_GID)) != 0) {
1340 int err2 = nfsd_setattr(rqstp, resfhp, iap, 0, (time_t)0); 1337 int err2 = nfsd_setattr(rqstp, resfhp, iap, 0, (time_t)0);
1341 if (err2) 1338 if (err2)
1342 err = nfserrno(err2); 1339 err = err2;
1343 } 1340 }
1344 1341
1345 /* 1342 /*
@@ -1514,10 +1511,8 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,
1514 err = vfs_link(dold, dirp, dnew); 1511 err = vfs_link(dold, dirp, dnew);
1515 if (!err) { 1512 if (!err) {
1516 if (EX_ISSYNC(ffhp->fh_export)) { 1513 if (EX_ISSYNC(ffhp->fh_export)) {
1517 err = nfsd_sync_dir(ddir); 1514 err = nfserrno(nfsd_sync_dir(ddir));
1518 write_inode_now(dest, 1); 1515 write_inode_now(dest, 1);
1519 if (err)
1520 err = nfserrno(err);
1521 } 1516 }
1522 } else { 1517 } else {
1523 if (err == -EXDEV && rqstp->rq_vers == 2) 1518 if (err == -EXDEV && rqstp->rq_vers == 2)