linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] xfsprogs: various small enhancements
@ 2020-08-13 23:27 Darrick J. Wong
  2020-08-13 23:27 ` [PATCH 1/4] xfs_db: fix nlink usage in check Darrick J. Wong
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Darrick J. Wong @ 2020-08-13 23:27 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: Eric Sandeen, linux-xfs

Hi all,

This short series contains a couple of enhancements.  The first patch
fixes a bug in xfs_check that we introduced during the 5.8 resync.  The
second patch allows administrators to set the DAX inode flag on the
entire filesystem at format time.  There's also manpage updates and
xfs_db support for the dax inode flag!

In v2 we add some more documentation updates and tweaks suggested by the
maintainer.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=xfsprogs-5.8-fixes
---
 db/check.c          |    4 ++--
 db/inode.c          |    3 +++
 man/man8/mkfs.xfs.8 |   22 ++++++++++++++++++----
 mkfs/xfs_mkfs.c     |   14 ++++++++++++++
 4 files changed, 37 insertions(+), 6 deletions(-)


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/4] xfs_db: fix nlink usage in check
  2020-08-13 23:27 [PATCH v2 0/4] xfsprogs: various small enhancements Darrick J. Wong
@ 2020-08-13 23:27 ` Darrick J. Wong
  2020-08-17  6:53   ` Christoph Hellwig
  2020-08-17 11:25   ` Carlos Maiolino
  2020-08-13 23:27 ` [PATCH 2/4] xfs_db: report the inode dax flag Darrick J. Wong
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 15+ messages in thread
From: Darrick J. Wong @ 2020-08-13 23:27 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: Eric Sandeen, linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

process_inode uses a local convenience variable to abstract the
differences between the ondisk nlink fields in a v1 inode and a v2
inode.  Use this variable for checking and reporting errors.

Fixes: 6526f30e4801 ("xfs_db: stop misusing an onstack inode")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
---
 db/check.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


diff --git a/db/check.c b/db/check.c
index c2233a0d1ba7..ef0e82d4efa1 100644
--- a/db/check.c
+++ b/db/check.c
@@ -2797,10 +2797,10 @@ process_inode(
 					be64_to_cpu(dip->di_nblocks), ino);
 			error++;
 		}
-		if (dip->di_nlink != 0) {
+		if (nlink != 0) {
 			if (v)
 				dbprintf(_("bad nlink %d for free inode %lld\n"),
-					be32_to_cpu(dip->di_nlink), ino);
+					nlink, ino);
 			error++;
 		}
 		if (dip->di_mode != 0) {


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/4] xfs_db: report the inode dax flag
  2020-08-13 23:27 [PATCH v2 0/4] xfsprogs: various small enhancements Darrick J. Wong
  2020-08-13 23:27 ` [PATCH 1/4] xfs_db: fix nlink usage in check Darrick J. Wong
