Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4250241imm; Tue, 11 Sep 2018 09:04:04 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY0VYcJ3v1uijbqfFuUDgdi2sNJyh2wmTfgkZ3pOk9Om4OrjDH4iNgOw63UZea/ZPhvZoJu X-Received: by 2002:a63:c912:: with SMTP id o18-v6mr28309010pgg.331.1536681844260; Tue, 11 Sep 2018 09:04:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536681844; cv=none; d=google.com; s=arc-20160816; b=mKJdrPDLfTa6DQSFBFqWZEkiyH+3+aCKPQj0LAgAIh6bK4OcMEjrrcJ7hwQSccsKVn om9sKfFJjBzO5SKroFeiUto9dDwh3hZdjvQPExuDg3wZjF7DismolLmTaMF9GNK88CC8 woicCjy/KeoTpPvibSo9udWqPm5ExR7voaQHKIFbNejsVpURN5EBGnP7sojKfh/HmDC5 +eO4T/SR0aP8iLSlIW4Z2nIKavAgU6msvoA4q86FioJsBvOmny+htOC0/m3uOFF5XBbQ pbaHbM/S1NTAKMb6NzXa91s68mMSjUMQdPNlkb3Q0/EwGmUo+OfrpPXKrzgqalgIcEq8 X6wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=gS+0v5wTrPQ6UNAyvBhB9OR8G7ZhYKk61PO7Bo0u+Nc=; b=UWfYXgAuTHBjN/3sa5lGetREJVMtxok4Kztp/gc+Sqcx7PGQ1JdGDcmMkWyBe91MML 1BbYUke6aIIlJE7hjll1BGTawgBT0mIGI39FGqIW6+gZCntis4IIEdOw05p4j3AESXTn O3JJrxL9NNHfPjuMROTjLKMht5NWNe1ebEqgNIrTkJt7aSWdCOoxydXFf3hNWit2ooh8 tmzNwfE+67UGKmUSuc1+XlmXbj8Wl5/rrlGQm8hRDUHB/7cv8T2PDtWXVz++9g3SkZLD zudBMFX1fVnCjug4JnU1tNp5EJHXkwTIUALB4/QlEGSQDCO9fwWIE+MZw21+xYJ6aeqO xHxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9-v6si22396987pgr.260.2018.09.11.09.03.48; Tue, 11 Sep 2018 09:04:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727957AbeIKVD0 (ORCPT + 99 others); Tue, 11 Sep 2018 17:03:26 -0400 Received: from g9t1613g.houston.hpe.com ([15.241.32.99]:10484 "EHLO g9t1613g.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726775AbeIKVD0 (ORCPT ); Tue, 11 Sep 2018 17:03:26 -0400 Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by g9t1613g.houston.hpe.com (Postfix) with ESMTPS id 287D661149; Tue, 11 Sep 2018 16:03:28 +0000 (UTC) Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id 25AE577; Tue, 11 Sep 2018 16:03:27 +0000 (UTC) Received: from misato.americas.hpqcorp.net (unknown [10.34.81.122]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id AF96937; Tue, 11 Sep 2018 16:03:26 +0000 (UTC) From: Toshi Kani To: jack@suse.cz, dan.j.williams@intel.com Cc: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, Toshi Kani Subject: [PATCH 2/2] ext4, dax: set ext4_dax_aops for dax files Date: Tue, 11 Sep 2018 09:42:46 -0600 Message-Id: <20180911154246.6844-3-toshi.kani@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180911154246.6844-1-toshi.kani@hpe.com> References: <20180911154246.6844-1-toshi.kani@hpe.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sync syscall to an existing DAX file needs to flush processor cache, but it does not currently. This is because 'ext4_da_aops' is set to address_space_operations of existing DAX files, instead of 'ext4_dax_aops', since S_DAX flag is set after ext4_set_aops() in the open path. New file -------- lookup_open ext4_create __ext4_new_inode ext4_set_inode_flags // Set S_DAX flag ext4_set_aops // Set aops to ext4_dax_aops Existing file ------------- lookup_open ext4_lookup ext4_iget ext4_set_aops // Set aops to ext4_da_aops ext4_set_inode_flags // Set S_DAX flag Change ext4_iget() to call ext4_set_inode_flags() before ext4_set_aops(). Fixes: 5f0663bb4a64f588f0a2dd6d1be68d40f9af0086 Signed-off-by: Toshi Kani Cc: Jan Kara Cc: Dan Williams Cc: "Theodore Ts'o" Cc: Andreas Dilger --- fs/ext4/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 775cd9b4af55..93cbbb859c40 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4998,6 +4998,8 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino) if (ret) goto bad_inode; + ext4_set_inode_flags(inode); + if (S_ISREG(inode->i_mode)) { inode->i_op = &ext4_file_inode_operations; inode->i_fop = &ext4_file_operations; @@ -5043,7 +5045,6 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino) goto bad_inode; } brelse(iloc.bh); - ext4_set_inode_flags(inode); unlock_new_inode(inode); return inode;