aboutsummaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 55f0975a9b15..6466bc8a3dc7 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -352,11 +352,11 @@ static long do_fsync(unsigned int fd, int datasync)
352 * We need to protect against concurrent writers, 352 * We need to protect against concurrent writers,
353 * which could cause livelocks in fsync_buffers_list 353 * which could cause livelocks in fsync_buffers_list
354 */ 354 */
355 down(&mapping->host->i_sem); 355 mutex_lock(&mapping->host->i_mutex);
356 err = file->f_op->fsync(file, file->f_dentry, datasync); 356 err = file->f_op->fsync(file, file->f_dentry, datasync);
357 if (!ret) 357 if (!ret)
358 ret = err; 358 ret = err;
359 up(&mapping->host->i_sem); 359 mutex_unlock(&mapping->host->i_mutex);
360 err = filemap_fdatawait(mapping); 360 err = filemap_fdatawait(mapping);
361 if (!ret) 361 if (!ret)
362 ret = err; 362 ret = err;
@@ -2338,7 +2338,7 @@ int generic_commit_write(struct file *file, struct page *page,
2338 __block_commit_write(inode,page,from,to); 2338 __block_commit_write(inode,page,from,to);
2339 /* 2339 /*
2340 * No need to use i_size_read() here, the i_size 2340 * No need to use i_size_read() here, the i_size
2341 * cannot change under us because we hold i_sem. 2341 * cannot change under us because we hold i_mutex.
2342 */ 2342 */
2343 if (pos > inode->i_size) { 2343 if (pos > inode->i_size) {
2344 i_size_write(inode, pos); 2344 i_size_write(inode, pos);