nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	nvdimm@lists.linux.dev, Liu Bo <bo.liu@linux.alibaba.com>,
	Joseqh Qi <joseph.qi@linux.alibaba.com>,
	Liu Jiang <gerry@linux.alibaba.com>
Subject: Re: [RFC PATCH v1.1 2/2] erofs: dax support for non-tailpacking regular file
Date: Fri, 9 Jul 2021 10:28:27 +0800	[thread overview]
Message-ID: <YOe0S+NKUrBi5YZC@B-P7TQMD6M-0146.local> (raw)
In-Reply-To: <20210709014719.GD11634@locust>

Hi Darrick,

On Thu, Jul 08, 2021 at 06:47:19PM -0700, Darrick J. Wong wrote:
> On Mon, Jul 05, 2021 at 09:21:53PM +0800, Gao Xiang wrote:

...

> >  	Opt_cache_strategy,
> > +	Opt_dax,
> >  	Opt_err
> >  };
> >  
> > @@ -370,6 +372,7 @@ static const struct fs_parameter_spec erofs_fs_parameters[] = {
> >  	fsparam_flag_no("acl",		Opt_acl),
> >  	fsparam_enum("cache_strategy",	Opt_cache_strategy,
> >  		     erofs_param_cache_strategy),
> > +	fsparam_flag("dax",             Opt_dax),
> >  	{}
> >  };
> >  
> > @@ -410,6 +413,14 @@ static int erofs_fc_parse_param(struct fs_context *fc,
> >  		ctx->cache_strategy = result.uint_32;
> >  #else
> >  		errorfc(fc, "compression not supported, cache_strategy ignored");
> > +#endif
> > +		break;
> > +	case Opt_dax:
> > +#ifdef CONFIG_FS_DAX
> > +		warnfc(fc, "DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
> > +		set_opt(ctx, DAX);
> 
> You might want to allow 'dax=always' and 'dax=never' to maintain parity
> with xfs/ext4's mount options...

Yeah, thanks for your suggestion. Will revise in the next version..

(Also, more use case details and development status about this scenario
 will be shown in the following months...)

Thanks,
Gao Xiang


> 
> --D
> 
> > +#else
> > +		errorfc(fc, "dax options not supported");
> >  #endif
> >  		break;
> >  	default:
> > @@ -496,10 +507,17 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
> >  		return -ENOMEM;
> >  
> >  	sb->s_fs_info = sbi;
> > +	sbi->dax_dev = fs_dax_get_by_bdev(sb->s_bdev);
> >  	err = erofs_read_superblock(sb);
> >  	if (err)
> >  		return err;
> >  
> > +	if (test_opt(ctx, DAX) &&
> > +	    !bdev_dax_supported(sb->s_bdev, EROFS_BLKSIZ)) {
> > +		errorfc(fc, "DAX unsupported by block device. Turning off DAX.");
> > +		clear_opt(ctx, DAX);
> > +	}
> > +
> >  	sb->s_flags |= SB_RDONLY | SB_NOATIME;
> >  	sb->s_maxbytes = MAX_LFS_FILESIZE;
> >  	sb->s_time_gran = 1;
> > @@ -609,6 +627,8 @@ static void erofs_kill_sb(struct super_block *sb)
> >  	sbi = EROFS_SB(sb);
> >  	if (!sbi)
> >  		return;
> > +	if (sbi->dax_dev)
> > +		fs_put_dax(sbi->dax_dev);
> >  	kfree(sbi);
> >  	sb->s_fs_info = NULL;
> >  }
> > @@ -711,8 +731,8 @@ static int erofs_statfs(struct dentry *dentry, struct kstatfs *buf)
> >  
> >  static int erofs_show_options(struct seq_file *seq, struct dentry *root)
> >  {
> > -	struct erofs_sb_info *sbi __maybe_unused = EROFS_SB(root->d_sb);
> > -	struct erofs_fs_context *ctx __maybe_unused = &sbi->ctx;
> > +	struct erofs_sb_info *sbi = EROFS_SB(root->d_sb);
> > +	struct erofs_fs_context *ctx = &sbi->ctx;
> >  
> >  #ifdef CONFIG_EROFS_FS_XATTR
> >  	if (test_opt(ctx, XATTR_USER))
> > @@ -734,6 +754,8 @@ static int erofs_show_options(struct seq_file *seq, struct dentry *root)
> >  	else if (ctx->cache_strategy == EROFS_ZIP_CACHE_READAROUND)
> >  		seq_puts(seq, ",cache_strategy=readaround");
> >  #endif
> > +	if (test_opt(ctx, DAX))
> > +		seq_puts(seq, ",dax");
> >  	return 0;
> >  }
> >  
> > -- 
> > 2.24.4
> > 

      reply	other threads:[~2021-07-09  2:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-04 13:50 [RFC PATCH 0/2] erofs: dio/dax support for non-tailpacking cases Gao Xiang
2021-07-04 13:50 ` [RFC PATCH 1/2] erofs: iomap support for non-tailpacking DIO Gao Xiang
2021-07-04 13:50 ` [RFC PATCH 2/2] erofs: dax support for non-tailpacking regular file Gao Xiang
2021-07-05 13:21   ` [RFC PATCH v1.1 " Gao Xiang
2021-07-09  1:47     ` Darrick J. Wong
2021-07-09  2:28       ` Gao Xiang [this message]

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=YOe0S+NKUrBi5YZC@B-P7TQMD6M-0146.local \
    --to=hsiangkao@linux.alibaba.com \
    --cc=bo.liu@linux.alibaba.com \
    --cc=djwong@kernel.org \
    --cc=gerry@linux.alibaba.com \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).