@ 2020-08-13 23:27 ` Darrick J. Wong
  2020-08-17  6:53   ` Christoph Hellwig
  2020-08-17 11:26   ` Carlos Maiolino
  2020-08-13 23:27 ` [PATCH 3/4] man: update mkfs.xfs inode flag option documentation Darrick J. Wong
  2020-08-13 23:27 ` [PATCH 4/4] mkfs: allow setting dax flag on root directory Darrick J. Wong
  3 siblings, 2 replies; 15+ messages in thread
From: Darrick J. Wong @ 2020-08-13 23:27 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Report the inode DAX flag when we're printing an inode, just like we do
for other v3 inode flags.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 db/inode.c |    3 +++
 1 file changed, 3 insertions(+)


diff --git a/db/inode.c b/db/inode.c
index 3ae5d18f9887..f13150c96aa9 100644
--- a/db/inode.c
+++ b/db/inode.c
@@ -172,6 +172,9 @@ const field_t	inode_v3_flds[] = {
 	{ "cowextsz", FLDT_UINT1,
 	  OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_COWEXTSIZE_BIT-1), C1,
 	  0, TYP_NONE },
+	{ "dax", FLDT_UINT1,
+	  OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_DAX_BIT - 1), C1,
+	  0, TYP_NONE },
 	{ NULL }
 };
 


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/4] man: update mkfs.xfs inode flag option documentation
  2020-08-13 23:27 [PATCH v2 0/4] xfsprogs: various small enhancements Darrick J. Wong
  2020-08-13 23:27 ` [PATCH 1/4] xfs_db: fix nlink usage in check Darrick J. Wong
  2020-08-13 23:27 ` [PATCH 2/4] xfs_db: report the inode dax flag Darrick J. Wong
@ 2020-08-13 23:27 ` Darrick J. Wong
  2020-08-17  6:54   ` Christoph Hellwig
  2020-08-17 11:27   ` Carlos Maiolino
  2020-08-13 23:27 ` [PATCH 4/4] mkfs: allow setting dax flag on root directory Darrick J. Wong
  3 siblings, 2 replies; 15+ messages in thread
From: Darrick J. Wong @ 2020-08-13 23:27 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

The mkfs manpage says that the extent size, cow extent size, realtime,
and project id inheritance bits are passed on to "newly created
children".  This isn't technically true -- it's only passed on to newly
created regular files and directories.  It is not passed on to special
files.

Fix this minor inaccuracy in the documentation.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 man/man8/mkfs.xfs.8 |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)


diff --git a/man/man8/mkfs.xfs.8 b/man/man8/mkfs.xfs.8
index 9d762a43011a..7d3f3552ff12 100644
--- a/man/man8/mkfs.xfs.8
+++ b/man/man8/mkfs.xfs.8
@@ -285,7 +285,8 @@ Set the copy-on-write extent size hint on all inodes created by
 .BR mkfs.xfs "."
 The value must be provided in units of filesystem blocks.
 If the value is zero, the default value (currently 32 blocks) will be used.
-Directories will pass on this hint to newly created children.
+Directories will pass on this hint to newly created regular files and
+directories.
 .TP
 .BI name= value
 This can be used to specify the name of the special file containing
@@ -380,20 +381,23 @@ this information.
 If set, all inodes created by
 .B mkfs.xfs
 will be created with the realtime flag set.
-Directories will pass on this flag to newly created children.
+Directories will pass on this flag to newly created regular files and
+directories.
 .TP
 .BI projinherit= value
 All inodes created by
 .B mkfs.xfs
 will be assigned this project quota id.
-Directories will pass on the project id to newly created children.
+Directories will pass on the project id to newly created regular files and
+directories.
 .TP
 .BI extszinherit= value
 All inodes created by
 .B mkfs.xfs
 will have this extent size hint applied.
 The value must be provided in units of filesystem blocks.
-Directories will pass on this hint to newly created children.
+Directories will pass on this hint to newly created regular files and
+directories.
 .RE
 .TP
 .B \-f


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 4/4] mkfs: allow setting dax flag on root directory
  2020-08-13 23:27 [PATCH v2 0/4] xfsprogs: various small enhancements Darrick J. Wong
                   ` (2 preceding siblings ...)
  2020-08-13 23:27 ` [PATCH 3/4] man: update mkfs.xfs inode flag option documentation Darrick J. Wong
@ 2020-08-13 23:27 ` Darrick J. Wong
  2020-08-17  6:54   ` Christoph Hellwig
                     ` (2 more replies)
  3 siblings, 3 replies; 15+ messages in thread
From: Darrick J. Wong @ 2020-08-13 23:27 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Teach mkfs to set the DAX flag on the root directory so that all new
files can be created in dax mode.  This is a complement to removing the
mount option.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 man/man8/mkfs.xfs.8 |   10 ++++++++++
 mkfs/xfs_mkfs.c     |   14 ++++++++++++++
 2 files changed, 24 insertions(+)


diff --git a/man/man8/mkfs.xfs.8 b/man/man8/mkfs.xfs.8
index 7d3f3552ff12..3ad9e5449f58 100644
--- a/man/man8/mkfs.xfs.8
+++ b/man/man8/mkfs.xfs.8
@@ -398,6 +398,16 @@ will have this extent size hint applied.
 The value must be provided in units of filesystem blocks.
 Directories will pass on this hint to newly created regular files and
 directories.
+.TP
+.BI daxinherit= value
+If set, all inodes created by
+.B mkfs.xfs
+will be created with the DAX flag set.
+Directories will pass on this flag on to newly created regular files
+and directories.
+By default,
+.B mkfs.xfs
+will not enable DAX mode.
 .RE
 .TP
 .B \-f
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 2e6cd280e388..a687f385a9c1 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -60,6 +60,7 @@ enum {
 	D_PROJINHERIT,
 	D_EXTSZINHERIT,
 	D_COWEXTSIZE,
+	D_DAXINHERIT,
 	D_MAX_OPTS,
 };
 
