From patchwork Tue May 14 16:37:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Czerner X-Patchwork-Id: 243756 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 5B5232C00AF for ; Wed, 15 May 2013 02:41:06 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757701Ab3ENQiM (ORCPT ); Tue, 14 May 2013 12:38:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1747 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757629Ab3ENQiK (ORCPT ); Tue, 14 May 2013 12:38:10 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4EGc8PS001692 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 14 May 2013 12:38:08 -0400 Received: from localhost.localdomain.com (dhcp-1-129.brq.redhat.com [10.34.1.129]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4EGbcTq005331; Tue, 14 May 2013 12:38:06 -0400 From: Lukas Czerner To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, akpm@linux-foundation.org, hughd@google.com, lczerner@redhat.com Subject: [PATCH v4 12/20] ext4: Call ext4_jbd2_file_inode() after zeroing block Date: Tue, 14 May 2013 18:37:26 +0200 Message-Id: <1368549454-8930-13-git-send-email-lczerner@redhat.com> In-Reply-To: <1368549454-8930-1-git-send-email-lczerner@redhat.com> References: <1368549454-8930-1-git-send-email-lczerner@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org In data=ordered mode we should call ext4_jbd2_file_inode() so that crash after the truncate transaction has committed does not expose stall data in the tail of the block. Thanks Jan Kara for pointing that out. Signed-off-by: Lukas Czerner --- fs/ext4/inode.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 11c07e1..8187c3e 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3680,8 +3680,11 @@ int ext4_block_zero_page_range(handle_t *handle, err = 0; if (ext4_should_journal_data(inode)) { err = ext4_handle_dirty_metadata(handle, inode, bh); - } else + } else { mark_buffer_dirty(bh); + if (ext4_test_inode_state(inode, EXT4_STATE_ORDERED_MODE)) + err = ext4_jbd2_file_inode(handle, inode); + } unlock: unlock_page(page);