From patchwork Tue Apr 14 04:00:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 11486683 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C73181 for ; Tue, 14 Apr 2020 04:02:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0574F206E9 for ; Tue, 14 Apr 2020 04:02:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726026AbgDNEAq (ORCPT ); Tue, 14 Apr 2020 00:00:46 -0400 Received: from mga05.intel.com ([192.55.52.43]:10159 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725969AbgDNEAp (ORCPT ); Tue, 14 Apr 2020 00:00:45 -0400 IronPort-SDR: n7qG6CpYfVz+IpBVBF5k1pcixAsUCzTY5plhvl4eNR7cW/5KEeYSoARzvmOqhyfuwYStarItTL dZ6ZEb0IGAiw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 21:00:44 -0700 IronPort-SDR: wzMZlJ/Q19YijhjzIs2z3E9yo9di0OJtxkis751KDV6ZLBOGaD4iBjotn+5V1BIlvIgfF2vWpq 0O3Th7MwCjPA== X-IronPort-AV: E=Sophos;i="5.72,381,1580803200"; d="scan'208";a="454432511" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 21:00:44 -0700 From: ira.weiny@intel.com To: linux-kernel@vger.kernel.org, Jan Kara Cc: Ira Weiny , "Darrick J. Wong" , Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jeff Moyer , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH RFC 1/8] fs/ext4: Narrow scope of DAX check in setflags Date: Mon, 13 Apr 2020 21:00:23 -0700 Message-Id: <20200414040030.1802884-2-ira.weiny@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200414040030.1802884-1-ira.weiny@intel.com> References: <20200414040030.1802884-1-ira.weiny@intel.com> MIME-Version: 1.0 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Ira Weiny When preventing DAX and journaling on an inode. Use the effective DAX check rather than the mount option. This will be required to support per inode DAX flags. Signed-off-by: Ira Weiny Reviewed-by: Jan Kara --- fs/ext4/ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index a0ec750018dd..ee3401a32e79 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -405,9 +405,9 @@ static int ext4_ioctl_setflags(struct inode *inode, if ((jflag ^ oldflags) & (EXT4_JOURNAL_DATA_FL)) { /* * Changes to the journaling mode can cause unsafe changes to - * S_DAX if we are using the DAX mount option. + * S_DAX if the inode is DAX */ - if (test_opt(inode->i_sb, DAX)) { + if (IS_DAX(inode)) { err = -EBUSY; goto flags_out; }