@@ -254,6 +255,7 @@ static struct opt_params dopts = {
 		[D_PROJINHERIT] = "projinherit",
 		[D_EXTSZINHERIT] = "extszinherit",
 		[D_COWEXTSIZE] = "cowextsize",
+		[D_DAXINHERIT] = "daxinherit",
 	},
 	.subopt_params = {
 		{ .index = D_AGCOUNT,
@@ -369,6 +371,12 @@ static struct opt_params dopts = {
 		  .maxval = UINT_MAX,
 		  .defaultval = SUBOPT_NEEDS_VAL,
 		},
+		{ .index = D_DAXINHERIT,
+		  .conflicts = { { NULL, LAST_CONFLICT } },
+		  .minval = 0,
+		  .maxval = 1,
+		  .defaultval = 1,
+		},
 	},
 };
 
@@ -1434,6 +1442,12 @@ data_opts_parser(
 		cli->fsx.fsx_cowextsize = getnum(value, opts, subopt);
 		cli->fsx.fsx_xflags |= FS_XFLAG_COWEXTSIZE;
 		break;
+	case D_DAXINHERIT:
+		if (getnum(value, opts, subopt))
+			cli->fsx.fsx_xflags |= FS_XFLAG_DAX;
+		else
+			cli->fsx.fsx_xflags &= ~FS_XFLAG_DAX;
+		break;
 	default:
 		return -EINVAL;
 	}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/4] xfs_db: fix nlink usage in check
  2020-08-13 23:27 ` [PATCH 1/4] xfs_db: fix nlink usage in check Darrick J. Wong
@ 2020-08-17  6:53   ` Christoph Hellwig
  2020-08-17 11:25   ` Carlos Maiolino
  1 sibling, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2020-08-17  6:53 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: sandeen, Eric Sandeen, linux-xfs

On Thu, Aug 13, 2020 at 04:27:22PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> process_inode uses a local convenience variable to abstract the
> differences between the ondisk nlink fields in a v1 inode and a v2
> inode.  Use this variable for checking and reporting errors.

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/4] xfs_db: report the inode dax flag
  2020-08-13 23:27 ` [PATCH 2/4] xfs_db: report the inode dax flag Darrick J. Wong
@ 2020-08-17  6:53   ` Christoph Hellwig
  2020-08-17 11:26   ` Carlos Maiolino
  1 sibling, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2020-08-17  6:53 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: sandeen, linux-xfs

On Thu, Aug 13, 2020 at 04:27:29PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Report the inode DAX flag when we're printing an inode, just like we do
> for other v3 inode flags.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/4] man: update mkfs.xfs inode flag option documentation
  2020-08-13 23:27 ` [PATCH 3/4] man: update mkfs.xfs inode flag option documentation Darrick J. Wong
@ 2020-08-17  6:54   ` Christoph Hellwig
  2020-08-17 11:27   ` Carlos Maiolino
  1 sibling, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2020-08-17  6:54 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: sandeen, linux-xfs

On Thu, Aug 13, 2020 at 04:27:35PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> The mkfs manpage says that the extent size, cow extent size, realtime,
> and project id inheritance bits are passed on to "newly created
> children".  This isn't technically true -- it's only passed on to newly
> created regular files and directories.  It is not passed on to special
> files.
> 
> Fix this minor inaccuracy in the documentation.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/4] mkfs: allow setting dax flag on root directory
  2020-08-13 23:27 ` [PATCH 4/4] mkfs: allow setting dax flag on root directory Darrick J. Wong
@ 2020-08-17  6:54   ` Christoph Hellwig
  2020-08-17 11:30   ` Carlos Maiolino
  2020-08-17 15:43   ` [PATCH v2 " Darrick J. Wong
  2 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2020-08-17  6:54 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: sandeen, linux-xfs

On Thu, Aug 13, 2020 at 04:27:44PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Teach mkfs to set the DAX flag on the root directory so that all new
> files can be created in dax mode.  This is a complement to removing the
> mount option.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/4] xfs_db: fix nlink usage in check
  2020-08-13 23:27 ` [PATCH 1/4] xfs_db: fix nlink usage in check Darrick J. Wong
  2020-08-17  6:53   ` Christoph Hellwig
@ 2020-08-17 11:25   ` Carlos Maiolino
  1 sibling, 0 replies; 15+ messages in thread
