From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: sandeen@sandeen.net, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 6/6] mkfs: always use new_diflags2 to initialize new inodes
Date: Wed, 29 Jun 2022 09:01:05 +1000 [thread overview]
Message-ID: <20220628230105.GS227878@dread.disaster.area> (raw)
In-Reply-To: <165644938793.1089996.3898370820373975650.stgit@magnolia>
On Tue, Jun 28, 2022 at 01:49:47PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> The new_diflags2 field that's set in the inode geometry represent
> features that we want enabled for /all/ newly created inodes.
> Unfortunately, mkfs doesn't do that because xfs_flags2diflags2 doesn't
> read new_diflags2. Change the new_diflags2 logic to match the kernel.
>
> Without this fix, the root directory gets created without the
> DIFLAG2_NREXT64 iflag set, but files created by a protofile /do/ have it
> turned on.
>
> This wasn't an issue with DIFLAG2_BIGTIME because xfs_trans_log_inode
> quietly turns that on whenever possible.
>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
> libxfs/util.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>
> diff --git a/libxfs/util.c b/libxfs/util.c
> index d2389198..5d2383e9 100644
> --- a/libxfs/util.c
> +++ b/libxfs/util.c
> @@ -286,8 +286,10 @@ libxfs_init_new_inode(
>
> if (xfs_has_v3inodes(ip->i_mount)) {
> VFS_I(ip)->i_version = 1;
> - ip->i_diflags2 = pip ? ip->i_mount->m_ino_geo.new_diflags2 :
> - xfs_flags2diflags2(ip, fsx->fsx_xflags);
> + ip->i_diflags2 = ip->i_mount->m_ino_geo.new_diflags2;
> + if (!pip)
> + ip->i_diflags2 = xfs_flags2diflags2(ip,
> + fsx->fsx_xflags);
> ip->i_crtime = VFS_I(ip)->i_mtime; /* struct copy */
> ip->i_cowextsize = pip ? 0 : fsx->fsx_cowextsize;
> }
Looks good.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2022-06-28 23:01 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 20:49 [PATCHSET 0/6] xfsprogs: random fixes Darrick J. Wong
2022-06-28 20:49 ` [PATCH 1/6] xfs_copy: don't use cached buffer reads until after libxfs_mount Darrick J. Wong
2022-06-28 22:56 ` Dave Chinner
2022-06-29 7:44 ` Christoph Hellwig
2022-06-28 20:49 ` [PATCH 2/6] xfs_repair: clear DIFLAG2_NREXT64 when filesystem doesn't support nrext64 Darrick J. Wong
2022-06-28 22:58 ` Dave Chinner
2022-06-29 23:10 ` Darrick J. Wong
2022-06-30 22:51 ` Dave Chinner
2022-07-01 0:08 ` Darrick J. Wong
2022-07-01 0:12 ` [PATCH v2 " Darrick J. Wong
2022-07-01 1:08 ` Dave Chinner
2022-06-28 20:49 ` [PATCH 3/6] xfs_repair: detect and fix padding fields that changed with nrext64 Darrick J. Wong
2022-06-28 22:59 ` Dave Chinner
2022-06-28 20:49 ` [PATCH 4/6] mkfs: preserve DIFLAG2_NREXT64 when setting other inode attributes Darrick J. Wong
2022-06-28 22:59 ` Dave Chinner
2022-06-28 20:49 ` [PATCH 5/6] mkfs: document the large extent count switch in the --help screen Darrick J. Wong
2022-06-28 23:00 ` Dave Chinner
2022-06-28 20:49 ` [PATCH 6/6] mkfs: always use new_diflags2 to initialize new inodes Darrick J. Wong
2022-06-28 23:01 ` Dave Chinner [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=20220628230105.GS227878@dread.disaster.area \
--to=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.