Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp69617ybr; Fri, 22 May 2020 00:59:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzuAJxnSm9z7NYXMzqzA3BPerH7x6DXj1lU98UyPoMbdLDM9jmtEj6zBXwFoCUxcesbAYd X-Received: by 2002:a17:906:c7cc:: with SMTP id dc12mr7166755ejb.263.1590134344294; Fri, 22 May 2020 00:59:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590134344; cv=none; d=google.com; s=arc-20160816; b=bKQOSsbLLQ4j/4rTj8qUVCTfr8xWl3+2rzVDQEp+xW4C9B/+jghvNC5pKi4SNaYPC+ qjkO8nix9NdVMcbwG/Bld5XuV68EfHKOJkaPopGmE0vY7kWrpHKJbLpY1Ti42Z+Tkix9 siX1M62zg0s37rJ21IVQ8c+CXZVaCNMqyqsWH4lbEhsTU7aHdodh6mng+2hNljXfG4yy YzDb0XbNxebiBSpM+WubsXWOx4qYedrhH2ULzzl88Ru7etTS28IEj1TPz4MRO74JWXLU JokaPTbE+J3KHZ4UgzBE77QZD6449GLaYAapeU7gFpisqFWoan99ybBB9KfwWezxDcA7 u0wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=r4EmlXb99m3wQzCUr5t+sJa7Cwct/D+KkombiLZYztk=; b=ttH0gDK/bjM7C3XBV6C6psMO295c3C63K7HkAhPe1jKc1zqmWG2PgGN63i1PFzkkRE dyU9d1rFqjio6TVhzmktfuLzmGJY3nVN6FC08JXhnU/yc5sDbFZx/457dGt8vXL4aSd5 jIWLmJkCgp+N27zS6+PFr3tWeuYQV2uO/q6j+QPt8sHNigcqHXaBN58epYMzQbEBPAST pEki6aBWqhyqPKZRfiGbFb8DIpl2FDbdvEojbgxsTIr2H6BPq1fVopheiZDrBJvQxPaD 2HDa00RK9LzbwHF19NpTen91wqmhqChf2eOiE7zbEu5RiSNbhQwDP0uAJEX1igRGUpAl C/KA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v19si4324531edq.603.2020.05.22.00.58.33; Fri, 22 May 2020 00:59:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728657AbgEVH6W (ORCPT + 99 others); Fri, 22 May 2020 03:58:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:48506 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728371AbgEVH6W (ORCPT ); Fri, 22 May 2020 03:58:22 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2E296BBA0; Fri, 22 May 2020 07:58:23 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 997881E126B; Fri, 22 May 2020 09:58:19 +0200 (CEST) Date: Fri, 22 May 2020 09:58:19 +0200 From: Jan Kara To: ira.weiny@intel.com Cc: linux-ext4@vger.kernel.org, Andreas Dilger , "Theodore Y. Ts'o" , Jan Kara , Eric Biggers , Al Viro , Dan Williams , Dave Chinner , Christoph Hellwig , Jeff Moyer , "Darrick J. Wong" , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V4 1/8] fs/ext4: Narrow scope of DAX check in setflags Message-ID: <20200522075819.GA14199@quack2.suse.cz> References: <20200521191313.261929-1-ira.weiny@intel.com> <20200521191313.261929-2-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521191313.261929-2-ira.weiny@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu 21-05-20 12:13:06, ira.weiny@intel.com wrote: > 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. > > Reviewed-by: Jan Kara > Signed-off-by: Ira Weiny ... > diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c > index bfc1281fc4cb..5813e5e73eab 100644 > --- a/fs/ext4/ioctl.c > +++ b/fs/ext4/ioctl.c > @@ -393,9 +393,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; > } Now one problem popped up in my mind: We should also make EXT4_JOURNAL_DATA_FL and EXT4_DAX_FL exclusive so that both cannot be turned on at the same time. And IS_DAX() check isn't enough for that. Sorry for not noticing earlier... it's like peeling an onion... Honza -- Jan Kara SUSE Labs, CR