From: Carlos Maiolino @ 2020-08-17 11:25 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: sandeen, Eric Sandeen, linux-xfs

On Thu, Aug 13, 2020 at 04:27:22PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> process_inode uses a local convenience variable to abstract the
> differences between the ondisk nlink fields in a v1 inode and a v2
> inode.  Use this variable for checking and reporting errors.
> 
> Fixes: 6526f30e4801 ("xfs_db: stop misusing an onstack inode")
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> ---
>  db/check.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)


Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>


> 
> 
> diff --git a/db/check.c b/db/check.c
> index c2233a0d1ba7..ef0e82d4efa1 100644
> --- a/db/check.c
> +++ b/db/check.c
> @@ -2797,10 +2797,10 @@ process_inode(
>  					be64_to_cpu(dip->di_nblocks), ino);
>  			error++;
>  		}
> -		if (dip->di_nlink != 0) {
> +		if (nlink != 0) {
>  			if (v)
>  				dbprintf(_("bad nlink %d for free inode %lld\n"),
> -					be32_to_cpu(dip->di_nlink), ino);
> +					nlink, ino);
>  			error++;
>  		}
>  		if (dip->di_mode != 0) {
> 

-- 
Carlos


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/4] xfs_db: report the inode dax flag
  2020-08-13 23:27 ` [PATCH 2/4] xfs_db: report the inode dax flag Darrick J. Wong
  2020-08-17  6:53   ` Christoph Hellwig
@ 2020-08-17 11:26   ` Carlos Maiolino
  1 sibling, 0 replies; 15+ messages in thread
From: Carlos Maiolino @ 2020-08-17 11:26 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: sandeen, linux-xfs

On Thu, Aug 13, 2020 at 04:27:29PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Report the inode DAX flag when we're printing an inode, just like we do
> for other v3 inode flags.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  db/inode.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> 
> diff --git a/db/inode.c b/db/inode.c
> index 3ae5d18f9887..f13150c96aa9 100644
> --- a/db/inode.c
> +++ b/db/inode.c
> @@ -172,6 +172,9 @@ const field_t	inode_v3_flds[] = {
>  	{ "cowextsz", FLDT_UINT1,
>  	  OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_COWEXTSIZE_BIT-1), C1,
>  	  0, TYP_NONE },
> +	{ "dax", FLDT_UINT1,
> +	  OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_DAX_BIT - 1), C1,
> +	  0, TYP_NONE },
>  	{ NULL }

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

>  };
>  
> 

-- 
Carlos


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/4] man: update mkfs.xfs inode flag option documentation
  2020-08-13 23:27 ` [PATCH 3/4] man: update mkfs.xfs inode flag option documentation Darrick J. Wong
  2020-08-17  6:54   ` Christoph Hellwig
@ 2020-08-17 11:27   ` Carlos Maiolino
  1 sibling, 0 replies; 15+ messages in thread
From: Carlos Maiolino @ 2020-08-17 11:27 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: sandeen, linux-xfs

On Thu, Aug 13, 2020 at 04:27:35PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> The mkfs manpage says that the extent size, cow extent size, realtime,
> and project id inheritance bits are passed on to "newly created
> children".  This isn't technically true -- it's only passed on to newly
> created regular files and directories.  It is not passed on to special
> files.
> 
> Fix this minor inaccuracy in the documentation.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

>  man/man8/mkfs.xfs.8 |   12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> 
> diff --git a/man/man8/mkfs.xfs.8 b/man/man8/mkfs.xfs.8
> index 9d762a43011a..7d3f3552ff12 100644
> --- a/man/man8/mkfs.xfs.8
> +++ b/man/man8/mkfs.xfs.8
> @@ -285,7 +285,8 @@ Set the copy-on-write extent size hint on all inodes created by
>  .BR mkfs.xfs "."
>  The value must be provided in units of filesystem blocks.
>  If the value is zero, the default value (currently 32 blocks) will be used.
> -Directories will pass on this hint to newly created children.
> +Directories will pass on this hint to newly created regular files and
> +directories.
>  .TP
>  .BI name= value
>  This can be used to specify the name of the special file containing
> @@ -380,20 +381,23 @@ this information.
>  If set, all inodes created by
>  .B mkfs.xfs
>  will be created with the realtime flag set.
> -Directories will pass on this flag to newly created children.
> +Directories will pass on this flag to newly created regular files and
> +directories.
>  .TP
>  .BI projinherit= value
>  All inodes created by
>  .B mkfs.xfs
>  will be assigned this project quota id.
> -Directories will pass on the project id to newly created children.
> +Directories will pass on the project id to newly created regular files and
> +directories.
>  .TP
>  .BI extszinherit= value
>  All inodes created by
>  .B mkfs.xfs
>  will have this extent size hint applied.
>  The value must be provided in units of filesystem blocks.
> -Directories will pass on this hint to newly created children.
> +Directories will pass on this hint to newly created regular files and
> +directories.
>  .RE
>  .TP
>  .B \-f
> 

