Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp890273imm; Fri, 14 Sep 2018 07:53:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZQSQa6bH5/3mbpvcCMaII6rGAsf6C1I/seA2wzpia5MIQbZbmSWF/rb+WXS2qBRd7s48hy X-Received: by 2002:a62:f40a:: with SMTP id r10-v6mr12998187pff.47.1536936808499; Fri, 14 Sep 2018 07:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536936808; cv=none; d=google.com; s=arc-20160816; b=adRerk/F9GOk7T4FFcKA9qAtfn0Wk0YmRfvPfOn0EBVDsw4Fpuc5/KFXpUjNPDHHge zIPCVuKOJiPUU1TOvpauvmVZ9naxW0fb9VmwXWtcxrPwOezLCdA7oUkWRiNPOuGOPwT6 hH6nZPSeF89NlN7+1A2wUkSqH5oxZVmiHIhqq7qIQaNTM8fyw0G5a2HCPS+0TAiNQx3k dVp5b5eS2Jfot2f2Vc42VATLcSobpKzc++cODjiSa5Ikc68snVWZeU0/uRZNs1jv/sgu lj3CuJGHkt1B5oQkY9V+umorfvp9ZtGfou+4kns+8FmaECDYvrNH4zmWYv5nFHmNZbI2 yA2A== 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=FfqnISs058UtovUranRW+sfwyeIGTYyeLKGcg976nS4=; b=supjUTlH2FVUGodpKMAZz1sW9BQ6Z66KW4U866ni3LNDdX4wbqi0PfNbS5NGc0Ke7y a+Us43Bii5XEv44XwePV3o+3ZaF2yQhjdWQsaXn2BSnwD3WDyz0NUK8ifFaOrm1HHpm5 vnN9oNwagT/cp/uVwE7nRl730z+wPRxQCBmnohtAJxWeCziWIjRmjgrdNnHyKpImQHmG 6Y7EVE6QHo/akmkJA3iSYednEz1yJ0PHDir2DKbvaGjt6iRRKlEWkwQkBzy06BvCC1kq nVykMJmVBpgQXqTD1/IHUN/lk2hJpB4HjZSKG0Vo7n0B24mjJzddQLc7JWQOHANEFgU2 DZDw== 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 n5-v6si7402194pgg.572.2018.09.14.07.53.11; Fri, 14 Sep 2018 07:53:28 -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 S1728391AbeINUGN (ORCPT + 99 others); Fri, 14 Sep 2018 16:06:13 -0400 Received: from g9t5009.houston.hpe.com ([15.241.48.73]:49366 "EHLO g9t5009.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbeINUGL (ORCPT ); Fri, 14 Sep 2018 16:06:11 -0400 Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g9t5009.houston.hpe.com (Postfix) with ESMTP id 81C145C; Fri, 14 Sep 2018 14:51:19 +0000 (UTC) Received: from misato.americas.hpqcorp.net (unknown [10.34.81.122]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id F026547; Fri, 14 Sep 2018 14:51:18 +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 , stable@vger.kernel.org Subject: [PATCH v2 2/3] ext4, dax: set ext4_dax_aops for dax files Date: Fri, 14 Sep 2018 08:51:13 -0600 Message-Id: <20180914145114.11122-3-toshi.kani@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180914145114.11122-1-toshi.kani@hpe.com> References: <20180914145114.11122-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 DAX file needs to flush processor cache, but it currently does not flush to existing DAX files. 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 initialize i_flags before ext4_set_aops(). Fixes: 5f0663bb4a64 ("ext4, dax: introduce ext4_dax_aops") Signed-off-by: Toshi Kani Suggested-by: Jan Kara Cc: Jan Kara Cc: Dan Williams Cc: "Theodore Ts'o" Cc: Andreas Dilger Cc: --- fs/ext4/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index e4acaa980467..b19387b75f2b 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4896,6 +4896,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino) * not initialized on a new filesystem. */ } ei->i_flags = le32_to_cpu(raw_inode->i_flags); + ext4_set_inode_flags(inode); inode->i_blocks = ext4_inode_blocks(raw_inode, ei); ei->i_file_acl = le32_to_cpu(raw_inode->i_file_acl_lo); if (ext4_has_feature_64bit(sb)) @@ -5042,7 +5043,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;