Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp888615imm; Fri, 14 Sep 2018 07:51:56 -0700 (PDT) X-Google-Smtp-Source: ANB0VdauhUPYuynh1rjke9kNTCpXAIxYpGmvtvhZpodTzhiRBRSMueZ9BUtVBldepiwbRyuQe/Px X-Received: by 2002:a62:cac5:: with SMTP id y66-v6mr12972670pfk.187.1536936716527; Fri, 14 Sep 2018 07:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536936716; cv=none; d=google.com; s=arc-20160816; b=ogrDBzYQ+ODTWSy3vT0O5bNmX4+mkhydD4JLiwEvs7pNr4cEztzDgg6P2blBxqqJcM drNYC/7mTrsgvv92m3M0sdIJXId98On8UzDbmDRg4fYWayuuPDBx3ikvOTx/CYPP7xJd J0SqBCgQ95a2o1VSVhcMpyAuoQcnWeU2+Buec03JAVJbcCvbtSSVtQg3Prd8iCV9+I4Y 9RHivo2iWCEbKJLRghmBgYha9K1q2zH7JJikRfshKkxNq5dkWFpzH4y0+uJr8iVViRjf 2YHjTwqTS2DeOrbQIbuAjsnYRqgB79+8yg/2k1ZIOf8M/xT43TJP4qMMunBwygH+WIOI ohQw== 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=tZyUC79Lkaud9u5n4Ezb6lnry4NHAUiPlNHYcrt79H0=; b=mKZ+aPPZXDVPa/YUXaDkqxt5UrDet3pl7QZLmb/tpjKYy+Lff7sudQpfjwaj61pOZY 94X+wdWJUTlYAzPfXUuK31baLdGu1f0N5++Y3Kwq0Ot4zs4fr4n4obaGe1SWpfsQ6MhH WzA87mnVrttwounl8aMYlgEcNFv+v2bLQ//hrsLTkZjraoM9DOm5NbaO6+ja+96xDD6G clQfdT/EMzrJdC7JkP31+hZ58RxI2zxqdVZyLkYm59s2tqEJ4V9oW6XMwAyzcfT/QL6V MluNI6ajrK6i3V7rayrSP22BGSZCkV63/5GtaAAoPbmf2J1bWN951yEjhKmYSlwK+/GM ge8w== 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 h5-v6si7648778pfd.112.2018.09.14.07.51.40; Fri, 14 Sep 2018 07:51:56 -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 S1728416AbeINUGN (ORCPT + 99 others); Fri, 14 Sep 2018 16:06:13 -0400 Received: from g9t5009.houston.hpe.com ([15.241.48.73]:49406 "EHLO g9t5009.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728377AbeINUGN (ORCPT ); Fri, 14 Sep 2018 16:06:13 -0400 Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g9t5009.houston.hpe.com (Postfix) with ESMTP id EAF4051; Fri, 14 Sep 2018 14:51:20 +0000 (UTC) Received: from misato.americas.hpqcorp.net (unknown [10.34.81.122]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id 3E1C547; Fri, 14 Sep 2018 14:51:20 +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 3/3] ext2, dax: set ext2_dax_aops for dax files Date: Fri, 14 Sep 2018 08:51:14 -0600 Message-Id: <20180914145114.11122-4-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 'ext2_da_aops' is set to address_space_operations of existing DAX files, instead of 'ext2_dax_aops', since S_DAX flag is set after ext2_set_aops() in the open path. Similar to ext4, change ext2_iget() to initialize i_flags before ext2_set_aops(). Fixes: fb094c90748f ("ext2, dax: introduce ext2_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/ext2/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 7f7ee18fe179..e4bb9386c045 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -1448,6 +1448,7 @@ struct inode *ext2_iget (struct super_block *sb, unsigned long ino) } inode->i_blocks = le32_to_cpu(raw_inode->i_blocks); ei->i_flags = le32_to_cpu(raw_inode->i_flags); + ext2_set_inode_flags(inode); ei->i_faddr = le32_to_cpu(raw_inode->i_faddr); ei->i_frag_no = raw_inode->i_frag; ei->i_frag_size = raw_inode->i_fsize; @@ -1517,7 +1518,6 @@ struct inode *ext2_iget (struct super_block *sb, unsigned long ino) new_decode_dev(le32_to_cpu(raw_inode->i_block[1]))); } brelse (bh); - ext2_set_inode_flags(inode); unlock_new_inode(inode); return inode;