lkml.org 
[lkml]   [2010]   [Apr]   [15]   [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 Thu, Apr 15, 2010 at 02:40:39PM +1000, Anton Blanchard wrote:
> 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;
>
> + mutex_unlock(&bd_inode->i_mutex);
> +
> error = sync_blockdev(bdev);

Actually you can just drop this call entirely. sync_blockdev is an
overcomplicated alias for filemap_write_and_wait on the block device
inode, which is exactl what we did just before calling into ->fsync

It might be worth to still drop i_mutex for the cache flush, though.


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