linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	"Theodore Y. Ts'o" <tytso@mit.edu>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Dan Williams <dan.j.williams@intel.com>,
	Dave Chinner <david@fromorbit.com>,
	Christoph Hellwig <hch@lst.de>, Jeff Moyer <jmoyer@redhat.com>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	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
Date: Thu, 14 May 2020 07:27:37 -0700	[thread overview]
Message-ID: <20200514142737.GD2140786@iweiny-DESK2.sc.intel.com> (raw)
In-Reply-To: <20200514112553.GH9569@quack2.suse.cz>

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 <ira.weiny@intel.com>
> > 
> > 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 <ira.weiny@intel.com>
> > 
> > ---
> > 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 <jack@suse.com>
> SUSE Labs, CR

  reply	other threads:[~2020-05-14 14:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14  6:53 [PATCH V1 0/9] Enable ext4 support for per-file/directory DAX operations ira.weiny
2020-05-14  6:53 ` [PATCH V1 1/9] fs/ext4: Narrow scope of DAX check in setflags ira.weiny
2020-05-14  6:53 ` [PATCH V1 2/9] fs/ext4: Disallow verity if inode is DAX ira.weiny
2020-05-14 10:21   ` Jan Kara
2020-05-14  6:53 ` [PATCH V1 3/9] fs/ext4: Disallow encryption " ira.weiny
2020-05-14 10:23   ` Jan Kara
2020-05-14  6:53 ` [PATCH V1 4/9] fs/ext4: Change EXT4_MOUNT_DAX to EXT4_MOUNT_DAX_ALWAYS ira.weiny
2020-05-14  6:53 ` [PATCH V1 5/9] fs/ext4: Update ext4_should_use_dax() ira.weiny
2020-05-14  6:53 ` [PATCH V1 6/9] fs/ext4: Only change S_DAX on inode load ira.weiny
2020-05-14  6:53 ` [PATCH V1 7/9] fs/ext4: Make DAX mount option a tri-state ira.weiny
2020-05-14 11:25   ` Jan Kara
2020-05-14 14:27     ` Ira Weiny [this message]
2020-05-14 15:08   ` Darrick J. Wong
2020-05-15  3:38     ` Ira Weiny
2020-05-14  6:53 ` [PATCH V1 8/9] fs/ext4: Introduce DAX inode flag ira.weiny
2020-05-14 11:06   ` Jan Kara
2020-05-14  6:53 ` [PATCH V1 9/9] Documentation/dax: Update DAX enablement for ext4 ira.weiny
2020-05-14 11:15   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200514142737.GD2140786@iweiny-DESK2.sc.intel.com \
    --to=ira.weiny@intel.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=dan.j.williams@intel.com \
    --cc=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=jmoyer@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    --subject='Re: [PATCH V1 7/9] fs/ext4: Make DAX mount option a tri-state' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).