mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: Anton Blanchard <anton@samba.org>, Jan Kara <jack@suse.cz>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Jens Axboe <jens.axboe@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix regression in O_DIRECT|O_SYNC writes to block devices
Date: Thu, 15 Apr 2010 15:34:31 +0200	[thread overview]
Message-ID: <20100415133431.GD3561@quack.suse.cz> (raw)
In-Reply-To: <20100415104224.GA27482@lst.de>

On Thu 15-04-10 12:42:24, Christoph Hellwig wrote:
> 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.
  Yeah, that's a good point... Anton, just remove sync_blockdev() from
blkdev_fsync completely please.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2010-04-15 13:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-15  4:40 Anton Blanchard
2010-04-15  8:47 ` Jan Kara
2010-04-15 10:04 ` Jens Axboe
2010-04-15 10:42 ` Christoph Hellwig
2010-04-15 13:34   ` Jan Kara [this message]
2010-04-20  2:26   ` Anton Blanchard
2010-04-20  2:30   ` Anton Blanchard
2010-04-22 19:25     ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100415133431.GD3561@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=anton@samba.org \
    --cc=hch@lst.de \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome