From: Jens Axboe Date: Thu, 29 Apr 2010 07:36:24 +0000 (+0200) Subject: Merge branch 'master' into for-2.6.35 X-Git-Tag: v2.6.35-rc1~442^2~60 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7407cf355fdf5500430be966dbbde84a27293bad;p=profile%2Fcommon%2Fkernel-common.git Merge branch 'master' into for-2.6.35 Conflicts: fs/block_dev.c Signed-off-by: Jens Axboe --- 7407cf355fdf5500430be966dbbde84a27293bad diff --cc fs/block_dev.c index dd76930,6dcee88..55dcb78 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@@ -406,17 -406,23 +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; - - error = blkdev_issue_flush(bdev, GFP_KERNEL, NULL, - (BLKDEV_IFL_WAIT)); + /* + * 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); ++ error = blkdev_issue_flush(bdev, GFP_KERNEL, NULL, BLKDEV_IFL_WAIT); if (error == -EOPNOTSUPP) error = 0; + + mutex_lock(&bd_inode->i_mutex); + return error; } EXPORT_SYMBOL(blkdev_fsync);