Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3211248ybg; Sun, 20 Oct 2019 09:02:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpr6XOh1ogenaChPUjNFHg+Y8pvbG9wPqGXtOVtSv5tbA7tIMplgxgdwyDwygwJ8KfOvWo X-Received: by 2002:a5d:50c9:: with SMTP id f9mr15435501wrt.36.1571587333461; Sun, 20 Oct 2019 09:02:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571587333; cv=none; d=google.com; s=arc-20160816; b=Q4t7w32f7PsnDfyIfYrrFYI1TU8Xt6hJxnoqnUeFokQzPIhd3he33RuKoJ0/Ix7Y4H 1AQdixYgK6Fq5qBpgC1lJvYS34zpEii6uTKQAx3Ez5ZfvjhLx28omgIfz50cBWdj8v9i B56V0EyplnAsI4xWppin8vEW2BPnBiQeSDo0jLPH7johpVMxoMyTrGqfUZym7DPL6jRn 2K5ZHH7icI2OpBsh9uMIDm/BaEXupOKT/4XPDDHWaVhQv3aLwD/Y8eVYUmoFiHFN1hKo AonmJKjtl4Cqdmvy+5p771CNfcZZbtCUAy3r+iBnMDOkZBXBFEtvvnyRfHWVsyEdQDh9 dp9A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qkDqmTRiaAd1EvCQq/yIsbMedx8wzawz+SNxYml1Ltw=; b=AgXjXNSFiTBiObEfRGV7d0aEJgzzGGD3QqO+p192pxf5R4TlKu8t2LTtk2bp5lRz0A shJkQQsWIGvThnWbwahTIKnOdQ/0dFPrHy2JVNL0KE0iDx0h4ZKZSxObugsrfGgJEdN4 Z798aGmfPZBeBYPLvyckCcAPS82GwObQwGsCbJoIx5SoL9HmHp77PkYvcxFLr5JBFSZZ o+FyojP3B4D8q9fyFTOroHtqv6JF6cMOLWAzOEWkfmBSfW6+qGAR8XAkZiSSuHy2QLdW BYkwtXv7+Am4r/jtDVaiNDlNS5aZja5nHgLpWnosoqKo6XerCgOZ/+J74hcOhif749eo 6A5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d15si7926464edb.7.2019.10.20.09.01.44; Sun, 20 Oct 2019 09:02:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726620AbfJTP75 (ORCPT + 99 others); Sun, 20 Oct 2019 11:59:57 -0400 Received: from mga17.intel.com ([192.55.52.151]:25202 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726383AbfJTP75 (ORCPT ); Sun, 20 Oct 2019 11:59:57 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Oct 2019 08:59:56 -0700 X-IronPort-AV: E=Sophos;i="5.67,320,1566889200"; d="scan'208";a="222236155" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.157]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Oct 2019 08:59:56 -0700 From: ira.weiny@intel.com To: linux-kernel@vger.kernel.org Cc: Ira Weiny , Alexander Viro , "Darrick J. Wong" , Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jan Kara , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 2/5] fs/xfs: Isolate the physical DAX flag from effective Date: Sun, 20 Oct 2019 08:59:32 -0700 Message-Id: <20191020155935.12297-3-ira.weiny@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191020155935.12297-1-ira.weiny@intel.com> References: <20191020155935.12297-1-ira.weiny@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Ira Weiny xfs_ioctl_setattr_dax_invalidate() currently checks if the DAX flag is changing as a quick check. But the implementation mixes the physical (XFS_DIFLAG2_DAX) and effective (S_DAX) DAX flags. Remove the use of the effective flag when determining if a change of the physical flag is required. Signed-off-by: Ira Weiny --- fs/xfs/xfs_ioctl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index d58f0d6a699e..0ea326290cca 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -1319,9 +1319,11 @@ xfs_ioctl_setattr_dax_invalidate( } /* If the DAX state is not changing, we have nothing to do here. */ - if ((fa->fsx_xflags & FS_XFLAG_DAX) && IS_DAX(inode)) + if ((fa->fsx_xflags & FS_XFLAG_DAX) && + (ip->i_d.di_flags2 & XFS_DIFLAG2_DAX)) return 0; - if (!(fa->fsx_xflags & FS_XFLAG_DAX) && !IS_DAX(inode)) + if (!(fa->fsx_xflags & FS_XFLAG_DAX) && + !(ip->i_d.di_flags2 & XFS_DIFLAG2_DAX)) return 0; if (S_ISDIR(inode->i_mode)) -- 2.20.1