|
@@ -938,6 +938,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
|
|
int stable = *stablep;
|
|
|
int use_wgather;
|
|
|
loff_t pos = offset;
|
|
|
+ loff_t end = LLONG_MAX;
|
|
|
unsigned int pflags = current->flags;
|
|
|
|
|
|
if (rqstp->rq_local)
|
|
@@ -969,10 +970,13 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
|
|
fsnotify_modify(file);
|
|
|
|
|
|
if (stable) {
|
|
|
- if (use_wgather)
|
|
|
+ if (use_wgather) {
|
|
|
host_err = wait_for_concurrent_writes(file);
|
|
|
- else
|
|
|
- host_err = vfs_fsync_range(file, offset, offset+*cnt, 0);
|
|
|
+ } else {
|
|
|
+ if (*cnt)
|
|
|
+ end = offset + *cnt - 1;
|
|
|
+ host_err = vfs_fsync_range(file, offset, end, 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
out_nfserr:
|