From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: david@fromorbit.com, linux-xfs@vger.kernel.org,
amir73il@gmail.com, sandeen@sandeen.net
Subject: Re: [PATCH 08/11] xfs: widen ondisk inode timestamps to deal with y2038+
Date: Mon, 31 Aug 2020 12:44:08 -0700 [thread overview]
Message-ID: <20200831194408.GU6096@magnolia> (raw)
In-Reply-To: <20200831160810.GC7091@infradead.org>
On Mon, Aug 31, 2020 at 05:08:10PM +0100, Christoph Hellwig wrote:
> On Sun, Aug 30, 2020 at 11:07:39PM -0700, Darrick J. Wong wrote:
> > +static inline uint64_t xfs_inode_encode_bigtime(struct timespec64 tv)
> > +{
> > + return (xfs_unix_to_bigtime(tv.tv_sec) * NSEC_PER_SEC) + tv.tv_nsec;
>
> Nit: no need for the braces due to operator precedence.
Fixed.
> > + return xfs_sb_version_hasbigtime(&ip->i_mount->m_sb) &&
> > + !xfs_inode_has_bigtime(ip);
> > +}
> > +
> > /*
> > * This is called to mark the fields indicated in fieldmask as needing to be
> > * logged when the transaction is committed. The inode must already be
> > @@ -131,6 +137,16 @@ xfs_trans_log_inode(
> > iversion_flags = XFS_ILOG_CORE;
> > }
> >
> > + /*
> > + * If we're updating the inode core or the timestamps and it's possible
> > + * to upgrade this inode to bigtime format, do so now.
> > + */
> > + if ((flags & (XFS_ILOG_CORE | XFS_ILOG_TIMESTAMP)) &&
> > + xfs_inode_want_bigtime_upgrade(ip)) {
> > + ip->i_d.di_flags2 |= XFS_DIFLAG2_BIGTIME;
> > + flags |= XFS_ILOG_CORE;
> > + }
>
> Despite the disagree with Dave I find it very confusing to use
> both a direct reference to XFS_DIFLAG2_BIGTIME and one hidden under
> two layers of abstraction in the direct same piece of code.
Same here, I'll change it back to:
/*
* If we're updating the inode core or the timestamps and it's possible
* to upgrade this inode to bigtime format, do so now.
*/
if ((flags & (XFS_ILOG_CORE | XFS_ILOG_TIMESTAMP)) &&
xfs_sb_version_hasbigtime(&ip->i_mount->m_sb) &&
!xfs_inode_has_bigtime(ip)) {
ip->i_d.di_flags2 |= XFS_DIFLAG2_BIGTIME;
flags |= XFS_ILOG_CORE;
}
I'm not a huge fan of the single-line inode-has-bigtime predicate
either, but at least it's consistent stylistically with the predicate
for the dinode and the log dinode...
Anyway, thanks for the review! Now on to the buffer disposition v2
series....
--D
> Otherwise looks good:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
next prev parent reply other threads:[~2020-08-31 19:46 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-31 6:06 [PATCH v5 00/11] xfs: widen timestamps to deal with y2038 Darrick J. Wong
2020-08-31 6:06 ` [PATCH 01/11] xfs: explicitly define inode timestamp range Darrick J. Wong
2020-09-01 8:18 ` Gao Xiang
2020-08-31 6:06 ` [PATCH 02/11] xfs: refactor quota expiration timer modification Darrick J. Wong
2020-08-31 6:07 ` [PATCH 03/11] xfs: refactor default quota grace period setting code Darrick J. Wong
2020-08-31 6:07 ` [PATCH 04/11] xfs: refactor quota timestamp coding Darrick J. Wong
2020-08-31 6:07 ` [PATCH 05/11] xfs: move xfs_log_dinode_to_disk to the log recovery code Darrick J. Wong
2020-09-01 8:19 ` Gao Xiang
2020-08-31 6:07 ` [PATCH 06/11] xfs: redefine xfs_timestamp_t Darrick J. Wong
2020-08-31 16:03 ` Christoph Hellwig
2020-09-01 8:40 ` Gao Xiang
2020-08-31 6:07 ` [PATCH 07/11] xfs: redefine xfs_ictimestamp_t Darrick J. Wong
2020-08-31 16:04 ` Christoph Hellwig
2020-09-01 9:04 ` Gao Xiang
2020-08-31 6:07 ` [PATCH 08/11] xfs: widen ondisk inode timestamps to deal with y2038+ Darrick J. Wong
2020-08-31 16:08 ` Christoph Hellwig
2020-08-31 19:44 ` Darrick J. Wong [this message]
2020-09-01 11:44 ` Gao Xiang
2020-09-01 17:53 ` Darrick J. Wong
2020-08-31 6:07 ` [PATCH 09/11] xfs: widen ondisk quota expiration timestamps to handle y2038+ Darrick J. Wong
2020-08-31 6:07 ` [PATCH 10/11] xfs: trace timestamp limits Darrick J. Wong
2020-09-01 11:46 ` Gao Xiang
2020-08-31 6:07 ` [PATCH 11/11] xfs: enable big timestamps Darrick J. Wong
2020-08-31 16:10 ` Christoph Hellwig
2020-09-01 11:47 ` Gao Xiang
2020-08-31 8:07 ` [PATCH v5 00/11] xfs: widen timestamps to deal with y2038 Amir Goldstein
2020-08-31 15:58 ` Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2020-09-02 2:56 [PATCH v6 " Darrick J. Wong
2020-09-02 2:57 ` [PATCH 08/11] xfs: widen ondisk inode timestamps to deal with y2038+ Darrick J. Wong
2020-08-26 22:04 [PATCH v4 00/11] xfs: widen timestamps to deal with y2038 Darrick J. Wong
2020-08-26 22:05 ` [PATCH 08/11] xfs: widen ondisk inode timestamps to deal with y2038+ Darrick J. Wong
2020-08-27 6:58 ` Christoph Hellwig
2020-08-27 15:38 ` Darrick J. Wong
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=20200831194408.GU6096@magnolia \
--to=darrick.wong@oracle.com \
--cc=amir73il@gmail.com \
--cc=david@fromorbit.com \
--cc=hch@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox