Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp224517pxv; Thu, 8 Jul 2021 19:32:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/5BAe0zjBHAepXgACSAfAu7va6yOHERUXR5WlZ7n2mVx4nwn5UH1wSiRrr5DXusLzAeqO X-Received: by 2002:a05:6402:1bd0:: with SMTP id ch16mr16020298edb.215.1625797931457; Thu, 08 Jul 2021 19:32:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625797931; cv=none; d=google.com; s=arc-20160816; b=MThzJpyrwk83/q4Ef/LOw0uaIS9tEucz/doJ/MerigqPE+kcZRWlPJWnyZDsphQSgX nbzEUBSJ8JoDXLaIowmvpNlvqsCyLyTv1ef6rUGDL5TFFIa1b/ml4bqQwM26CzSqWZt9 1HQpHbeqNXK8mwMhkuZ7Q07JSyuG2KEtbaxALSLAxMjdNtPkjKfBVM31nPU/Jr+9yG5w JwlbdO3iZP96H1To8wlannzrhKSZFIHzjMict+JpfkwT4RZR+DxENyUjy2XktIi8/3z9 bEPez8gCNB0ixepbbi2wgWQ/A8qQhIzZXDJ9RAR7KsEhkTSBquWqsnQnf5dQBzlOfqoI QQ0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date; bh=Av6hGJN/50xz7ZQLf00eGYHLl0wt/C+jMGa6ga2wAr4=; b=t+CynmZqXL3afB5zCiiqjW6JJtIrfVK6kOM+M4tVg62SYBeWLDhdOkU9ttdn3k0APU LNUH992WDUVp0cq8Uq3lrzYoZBPs6eSIQeueUTKwDzpDEHcaIWJMQn/U7Slrw1dVUIPD Y27oCDyocxNkyvHtpcggdkt6bVpGiKxrRAgA5KsI1aMjp5hXAIZv0hRZR+8ByD5NasRU YfCD1ixPkoM0l8naG0EvFG5uOtWh+Vfe/gbqz5GfQs4fQ0tAkgGmcq1mywFeDlSWj1Py 1UNvkLGgrB2w/NnKGwhe9TC6EJTi+p/I8AmlELBa1rEoLqOenS5bm/OeXfx4Jy2rhn91 Dhpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga14si40594ejc.427.2021.07.08.19.31.46; Thu, 08 Jul 2021 19:32:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230412AbhGICbP (ORCPT + 99 others); Thu, 8 Jul 2021 22:31:15 -0400 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:36003 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbhGICbO (ORCPT ); Thu, 8 Jul 2021 22:31:14 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0Uf9kTmr_1625797708; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0Uf9kTmr_1625797708) by smtp.aliyun-inc.com(127.0.0.1); Fri, 09 Jul 2021 10:28:30 +0800 Date: Fri, 9 Jul 2021 10:28:27 +0800 From: Gao Xiang To: "Darrick J. Wong" Cc: linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, LKML , nvdimm@lists.linux.dev, Liu Bo , Joseqh Qi , Liu Jiang Subject: Re: [RFC PATCH v1.1 2/2] erofs: dax support for non-tailpacking regular file Message-ID: Mail-Followup-To: "Darrick J. Wong" , linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, LKML , nvdimm@lists.linux.dev, Liu Bo , Joseqh Qi , Liu Jiang References: <20210704135056.42723-3-hsiangkao@linux.alibaba.com> <20210705132153.223839-1-hsiangkao@linux.alibaba.com> <20210709014719.GD11634@locust> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210709014719.GD11634@locust> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > >