Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1777593imm; Thu, 27 Sep 2018 02:17:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV60kIoSO3YDwkN3I28z3YQh4BanomZl4nvU6Tm001vcMCJxn5XDZKvP7r189NkgCPdyHDb92 X-Received: by 2002:a63:1e19:: with SMTP id e25-v6mr9325235pge.44.1538039875059; Thu, 27 Sep 2018 02:17:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538039875; cv=none; d=google.com; s=arc-20160816; b=x8qAMP+oCgFXSfyyStXkakBjiPyiS4Kp8xpggXlj1KFVl/zVobyeMqinjJL4ZNs7LT kx8hBl9JVfJyZ8XYBTb4Rvcj3T9OJjhT0P07vgOzTyc5iFeZwdlXHnfl8ydB4zRRW99Z Dwn2gQrXjqn1ziflSyh6yvHlaHucVtjxHz73Ed9SptXbDqpfWdBkZVLrx/3e2raK8r4c XYWjJSOOOKkGkvKrp5BgrWWU3VSvz3UGQdcMutf/v/9PduMmKpzlwZObFGNqUbk+C5ld U7KB2qyysyNNrY9U0bY6ou7q8/iqojbvmOV6BWc+ZNJDtwLO5WxRnATkKE4t9Ph+v6QA QqWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=3uAaEWzr/2fmrz2P22eiFeqr97ZwTrED9z5BRCfVUSo=; b=Az4WZ57kkB2+yn8k4NgZC3C69cdTgp1ZwnOe0wBoHU5pJebdjuQXBt3cn6W9tonopQ QoZM/CMWGbdatyhDpEu2rNsxl81g6tb/MFDw3n4xUVGrumY8ia3euUr3i/jpMjbIkSN8 GNdvziL1VIioBdUs6+5YoOQv7dKtDKRR7brO/ceojNPdqncQlyg/adk1S3FhoU6yKPj0 mrU3CfydfS2LwKms0H/IhCJyuZJsXub8Oo60pAivE4c9EIdMc01pzSo+XG+M8bU2XAzt Ixs+sXHsPNzKt+xUbEvSZeFNvkWLHaBD9y2y1bKfirwyK5srZgooytq5Apt4nU+ibOpZ Mx7A== 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 5-v6si1543569pls.431.2018.09.27.02.17.39; Thu, 27 Sep 2018 02:17:55 -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 S1728370AbeI0Pcu (ORCPT + 99 others); Thu, 27 Sep 2018 11:32:50 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55600 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727706AbeI0Pct (ORCPT ); Thu, 27 Sep 2018 11:32:49 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C5FD11117; Thu, 27 Sep 2018 09:15:32 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Toshi Kani , Theodore Tso , Jan Kara Subject: [PATCH 4.18 85/88] ext4, dax: set ext4_dax_aops for dax files Date: Thu, 27 Sep 2018 11:04:06 +0200 Message-Id: <20180927090310.902544713@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927090300.631426620@linuxfoundation.org> References: <20180927090300.631426620@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Toshi Kani commit cce6c9f7e6029caee45c459db5b3e78fec6973cb upstream. 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 Signed-off-by: Theodore Ts'o Suggested-by: Jan Kara Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/ext4/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4861,6 +4861,7 @@ struct inode *ext4_iget(struct super_blo * 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)) @@ -5010,7 +5011,6 @@ struct inode *ext4_iget(struct super_blo goto bad_inode; } brelse(iloc.bh); - ext4_set_inode_flags(inode); unlock_new_inode(inode); return inode;