Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1262061ybk; Thu, 14 May 2020 04:45:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPbfkoUzPV2aaWo/LHIJm1nXF6UVnhy79e+XE7ZZJCpVPWqOhC+0Hx+Pd83BMop3MLXghq X-Received: by 2002:a17:906:6441:: with SMTP id l1mr3551359ejn.148.1589456721101; Thu, 14 May 2020 04:45:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589456721; cv=none; d=google.com; s=arc-20160816; b=QaKVec+rcq7mLbybHjnB52HX6t2zATgKqgBqYIat9DLbmdu9a4cunEvitabL43xeLq wSED8DixzRLg0BUyKL/jsN4h6rtG3Fiu5VR4dCzW6gGpWta8fhejlcoK/+9mHYBmKb1o Hnj7CKufzCWAuu0oIYaHhL6UhltfoGPRGkQpKqOaEjnpJMm3kJubbJxJTdI8CwdIpcxR getJVJpEs+l/Pf+V5dSd7xcNrIyaDwAWT9iBeywSOYfrc4JKhFPbfXPDmpypRuPY9SgK oLaaAjOR96ZPAt+hLGTmS4dC8CW6OrQmtypZOCeMXPBl7Dufwa348D2wh2c6ckmUATdg 6Ukw== 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=t5lWPbS/SZUNSwGMztOA56x5L/Yq9LrC7auc3JYOxx4=; b=bPZ67yFv+jkPMwyHdju0SZS6aEW8+GqgSgWWO4iEWJH//crxwhNhVYG5KqYvVyalvn EeQWBOWJ6hc8GrJD8QzZ+Na/7gl7/os+xHXDfi2uTvjF9A0ZJuX5O6ozL30zC2NdDcen rLnh79/GRutu6LygjxdbMvLo3GLiF5bhiR20UG5ASn6MHhDbszCKzcdtuOpfZlv4ZJNs Z55SGhW0K6QT0rzQ87lqdoWEawogwoG9adD5JQP3nCPXkiDAA30OPEBCp3ZvOX/EDJyX B2oJ6gG742qBWf5gDZbuQCKJLl9G/AlrYIlApq6LmPC3qwN1qDMcC0Qrx6JqK+K6TM6f 40/A== 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 g15si1828252ejo.520.2020.05.14.04.44.51; Thu, 14 May 2020 04:45:21 -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 S1726098AbgENLnq (ORCPT + 99 others); Thu, 14 May 2020 07:43:46 -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 S1726037AbgENLnq (ORCPT ); Thu, 14 May 2020 07:43:46 -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 705B3ACCE; Thu, 14 May 2020 11:25:57 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id EB8E81E12A8; Thu, 14 May 2020 13:25:53 +0200 (CEST) Date: Thu, 14 May 2020 13:25:53 +0200 From: Jan Kara To: ira.weiny@intel.com Cc: linux-ext4@vger.kernel.org, Andreas Dilger , "Theodore Y. Ts'o" , Jan Kara , 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: <20200514112553.GH9569@quack2.suse.cz> References: <20200514065316.2500078-1-ira.weiny@intel.com> <20200514065316.2500078-8-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200514065316.2500078-8-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 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. Honza -- Jan Kara SUSE Labs, CR