Received: with ECARTIS (v1.0.0; list linux-xfs); Mon, 20 Mar 2006 13:32:31 -0800 (PST) Received: from omx2.sgi.com (omx2-ext.sgi.com [192.48.171.19]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id k2KLWUW6016534 for ; Mon, 20 Mar 2006 13:32:30 -0800 Received: from imr2.americas.sgi.com (imr2.americas.sgi.com [198.149.16.18]) by omx2.sgi.com (8.12.11/8.12.9/linux-outbound_gateway-1.1) with ESMTP id k2KNgIrG006029 for ; Mon, 20 Mar 2006 15:42:18 -0800 Received: from poppy-e236.americas.sgi.com (poppy-e236.americas.sgi.com [128.162.236.207]) by imr2.americas.sgi.com (8.12.9/8.12.10/SGI_generic_relay-1.2) with ESMTP id k2KLom7p20350990; Mon, 20 Mar 2006 13:50:48 -0800 (PST) Received: from attica.americas.sgi.com (attica.americas.sgi.com [128.162.236.44]) by poppy-e236.americas.sgi.com (8.12.9/ASC-news-1.4) with ESMTP id k2KLX7SQ4096782; Mon, 20 Mar 2006 15:33:07 -0600 (CST) Received: by attica.americas.sgi.com (Postfix, from userid 9762) id B9D129E2A247; Mon, 20 Mar 2006 15:33:07 -0600 (CST) To: linux-xfs@sgi.com, sgi.bugs.xfs@sgi.com Subject: TAKE 947420 - Fixing the conflict between DIO write and truncate Message-Id: <20060320213307.B9D129E2A247@attica.americas.sgi.com> Date: Mon, 20 Mar 2006 15:33:07 -0600 (CST) From: yingping@sgi.com (Yingping Lu) X-archive-position: 7494 X-ecartis-version: Ecartis v1.0.0 Sender: linux-xfs-bounce@oss.sgi.com Errors-to: linux-xfs-bounce@oss.sgi.com X-original-sender: yingping@sgi.com Precedence: bulk X-list: linux-xfs Content-Length: 1099 Lines: 20 Fixing the error caused by the conflict between DIO Write's conversion and concurrent truncate operations. Use vn_iowait to wait for the completion of any pending DIOs. Since the truncate requires exclusive IOLOCK, so this blocks any further DIO operations since DIO write also needs exclusive IOBLOCK. This serves as a barrier and prevent any potential starvation. Date: Mon Mar 20 13:31:13 PST 2006 Workarea: attica.americas.sgi.com:/data/lwork/attica3/yingping/xfs_kern_947420 Inspected by: dgc,nathans The following file(s) were checked into: bonnie.engr.sgi.com:/isms/xfs-kern/xfs-linux Modid: xfs-linux:xfs-kern:208088a xfs_vnodeops.c - 1.668 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.668&r2=text&tr2=1.667&f=h - Add vn_iowait to wait for the completion of any pending DIO write for truncate operation xfs_inode.c - 1.433 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.433&r2=text&tr2=1.432&f=h - Add vn_iowait to wait for the completion of any pending DIO write for truncate operation