From patchwork Mon May 16 15:59:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9104261 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2DD479F30C for ; Mon, 16 May 2016 16:00:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D5E0C202AE for ; Mon, 16 May 2016 16:00:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A997201FE for ; Mon, 16 May 2016 15:59:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753849AbcEPP7z (ORCPT ); Mon, 16 May 2016 11:59:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:50308 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752202AbcEPP7z (ORCPT ); Mon, 16 May 2016 11:59:55 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id F271DAABC; Mon, 16 May 2016 15:59:52 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id CC4951E0A01; Mon, 16 May 2016 17:59:50 +0200 (CEST) Date: Mon, 16 May 2016 17:59:50 +0200 From: Jan Kara To: Dan Williams Cc: Theodore Ts'o , Jan Kara , linux-ext4 , linux-nvdimm , Vishal Verma , Ross Zwisler , linux-fsdevel Subject: Re: [PATCH 0/4] ext4: DAX fixes Message-ID: <20160516155950.GF21714@quack2.suse.cz> References: <1462959551-28622-1-git-send-email-jack@suse.cz> <20160513052419.GD5862@thunk.org> <20160513135600.GA2996@thunk.org> <20160516093525.GD12026@quack2.suse.cz> <20160516142616.GB21714@quack2.suse.cz> <20160516150820.GJ7799@thunk.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, 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 On Mon 16-05-16 08:13:50, Dan Williams wrote: > On Mon, May 16, 2016 at 8:08 AM, Theodore Ts'o wrote: > > On Mon, May 16, 2016 at 04:26:16PM +0200, Jan Kara wrote: > >> 1) Just push patches as is and have ext4 dax broken between ext4 merge and > >> nvdimm merge. > >> > >> 2) Split out the one-line change from "dax: Remove dead zeroing code from > >> fault handlers" in __dax_fault() which fixes the behavior for ext4 and > >> merge it through ext4 tree. Merge the rest through nvdimm tree. > > > > I'm good either way, although I have a slight preference for (2). > > It's really tiny preference, though, so if you or Dan want to run the > > fix through the dax branch, that's fine too. > > Would you fold the change and trigger a rebase or just apply it on > top? If just applying on top then it seems the same exposure as > merging it intact through nvdimm.git. The patch which fixes ext4 behavior is attached. Just that we know what we are speaking about... Rebasing all the patches on top of this is trivial (git rebase just handles the conflict automatically). I've scheduled full ext4 & XFS xfstest run with just this patch and ext4 fixes to make sure it doesn't introduce some intermediate regresion somewhere. Honza From c8963499eeba112430fc4499c675cca243b8b4a6 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 16 May 2016 17:42:11 +0200 Subject: [PATCH] dax: Call get_blocks() with create == 1 for write faults to unwritten extents Currently, __dax_fault() does not call get_blocks() callback with create argument set, when we got back unwritten extent from the initial get_blocks() call during a write fault. This is because originally filesystems were supposed to convert unwritten extents to written ones using complete_unwritten() callback. Later this was abandoned in favor of using pre-zeroed blocks however the condition whether get_blocks() needs to be called with create == 1 remained. Fix the condition so that filesystems are not forced to zero-out and convert unwritten extents when get_blocks() is called with create == 0 (which introduces unnecessary overhead for read faults and can be problematic as the filesystem may possibly be read-only). Signed-off-by: Jan Kara --- fs/dax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index 75ba46d82a76..2494255c5785 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -667,7 +667,7 @@ int __dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf, if (error) goto unlock_page; - if (!buffer_mapped(&bh) && !buffer_unwritten(&bh) && !vmf->cow_page) { + if (!buffer_mapped(&bh) && !vmf->cow_page) { if (vmf->flags & FAULT_FLAG_WRITE) { error = get_block(inode, block, &bh, 1); count_vm_event(PGMAJFAULT); -- 2.6.6