summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/sync.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/sync.c b/fs/sync.c
index 4e15da01923c..192340930bb4 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -218,7 +218,7 @@ int vfs_fsync_range(struct file *file, struct dentry *dentry, loff_t start,
goto out;
}
- ret = filemap_fdatawrite_range(mapping, start, end);
+ ret = filemap_write_and_wait_range(mapping, start, end);
/*
* We need to protect against concurrent writers, which could cause
@@ -230,9 +230,6 @@ int vfs_fsync_range(struct file *file, struct dentry *dentry, loff_t start,
ret = err;
mutex_unlock(&mapping->host->i_mutex);
- err = filemap_fdatawait_range(mapping, start, end);
- if (!ret)
- ret = err;
out:
return ret;
}