diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-10-26 16:04:08 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-11-07 19:31:33 -0500 |
commit | fae5096ad217db2e3368e980c1d86223f786856b (patch) | |
tree | efe6c90695ee97eb12364ff7756821a67ccc9f7a /fs | |
parent | 7fa10cd12df3ec0873a5db0d8dc8e978423b87dc (diff) |
nfsd: assume writeable exportabled filesystems have f_sync
I don't really see how you could claim to support nfsd and not support
fsync somehow.
And in practice a quick look through the exportable filesystems suggests
the only ones without an ->fsync are read-only (efs, isofs, squashfs) or
in-memory (shmem).
Also, performing a write and then returning an error if the sync fails
(as we would do here in the wgather case) seems unhelpful to clients.
Also remove an incorrect comment.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/vfs.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index c120b48ec30..ed3eb59b607 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1020,21 +1020,8 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file, | |||
1020 | inode = dentry->d_inode; | 1020 | inode = dentry->d_inode; |
1021 | exp = fhp->fh_export; | 1021 | exp = fhp->fh_export; |
1022 | 1022 | ||
1023 | /* | ||
1024 | * Request sync writes if | ||
1025 | * - the sync export option has been set, or | ||
1026 | * - the client requested O_SYNC behavior (NFSv3 feature). | ||
1027 | * - The file system doesn't support fsync(). | ||
1028 | * When NFSv2 gathered writes have been configured for this volume, | ||
1029 | * flushing the data to disk is handled separately below. | ||
1030 | */ | ||
1031 | use_wgather = (rqstp->rq_vers == 2) && EX_WGATHER(exp); | 1023 | use_wgather = (rqstp->rq_vers == 2) && EX_WGATHER(exp); |
1032 | 1024 | ||
1033 | if (!file->f_op->fsync) {/* COMMIT3 cannot work */ | ||
1034 | stable = 2; | ||
1035 | *stablep = 2; /* FILE_SYNC */ | ||
1036 | } | ||
1037 | |||
1038 | if (!EX_ISSYNC(exp)) | 1025 | if (!EX_ISSYNC(exp)) |
1039 | stable = 0; | 1026 | stable = 0; |
1040 | if (stable && !use_wgather) { | 1027 | if (stable && !use_wgather) { |