-- 
Carlos


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/4] mkfs: allow setting dax flag on root directory
  2020-08-13 23:27 ` [PATCH 4/4] mkfs: allow setting dax flag on root directory Darrick J. Wong
  2020-08-17  6:54   ` Christoph Hellwig
@ 2020-08-17 11:30   ` Carlos Maiolino
  2020-08-17 15:41     ` Darrick J. Wong
  2020-08-17 15:43   ` [PATCH v2 " Darrick J. Wong
  2 siblings, 1 reply; 15+ messages in thread
From: Carlos Maiolino @ 2020-08-17 11:30 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: sandeen, linux-xfs

On Thu, Aug 13, 2020 at 04:27:44PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Teach mkfs to set the DAX flag on the root directory so that all new
> files can be created in dax mode.  This is a complement to removing the
> mount option.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  man/man8/mkfs.xfs.8 |   10 ++++++++++
>  mkfs/xfs_mkfs.c     |   14 ++++++++++++++
>  2 files changed, 24 insertions(+)
> 
> 
> diff --git a/man/man8/mkfs.xfs.8 b/man/man8/mkfs.xfs.8
> index 7d3f3552ff12..3ad9e5449f58 100644
> --- a/man/man8/mkfs.xfs.8
> +++ b/man/man8/mkfs.xfs.8
> @@ -398,6 +398,16 @@ will have this extent size hint applied.
>  The value must be provided in units of filesystem blocks.
>  Directories will pass on this hint to newly created regular files and
>  directories.
> +.TP
> +.BI daxinherit= value
> +If set, all inodes created by
> +.B mkfs.xfs
> +will be created with the DAX flag set.
> +Directories will pass on this flag on to newly created regular files

I'm not English native speaker, but 'pass on this flag on' looks weird to me,
'pass this flag on' sounds better, but again, I'm no native speaker, and I might
well be just adding noise here :)

Other than that, everything else looks fine.

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

> +and directories.
> +By default,
> +.B mkfs.xfs
> +will not enable DAX mode.
>  .RE
>  .TP
>  .B \-f
> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> index 2e6cd280e388..a687f385a9c1 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -60,6 +60,7 @@ enum {
>  	D_PROJINHERIT,
>  	D_EXTSZINHERIT,
>  	D_COWEXTSIZE,
> +	D_DAXINHERIT,
>  	D_MAX_OPTS,
>  };
>  
> @@ -254,6 +255,7 @@ static struct opt_params dopts = {
>  		[D_PROJINHERIT] = "projinherit",
>  		[D_EXTSZINHERIT] = "extszinherit",
>  		[D_COWEXTSIZE] = "cowextsize",
> +		[D_DAXINHERIT] = "daxinherit",
>  	},
>  	.subopt_params = {
>  		{ .index = D_AGCOUNT,
> @@ -369,6 +371,12 @@ static struct opt_params dopts = {
>  		  .maxval = UINT_MAX,
>  		  .defaultval = SUBOPT_NEEDS_VAL,
>  		},
> +		{ .index = D_DAXINHERIT,
> +		  .conflicts = { { NULL, LAST_CONFLICT } },
> +		  .minval = 0,
> +		  .maxval = 1,
> +		  .defaultval = 1,
> +		},
>  	},
>  };
>  
> @@ -1434,6 +1442,12 @@ data_opts_parser(
>  		cli->fsx.fsx_cowextsize = getnum(value, opts, subopt);
>  		cli->fsx.fsx_xflags |= FS_XFLAG_COWEXTSIZE;
>  		break;
> +	case D_DAXINHERIT:
> +		if (getnum(value, opts, subopt))
> +			cli->fsx.fsx_xflags |= FS_XFLAG_DAX;
> +		else
> +			cli->fsx.fsx_xflags &= ~FS_XFLAG_DAX;
> +		break;
>  	default:
>  		return -EINVAL;
>  	}
> 

-- 
Carlos


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/4] mkfs: allow setting dax flag on root directory
  2020-08-17 11:30   ` Carlos Maiolino
