public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Eric Sandeen <sandeen@sandeen.net>,
	linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 17/18] xfs_repair: support bigtime
Date: Tue, 18 Aug 2020 08:32:31 -0700	[thread overview]
Message-ID: <20200818153231.GP6096@magnolia> (raw)
In-Reply-To: <CAOQ4uxiw7oPFwy2J-hGAoN6qTu_Hnx9E2vy2qBO9x5M-oaT5AQ@mail.gmail.com>

On Tue, Aug 18, 2020 at 05:58:11PM +0300, Amir Goldstein wrote:
> On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
> >
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > Check the bigtime iflag in relation to the fs feature set.
> >
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Reviewed-by: Amir Goldstein <amir73il@gmail.com>
> 
> and some questions below...
> 
> > ---
> >  repair/dinode.c |   13 ++++++++++++-
> >  1 file changed, 12 insertions(+), 1 deletion(-)
> >
> >
> > diff --git a/repair/dinode.c b/repair/dinode.c
> > index ad2f672d8703..3507cd06075d 100644
> > --- a/repair/dinode.c
> > +++ b/repair/dinode.c
> > @@ -2173,7 +2173,8 @@ check_nsec(
> >         union xfs_timestamp     *t,
> >         int                     *dirty)
> >  {
> > -       if ((dip->di_flags2 & be64_to_cpu(XFS_DIFLAG2_BIGTIME)) ||
> > +       if ((dip->di_version >= 3 &&
> 
> It seems a bit strange that di_version check was added by this commit.

Ooh, yeah.  That was added a few patches back, though it shouldn't have
been.

> > +            (dip->di_flags2 & cpu_to_be64(XFS_DIFLAG2_BIGTIME))) ||
> >             be32_to_cpu(t->t_nsec) < NSEC_PER_SEC)
> >                 return;
> >
> > @@ -2601,6 +2602,16 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
> >                         flags2 &= ~XFS_DIFLAG2_COWEXTSIZE;
> >                 }
> >
> > +               if ((flags2 & XFS_DIFLAG2_BIGTIME) &&
> > +                   !xfs_sb_version_hasbigtime(&mp->m_sb)) {
> > +                       if (!uncertain) {
> > +                               do_warn(
> > +       _("inode %" PRIu64 " is marked bigtime but file system does not support large timestamps\n"),
> > +                                       lino);
> > +                       }
> > +                       flags2 &= ~XFS_DIFLAG2_BIGTIME;
> 
> Should we maybe also reset the timestamps to epoc in this case?

Yeah, since it's possible that the timestamp would then have an invalid
nsec field once the bigtime field is cleared.  This also needs to log
something about logging "...would zero timestamps and clear flag".

Thanks for catching this. :)

--D

> 
> Thanks,
> Amir.

  reply	other threads:[~2020-08-18 15:32 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
2020-08-17 22:58 ` [PATCH 01/18] libxfs: create a real struct timespec64 Darrick J. Wong
2020-08-18 14:19   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 02/18] xfs: explicitly define inode timestamp range Darrick J. Wong
2020-08-18 14:17   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 03/18] xfs: refactor quota expiration timer modification Darrick J. Wong
2020-08-18 14:21   ` Amir Goldstein
2020-08-18 15:25     ` Darrick J. Wong
2020-08-18 18:50       ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 04/18] xfs: refactor default quota grace period setting code Darrick J. Wong
2020-08-18 14:23   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 05/18] xfs: remove xfs_timestamp_t Darrick J. Wong
2020-08-18 14:24   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 06/18] xfs: move xfs_log_dinode_to_disk to the log code Darrick J. Wong
2020-08-18 14:26   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 07/18] xfs: refactor inode timestamp coding Darrick J. Wong
2020-08-18 14:28   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 08/18] xfs: convert struct xfs_timestamp to union Darrick J. Wong
2020-08-18 14:29   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 09/18] libxfs: refactor NSEC_PER_SEC Darrick J. Wong
2020-08-18 14:31   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 10/18] xfs: widen ondisk timestamps to deal with y2038 problem Darrick J. Wong
2020-08-18 14:40   ` Amir Goldstein
2020-08-17 23:00 ` [PATCH 11/18] xfs: refactor quota timestamp coding Darrick J. Wong
2020-08-18 14:41   ` Amir Goldstein
2020-08-17 23:00 ` [PATCH 12/18] xfs: enable bigtime for quota timers Darrick J. Wong
2020-08-17 23:00 ` [PATCH 13/18] xfs: enable big timestamps Darrick J. Wong
2020-08-18 14:42   ` Amir Goldstein
2020-08-17 23:00 ` [PATCH 14/18] xfs_db: report bigtime format timestamps Darrick J. Wong
2020-08-18 15:37   ` Darrick J. Wong
2020-08-17 23:00 ` [PATCH 15/18] xfs_db: support printing time limits Darrick J. Wong
2020-08-17 23:00 ` [PATCH 16/18] xfs_db: add bigtime upgrade path Darrick J. Wong
2020-08-18 15:17   ` Amir Goldstein
2020-08-17 23:00 ` [PATCH 17/18] xfs_repair: support bigtime Darrick J. Wong
2020-08-18 14:58   ` Amir Goldstein
2020-08-18 15:32     ` Darrick J. Wong [this message]
2020-08-17 23:00 ` [PATCH 18/18] mkfs: format bigtime filesystems Darrick J. Wong
2020-08-18 14:45   ` Amir Goldstein
2020-08-18 15:34     ` 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=20200818153231.GP6096@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=amir73il@gmail.com \
    --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