lkml.org 
[lkml]   [2010]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Fix regression in O_DIRECT|O_SYNC writes to block devices
On Tue 20-04-10 12:30:47, Anton Blanchard wrote:
<snip>
> Signed-off-by: Anton Blanchard <anton@samba.org>
The patch looks good to me now.

Acked-by: Jan Kara <jack@suse.cz>

> Index: linux-2.6/fs/block_dev.c
> ===================================================================
> --- linux-2.6.orig/fs/block_dev.c 2010-04-20 11:28:32.000000000 +1000
> +++ linux-2.6/fs/block_dev.c 2010-04-20 11:36:46.000000000 +1000
> @@ -406,16 +406,23 @@ static loff_t block_llseek(struct file *
>
> int blkdev_fsync(struct file *filp, struct dentry *dentry, int datasync)
> {
> - struct block_device *bdev = I_BDEV(filp->f_mapping->host);
> + struct inode *bd_inode = filp->f_mapping->host;
> + struct block_device *bdev = I_BDEV(bd_inode);
> int error;
>
> - error = sync_blockdev(bdev);
> - if (error)
> - return error;
> -
> + /*
> + * There is no need to serialise calls to blkdev_issue_flush with
> + * i_mutex and doing so causes performance issues with concurrent
> + * O_SYNC writers to a block device.
> + */
> + mutex_unlock(&bd_inode->i_mutex);
> +
> error = blkdev_issue_flush(bdev, NULL);
> if (error == -EOPNOTSUPP)
> error = 0;
> +
> + mutex_lock(&bd_inode->i_mutex);
> +
> return error;
> }
> EXPORT_SYMBOL(blkdev_fsync);
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR


\
 
 \ /
  Last update: 2010-04-22 21:27    [W:0.057 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site