diff options
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r-- | fs/nfsd/vfs.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 7c2e337d05af..8715d194561a 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -752,6 +752,8 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
752 | flags, current_cred()); | 752 | flags, current_cred()); |
753 | if (IS_ERR(*filp)) | 753 | if (IS_ERR(*filp)) |
754 | host_err = PTR_ERR(*filp); | 754 | host_err = PTR_ERR(*filp); |
755 | else | ||
756 | host_err = ima_file_check(*filp, access); | ||
755 | out_nfserr: | 757 | out_nfserr: |
756 | err = nfserrno(host_err); | 758 | err = nfserrno(host_err); |
757 | out: | 759 | out: |
@@ -780,12 +782,9 @@ static inline int nfsd_dosync(struct file *filp, struct dentry *dp, | |||
780 | int (*fsync) (struct file *, struct dentry *, int); | 782 | int (*fsync) (struct file *, struct dentry *, int); |
781 | int err; | 783 | int err; |
782 | 784 | ||
783 | err = filemap_fdatawrite(inode->i_mapping); | 785 | err = filemap_write_and_wait(inode->i_mapping); |
784 | if (err == 0 && fop && (fsync = fop->fsync)) | 786 | if (err == 0 && fop && (fsync = fop->fsync)) |
785 | err = fsync(filp, dp, 0); | 787 | err = fsync(filp, dp, 0); |
786 | if (err == 0) | ||
787 | err = filemap_fdatawait(inode->i_mapping); | ||
788 | |||
789 | return err; | 788 | return err; |
790 | } | 789 | } |
791 | 790 | ||
@@ -2130,7 +2129,6 @@ nfsd_permission(struct svc_rqst *rqstp, struct svc_export *exp, | |||
2130 | */ | 2129 | */ |
2131 | path.mnt = exp->ex_path.mnt; | 2130 | path.mnt = exp->ex_path.mnt; |
2132 | path.dentry = dentry; | 2131 | path.dentry = dentry; |
2133 | err = ima_path_check(&path, acc & (MAY_READ | MAY_WRITE | MAY_EXEC)); | ||
2134 | nfsd_out: | 2132 | nfsd_out: |
2135 | return err? nfserrno(err) : 0; | 2133 | return err? nfserrno(err) : 0; |
2136 | } | 2134 | } |