From patchwork Fri Jun 18 15:30:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bugzilla-daemon@bugzilla.kernel.org X-Patchwork-Id: 56204 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E88D0B7D88 for ; Sat, 19 Jun 2010 01:30:21 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933700Ab0FRPaU (ORCPT ); Fri, 18 Jun 2010 11:30:20 -0400 Received: from demeter.kernel.org ([140.211.167.39]:47448 "EHLO demeter.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932475Ab0FRPaT (ORCPT ); Fri, 18 Jun 2010 11:30:19 -0400 Received: from demeter.kernel.org (localhost.localdomain [127.0.0.1]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5IFUIiK002099 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 18 Jun 2010 15:30:19 GMT Received: (from apache@localhost) by demeter.kernel.org (8.14.3/8.14.3/Submit) id o5IFUIZh002098; Fri, 18 Jun 2010 15:30:18 GMT Date: Fri, 18 Jun 2010 15:30:18 GMT Message-Id: <201006181530.o5IFUIZh002098@demeter.kernel.org> From: bugzilla-daemon@bugzilla.kernel.org To: linux-ext4@vger.kernel.org Subject: [Bug 16165] Wrong data returned on read after write if file size was changed with ftruncate before X-Bugzilla-Reason: None X-Bugzilla-Type: newchanged X-Bugzilla-Watch-Reason: AssignedTo fs_ext4@kernel-bugs.osdl.org X-Bugzilla-Product: File System X-Bugzilla-Component: ext4 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sandeen@redhat.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: fs_ext4@kernel-bugs.osdl.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: In-Reply-To: References: Auto-Submitted: auto-generated MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [127.0.0.1]); Fri, 18 Jun 2010 15:30:19 +0000 (UTC) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org https://bugzilla.kernel.org/show_bug.cgi?id=16165 --- Comment #12 from Eric Sandeen 2010-06-18 15:30:13 --- Can those who can reproduce this test this patch from mingming? When unaligned DIO writes, skip zero out the block if the buffer is marked unwritten. That means there is an asynconous direct IO (append or fill the hole) still pending. Signed-off-by: Mingming Cao --- fs/direct-io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: linux-git/fs/direct-io.c =================================================================== --- linux-git.orig/fs/direct-io.c 2010-05-07 15:42:22.855033403 -0700 +++ linux-git/fs/direct-io.c 2010-05-07 15:44:17.695007770 -0700 @@ -740,7 +740,8 @@ struct page *page; dio->start_zero_done = 1; - if (!dio->blkfactor || !buffer_new(&dio->map_bh)) + if (!dio->blkfactor || !buffer_new(&dio->map_bh) + || buffer_unwritten(&dio->map_bh)) return; dio_blocks_per_fs_block = 1 << dio->blkfactor;