Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1373643ybk; Thu, 14 May 2020 07:28:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1o+uxtQboLUZAXPOugvFtt4IFJE3cfH/n+DeMw8VK+S4RVH5okcYugA/FLgk8cQe7A61U X-Received: by 2002:aa7:d1cc:: with SMTP id g12mr4389194edp.84.1589466492061; Thu, 14 May 2020 07:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589466492; cv=none; d=google.com; s=arc-20160816; b=DN3h2lqQwZZ4neurmp8Je0f1jnVWrQ29qjF0UjqQV8D2R+5Jhgy2ODNUxa9LfOCqSl GQGViTivtVxLy7GZjXBbzwuEsvMSaDD4HXw6BAGbWZzcUfw6+4pPYu2grBub0oMyLFS4 S4QAmC+9p6eSmDF44z2p9XEkI/S7dgiwf7P171ckQPSAep1Y+45TeY75Xcn0BYRWoyqg sxMZ7OgMW52bx56O+Smn2p0dX/Mt84vUYeKDp2pXKQfNXSUDEsY+dcuB473OexkQ5BTS XF4xeuSns7Yv1ZBUO+yvbK11t8FBzxVhrWU3e65fm3b9WBObwqU5JDwJSvURE3YF46fk E6JA== 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:ironport-sdr:ironport-sdr; bh=Zko8Q+1MEsI+5GsNkvUiaM2Jg+mtAW1F/+7ShAvhaVU=; b=C0y1nCvcdca2pehTcux1EA03Y7d8aCKV5ZpI6d2JcPzxAV/cjOnNyebzmMBKDLlvam AMO1MfkAPSK2EsLbhQG1mar55l+mu0rqYUZhBFAd2Ic5iztghOjpujSOQ8kdv0IvTB1Z C/hBMu+t6+J0h4iwBC3v8uFuE9eLYF4VfKYM47cG3NFQmF/HMCAP/F/hqIMhDsYh1xs7 rColga8IBAinM8eewN3/2o71uU29xz4Nu2xu4m1/VUAEjHoHx1z4ONdL+BQeE0LYKxUk hkO0xdHEKQ21QB2TzB/h7GayIFd5fMXSB2WTKYQgBaMGWeThatXMAiiuVSCt65xcHYrR 5+VA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si2076419eja.72.2020.05.14.07.27.47; Thu, 14 May 2020 07:28:12 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726066AbgENO1j (ORCPT + 99 others); Thu, 14 May 2020 10:27:39 -0400 Received: from mga04.intel.com ([192.55.52.120]:58372 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726051AbgENO1j (ORCPT ); Thu, 14 May 2020 10:27:39 -0400 IronPort-SDR: fGbLIVfGazk4DGQXY6UjnGqkTI5ht3f/JLUjcgn8wQ++HfSqCIT//5iEo6wd+heWrvMT0izTUH OpyrnBvRwI3Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2020 07:27:38 -0700 IronPort-SDR: GsJfjc4+wbQgYEdA7VycLrHz0AEfQpXpVVnHsViQIGodnrgeqcvY6S4ejn08z0TAcDQNXtedAf TM7x1TIgeUAg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,391,1583222400"; d="scan'208";a="437926254" Received: from iweiny-desk2.sc.intel.com ([10.3.52.147]) by orsmga005.jf.intel.com with ESMTP; 14 May 2020 07:27:37 -0700 Date: Thu, 14 May 2020 07:27:37 -0700 From: Ira Weiny To: Jan Kara Cc: linux-ext4@vger.kernel.org, Andreas Dilger , "Theodore Y. Ts'o" , 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 V1 7/9] fs/ext4: Make DAX mount option a tri-state Message-ID: <20200514142737.GD2140786@iweiny-DESK2.sc.intel.com> References: <20200514065316.2500078-1-ira.weiny@intel.com> <20200514065316.2500078-8-ira.weiny@intel.com> <20200514112553.GH9569@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200514112553.GH9569@quack2.suse.cz> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, May 14, 2020 at 01:25:53PM +0200, Jan Kara wrote: > On Wed 13-05-20 23:53:13, ira.weiny@intel.com wrote: > > From: Ira Weiny > > > > We add 'always', 'never', and 'inode' (default). '-o dax' continue to > > operate the same. > > > > Specifically we introduce a 2nd DAX mount flag EXT4_MOUNT2_DAX_NEVER and set > > it and EXT4_MOUNT_DAX_ALWAYS appropriately. > > > > We also force EXT4_MOUNT2_DAX_NEVER if !CONFIG_FS_DAX. > > > > https://lore.kernel.org/lkml/20200405061945.GA94792@iweiny-DESK2.sc.intel.com/ > > > > Signed-off-by: Ira Weiny > > > > --- > > Changes from RFC: > > Combine remount check for DAX_NEVER with DAX_ALWAYS > > Update ext4_should_enable_dax() > > ... > > > @@ -2076,13 +2079,32 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token, > > } > > sbi->s_jquota_fmt = m->mount_opt; > > #endif > > - } else if (token == Opt_dax) { > > + } else if (token == Opt_dax || token == Opt_dax_str) { > > #ifdef CONFIG_FS_DAX > > - ext4_msg(sb, KERN_WARNING, > > - "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); > > - sbi->s_mount_opt |= m->mount_opt; > > + char *tmp = match_strdup(&args[0]); > > + > > + if (!tmp || !strcmp(tmp, "always")) { > > + ext4_msg(sb, KERN_WARNING, > > + "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); > > + sbi->s_mount_opt |= EXT4_MOUNT_DAX_ALWAYS; > > + sbi->s_mount_opt2 &= ~EXT4_MOUNT2_DAX_NEVER; > > + } else if (!strcmp(tmp, "never")) { > > + sbi->s_mount_opt2 |= EXT4_MOUNT2_DAX_NEVER; > > + sbi->s_mount_opt &= ~EXT4_MOUNT_DAX_ALWAYS; > > + } else if (!strcmp(tmp, "inode")) { > > + sbi->s_mount_opt &= ~EXT4_MOUNT_DAX_ALWAYS; > > + sbi->s_mount_opt2 &= ~EXT4_MOUNT2_DAX_NEVER; > > + } else { > > + ext4_msg(sb, KERN_WARNING, "DAX invalid option."); > > + kfree(tmp); > > + return -1; > > + } > > + > > + kfree(tmp); > > As I wrote in my reply to previous version of this patch, I'd prefer if we > handled this like e.g. 'data=' mount option. I don't think any unification > in option parsing with XFS makes sence and I'd rather keep consistent how > ext4 handles these 'enum' options. Ok... I'm sorry I'll change this. Thanks for all the reviews! Ira > > Honza > > -- > Jan Kara > SUSE Labs, CR