From patchwork Mon Jun 20 20:15:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 898382 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5KKOIBf013544 for ; Mon, 20 Jun 2011 20:24:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754460Ab1FTUUj (ORCPT ); Mon, 20 Jun 2011 16:20:39 -0400 Received: from 173-166-109-252-newengland.hfc.comcastbusiness.net ([173.166.109.252]:52955 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751187Ab1FTUUg (ORCPT ); Mon, 20 Jun 2011 16:20:36 -0400 Received: from hch by bombadil.infradead.org with local (Exim 4.76 #1 (Red Hat Linux)) id 1QYkxT-0007ND-QK; Mon, 20 Jun 2011 20:20:31 +0000 Message-Id: <20110620202031.775407797@bombadil.infradead.org> User-Agent: quilt/0.48-1 Date: Mon, 20 Jun 2011 16:15:40 -0400 From: Christoph Hellwig To: viro@zeniv.linux.org.uk, tglx@linutronix.de Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, hirofumi@mail.parknet.co.jp, mfasheh@suse.com, jlbec@evilplan.org Subject: [PATCH 7/8] btrfs: wait for direct I/O requests in truncate References: <20110620201533.847236272@bombadil.infradead.org> Content-Disposition: inline; filename=btrfs-call-dio_wait X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 20 Jun 2011 20:24:19 +0000 (UTC) Wait for all direct I/O requests to finish before performing a truncate. Signed-off-by: Christoph Hellwig --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/fs/btrfs/inode.c =================================================================== --- linux-2.6.orig/fs/btrfs/inode.c 2011-06-11 12:58:46.615017504 +0200 +++ linux-2.6/fs/btrfs/inode.c 2011-06-11 12:59:23.218348984 +0200 @@ -3550,6 +3550,8 @@ static int btrfs_setsize(struct inode *i loff_t oldsize = i_size_read(inode); int ret; + inode_dio_wait(inode); + if (newsize == oldsize) return 0;