All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux-xfs@vger.kernel.org, y2038@lists.linaro.org,
	Deepa Dinamani <deepa.kernel@gmail.com>,
	Dave Chinner <david@fromorbit.com>,
	Brian Foster <bfoster@redhat.com>,
	Allison Collins <allison.henderson@oracle.com>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [RFC 1/5] xfs: [variant A] avoid time_t in user api
Date: Tue, 12 Nov 2019 21:06:28 -0800	[thread overview]
Message-ID: <20191113050628.GS6219@magnolia> (raw)
In-Reply-To: <20191112141600.GB10922@lst.de>

On Tue, Nov 12, 2019 at 03:16:00PM +0100, Christoph Hellwig wrote:
> On Tue, Nov 12, 2019 at 01:09:06PM +0100, Arnd Bergmann wrote:
> > However, as long as two observations are true, a much simpler solution
> > can be used:
> > 
> > 1. xfsprogs is the only user space project that has a copy of this header
> 
> We can't guarantee that.
> 
> > 2. xfsprogs already has a replacement for all three affected ioctl commands,
> >    based on the xfs_bulkstat structure to pass 64-bit timestamps
> >    regardless of the architecture
> 
> XFS_IOC_BULKSTAT replaces XFS_IOC_FSBULKSTAT directly, and can replace
> XFS_IOC_FSBULKSTAT_SINGLE indirectly, so that is easy.  Most users
> actually use the new one now through libfrog, although I found a user
> of the direct ioctl in the xfs_io tool, which could easily be fixed as
> well.

Agreed, XFS_IOC_BULKSTAT is the replacement for the two FSBULKSTAT
variants.  The only question in my mind for the old ioctls is whether we
should return EOVERFLOW if the timestamp would overflow?  Or just
truncate the results?

> XFS_IOC_SWAPEXT does not have a direct replacement, but the timestamp
> is only used to verify that the file did not change vs the previous
> stat.  So not being able to represent > 2038 times is not a real
> problem anyway.

Won't it become a problem when the tv_sec comparison in xfs_swap_extents
is type-promoted to the larger type but lacks the upper bits?

I guess we could force the check to the lower 32 bits on the assumption
that those are the most likely to change due to a file write.

I kinda want to do a SWAPEXT v5, fwiw....

> At some point we should probably look into a file system independent
> defrag ioctl anyway, at which point we can deprecate XFS_IOC_SWAPEXT.
> 
> > Based on those assumptions, changing xfs_bstime to use __kernel_long_t
> > instead of time_t in both the kernel and in xfsprogs preserves the current
> > ABI for any libc definition of time_t and solves the problem of passing
> > 64-bit timestamps to 32-bit user space.
> 
> As said above their are not entirely true, but I still think this patch
> is the right thing to do, if only to get the time_t out of the ABI..
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Seconded,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D


  reply	other threads:[~2019-11-13  5:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12 12:09 [RFC 0/5] xfs: y2038 conversion Arnd Bergmann
2019-11-12 12:09 ` [RFC 1/5] xfs: [variant A] avoid time_t in user api Arnd Bergmann
2019-11-12 14:16   ` Christoph Hellwig
2019-11-13  5:06     ` Darrick J. Wong [this message]
2019-11-13 13:42       ` Arnd Bergmann
2019-11-13 16:34         ` Darrick J. Wong
2019-11-13 17:14           ` Arnd Bergmann
2019-11-12 12:09 ` [RFC 2/5] xfs: [variant B] add time64 version of xfs_bstat Arnd Bergmann
2019-11-12 12:09 ` [RFC 3/5] xfs: [variant C] avoid i386-misaligned xfs_bstat Arnd Bergmann
2019-11-12 12:09 ` [RFC 4/5] xfs: extend inode format for 40-bit timestamps Arnd Bergmann
2019-11-12 14:16   ` Christoph Hellwig
2019-11-12 15:02     ` Amir Goldstein
2019-11-12 15:29       ` [Y2038] " Arnd Bergmann
2019-11-12 21:32   ` Dave Chinner
2019-11-12 12:09 ` [RFC 5/5] xfs: use 40-bit quota time limits Arnd Bergmann

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=20191113050628.GS6219@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=allison.henderson@oracle.com \
    --cc=arnd@arndb.de \
    --cc=bfoster@redhat.com \
    --cc=david@fromorbit.com \
    --cc=deepa.kernel@gmail.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=y2038@lists.linaro.org \
    /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.