@ 2020-08-17 15:41     ` Darrick J. Wong
  0 siblings, 0 replies; 15+ messages in thread
From: Darrick J. Wong @ 2020-08-17 15:41 UTC (permalink / raw)
  To: sandeen, linux-xfs

On Mon, Aug 17, 2020 at 01:30:45PM +0200, Carlos Maiolino wrote:
> On Thu, Aug 13, 2020 at 04:27:44PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > Teach mkfs to set the DAX flag on the root directory so that all new
> > files can be created in dax mode.  This is a complement to removing the
> > mount option.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  man/man8/mkfs.xfs.8 |   10 ++++++++++
> >  mkfs/xfs_mkfs.c     |   14 ++++++++++++++
> >  2 files changed, 24 insertions(+)
> > 
> > 
> > diff --git a/man/man8/mkfs.xfs.8 b/man/man8/mkfs.xfs.8
> > index 7d3f3552ff12..3ad9e5449f58 100644
> > --- a/man/man8/mkfs.xfs.8
> > +++ b/man/man8/mkfs.xfs.8
> > @@ -398,6 +398,16 @@ will have this extent size hint applied.
> >  The value must be provided in units of filesystem blocks.
> >  Directories will pass on this hint to newly created regular files and
> >  directories.
> > +.TP
> > +.BI daxinherit= value
> > +If set, all inodes created by
> > +.B mkfs.xfs
> > +will be created with the DAX flag set.
> > +Directories will pass on this flag on to newly created regular files
> 
> I'm not English native speaker, but 'pass on this flag on' looks weird to me,
> 'pass this flag on' sounds better, but again, I'm no native speaker, and I might
> well be just adding noise here :)

It /is/ strange, thanks for the correction and the review.

--D

> Other than that, everything else looks fine.
> 
> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
> 
> > +and directories.
> > +By default,
> > +.B mkfs.xfs
> > +will not enable DAX mode.
> >  .RE
> >  .TP
> >  .B \-f
> > diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> > index 2e6cd280e388..a687f385a9c1 100644
> > --- a/mkfs/xfs_mkfs.c
> > +++ b/mkfs/xfs_mkfs.c
> > @@ -60,6 +60,7 @@ enum {
> >  	D_PROJINHERIT,
> >  	D_EXTSZINHERIT,
> >  	D_COWEXTSIZE,
> > +	D_DAXINHERIT,
> >  	D_MAX_OPTS,
> >  };
> >  
> > @@ -254,6 +255,7 @@ static struct opt_params dopts = {
> >  		[D_PROJINHERIT] = "projinherit",
> >  		[D_EXTSZINHERIT] = "extszinherit",
> >  		[D_COWEXTSIZE] = "cowextsize",
> > +		[D_DAXINHERIT] = "daxinherit",
> >  	},
> >  	.subopt_params = {
> >  		{ .index = D_AGCOUNT,
> > @@ -369,6 +371,12 @@ static struct opt_params dopts = {
> >  		  .maxval = UINT_MAX,
> >  		  .defaultval = SUBOPT_NEEDS_VAL,
> >  		},
> > +		{ .index = D_DAXINHERIT,
> > +		  .conflicts = { { NULL, LAST_CONFLICT } },
> > +		  .minval = 0,
> > +		  .maxval = 1,
> > +		  .defaultval = 1,
> > +		},
> >  	},
> >  };
> >  
> > @@ -1434,6 +1442,12 @@ data_opts_parser(
> >  		cli->fsx.fsx_cowextsize = getnum(value, opts, subopt);
> >  		cli->fsx.fsx_xflags |= FS_XFLAG_COWEXTSIZE;
> >  		break;
> > +	case D_DAXINHERIT:
> > +		if (getnum(value, opts, subopt))
> > +			cli->fsx.fsx_xflags |= FS_XFLAG_DAX;
> > +		else
> > +			cli->fsx.fsx_xflags &= ~FS_XFLAG_DAX;
> > +		break;
> >  	default:
> >  		return -EINVAL;
> >  	}
> > 
> 
> -- 
> Carlos
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 4/4] mkfs: allow setting dax flag on root directory
  2020-08-13 23:27 ` [PATCH 4/4] mkfs: allow setting dax flag on root directory Darrick J. Wong
  2020-08-17  6:54   ` Christoph Hellwig
  2020-08-17 11:30   ` Carlos Maiolino
