From patchwork Mon Jun 29 20:02:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wilcox, Matthew R" X-Patchwork-Id: 6691671 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 89F57C05AC for ; Mon, 29 Jun 2015 20:03:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B736B204A0 for ; Mon, 29 Jun 2015 20:03:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0E07203B4 for ; Mon, 29 Jun 2015 20:03:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753382AbbF2UC6 (ORCPT ); Mon, 29 Jun 2015 16:02:58 -0400 Received: from mga02.intel.com ([134.134.136.20]:61840 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753333AbbF2UC5 (ORCPT ); Mon, 29 Jun 2015 16:02:57 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 29 Jun 2015 13:02:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,372,1432623600"; d="scan'208";a="752737117" Received: from trhope-mobl1.amr.corp.intel.com (HELO thog.int.wil.cx) ([10.252.192.243]) by fmsmga002.fm.intel.com with SMTP; 29 Jun 2015 13:02:48 -0700 Received: by thog.int.wil.cx (Postfix, from userid 1000) id 13C415F9DA; Mon, 29 Jun 2015 16:02:48 -0400 (EDT) From: Matthew Wilcox To: linux-fsdevel@vger.kernel.org, Alexander Viro Cc: Matthew Wilcox , "Theodore Ts'o" , Andreas Dilger , linux-ext4@vger.kernel.org Subject: [PATCH 4/5] ext4: Use ext4_get_block_write() for DAX Date: Mon, 29 Jun 2015 16:02:31 -0400 Message-Id: <1435608152-6982-5-git-send-email-matthew.r.wilcox@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1435608152-6982-1-git-send-email-matthew.r.wilcox@intel.com> References: <1435608152-6982-1-git-send-email-matthew.r.wilcox@intel.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Matthew Wilcox DAX relies on the get_block function either zeroing newly allocated blocks before they're findable by subsequent calls to get_block, or marking newly allocated blocks as unwritten. ext4_get_block() cannot create unwritten extents, but ext4_get_block_write() can. Reported-by: Andy Rudoff Signed-off-by: Matthew Wilcox --- fs/ext4/file.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/ext4/file.c b/fs/ext4/file.c index ac517f1..f66f3da 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -194,13 +194,12 @@ out: #ifdef CONFIG_FS_DAX static int ext4_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf) { - return dax_fault(vma, vmf, ext4_get_block); - /* Is this the right get_block? */ + return dax_fault(vma, vmf, ext4_get_block_write); } static int ext4_dax_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) { - return dax_mkwrite(vma, vmf, ext4_get_block); + return dax_mkwrite(vma, vmf, ext4_get_block_write); } static const struct vm_operations_struct ext4_dax_vm_ops = {