@ 2020-08-17 15:43   ` Darrick J. Wong
  2 siblings, 0 replies; 15+ messages in thread
From: Darrick J. Wong @ 2020-08-17 15:43 UTC (permalink / raw)
  To: sandeen; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Teach mkfs to set the DAX flag on the root directory so that all new
files can be created in dax mode.  This is a complement to removing the
mount option.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
---
v2: minor tweak to manpage text
---
 man/man8/mkfs.xfs.8 |   10 ++++++++++
 mkfs/xfs_mkfs.c     |   14 ++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/man/man8/mkfs.xfs.8 b/man/man8/mkfs.xfs.8
index 7d3f3552ff12..0a7858748457 100644
--- a/man/man8/mkfs.xfs.8
+++ b/man/man8/mkfs.xfs.8
@@ -398,6 +398,16 @@ will have this extent size hint applied.
 The value must be provided in units of filesystem blocks.
 Directories will pass on this hint to newly created regular files and
 directories.
+.TP
+.BI daxinherit= value
+If set, all inodes created by
+.B mkfs.xfs
+will be created with the DAX flag set.
+Directories will pass on this flag to newly created regular files and
+directories.
+By default,
+.B mkfs.xfs
+will not enable DAX mode.
 .RE
 .TP
 .B \-f
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 2e6cd280e388..a687f385a9c1 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -60,6 +60,7 @@ enum {
 	D_PROJINHERIT,
 	D_EXTSZINHERIT,
 	D_COWEXTSIZE,
+	D_DAXINHERIT,
 	D_MAX_OPTS,
 };
 
@@ -254,6 +255,7 @@ static struct opt_params dopts = {
 		[D_PROJINHERIT] = "projinherit",
 		[D_EXTSZINHERIT] = "extszinherit",
 		[D_COWEXTSIZE] = "cowextsize",
+		[D_DAXINHERIT] = "daxinherit",
 	},
 	.subopt_params = {
 		{ .index = D_AGCOUNT,
@@ -369,6 +371,12 @@ static struct opt_params dopts = {
 		  .maxval = UINT_MAX,
 		  .defaultval = SUBOPT_NEEDS_VAL,
 		},
+		{ .index = D_DAXINHERIT,
+		  .conflicts = { { NULL, LAST_CONFLICT } },
+		  .minval = 0,
+		  .maxval = 1,
+		  .defaultval = 1,
+		},
 	},
 };
 
@@ -1434,6 +1442,12 @@ data_opts_parser(
 		cli->fsx.fsx_cowextsize = getnum(value, opts, subopt);
 		cli->fsx.fsx_xflags |= FS_XFLAG_COWEXTSIZE;
 		break;
+	case D_DAXINHERIT:
+		if (getnum(value, opts, subopt))
+			cli->fsx.fsx_xflags |= FS_XFLAG_DAX;
+		else
+			cli->fsx.fsx_xflags &= ~FS_XFLAG_DAX;
+		break;
 	default:
 		return -EINVAL;
 	}

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-08-17 15:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-13 23:27 [PATCH v2 0/4] xfsprogs: various small enhancements Darrick J. Wong
2020-08-13 23:27 ` [PATCH 1/4] xfs_db: fix nlink usage in check Darrick J. Wong
2020-08-17  6:53   ` Christoph Hellwig
2020-08-17 11:25   ` Carlos Maiolino
2020-08-13 23:27 ` [PATCH 2/4] xfs_db: report the inode dax flag Darrick J. Wong
2020-08-17  6:53   ` Christoph Hellwig
2020-08-17 11:26   ` Carlos Maiolino
2020-08-13 23:27 ` [PATCH 3/4] man: update mkfs.xfs inode flag option documentation Darrick J. Wong
2020-08-17  6:54   ` Christoph Hellwig
2020-08-17 11:27   ` Carlos Maiolino
2020-08-13 23:27 ` [PATCH 4/4] mkfs: allow setting dax flag on root directory Darrick J. Wong
2020-08-17  6:54   ` Christoph Hellwig
2020-08-17 11:30   ` Carlos Maiolino
2020-08-17 15:41     ` Darrick J. Wong
2020-08-17 15:43   ` [PATCH v2 " Darrick J. Wong

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).