linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: Latchesar Ionkov <lucho@ionkov.net>,
	Martin Brandenburg <martin@omnibond.com>,
	jfs-discussion@lists.sourceforge.net,
	Dave Kleikamp <shaggy@kernel.org>, Anders Larsen <al@alarsen.net>,
	Bob Copeland <me@bobcopeland.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	mikulas@artax.karlin.mff.cuni.cz, stoph Hellwig <hch@lst.de>,
	Nicolas Pitre <nico@fluxnic.net>,
	Mike Marshall <hubcap@omnibond.com>,
	linux-cifs@vger.kernel.org, "Yan, Zheng" <zyan@redhat.com>,
	Sage Weil <sage@redhat.com>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	y2038 Mailman List <y2038@lists.linaro.org>,
	Richard Weinberger <richard@nod.at>,
	Steve French <sfrench@samba.org>,
	Anton Vorontsov <anton@enomsg.org>,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	codalist@coda.cs.cmu.edu, Christoph Hellwig <hch@infradead.org>,
	coda@cs.cmu.edu,
	V9FS Developers <v9fs-developer@lists.sourceforge.net>,
	Ilya Dryomov <idryomov@gmail.com>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>,
	salah.triki@gmail.com, asmadeus@codewreck.org,
	devel@lists.orangefs.org, Evgeniy Dushistov <dushistov@mail.ru>,
	Kees Cook <keescook@chromium.org>,
	Eric Van Hensbergen <ericvh@gmail.com>, Jan Kara <jack@suse.com>,
	reiserfs-devel@vger.kernel.org, Tejun Heo <tj@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	aivazian.tigran@gmail.com, phillip@squashfs.org.uk,
	David Sterba <dsterba@suse.com>, Jaegeuk Kim <jaegeuk@kernel.org>,
	ceph-devel <ceph-devel@vger.kernel.org>,
	trond.myklebust@hammerspace.com,
	OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	Andreas Dilger <adilger@dilger.ca>,
	Jan Harkes <jaharkes@cs.cmu.edu>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	Tony Luck <tony.luck@intel.com>, Theodore Ts'o <tytso@mit.edu>,
	Luis de Bethencourt <luisbg@kernel.org>,
	Artem Bityutskiy <dedekind1@gmail.com>,
	linux-ntfs-dev@lists.sourceforge.net,
	Greg KH <gregkh@linuxfoundation.org>,
	linux-karma-devel@lists.sourceforge.net,
	Jeff Layton <jlayton@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"Linux F2FS DEV,
	Mailing List" <linux-f2fs-devel@lists.sourceforge.net>,
	linux-xfs <linux-xfs@vger.kernel.org>,
	Colin Cross <ccross@android.com>,
	Linux FS-devel Mailing List <linux-fsdevel@vger.kernel.org>,
	linux-mtd <linux-mtd@lists.infradead.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Anna Schumaker <anna.schumaker@netapp.com>,
	Joel Becker <jlbec@evilplan.org>
Subject: Re: [f2fs-dev] [GIT PULL] vfs: Add support for timestamp limits
Date: Fri, 30 Aug 2019 15:58:35 +0200	[thread overview]
Message-ID: <CAK8P3a0NMUv2xOw=fCxJXo_2wbmBMG24Fst3U1LT-m7C8uxz0w@mail.gmail.com> (raw)
In-Reply-To: <CABeXuvpe9vADLZUr4zHrH0izt=1BaLQvBMxAu=T1A2CV3AN4vA@mail.gmail.com>

On Fri, Aug 30, 2019 at 4:02 AM Deepa Dinamani <deepa.kernel@gmail.com> wrote:
> On Thu, Aug 29, 2019 at 6:20 PM Mike Marshall <hubcap@omnibond.com> wrote:
> >
> > Hi Deepa...
> >
> > I installed this patch series on top of Linux 5.3-rc6 and ran xfstests
> > on orangefs and got a regression... generic/258 failed
> > with: "Timestamp wrapped"...
> >
> > # cat results/generic/258.out.bad
> > QA output created by 258
> > Creating file with timestamp of Jan 1, 1960
> > Testing for negative seconds since epoch
> > Timestamp wrapped: 0
> > Timestamp wrapped
> > (see /home/hubcap/xfstests-dev/results//generic/258.full for details)
>
> Note that patch [16/20] https://lkml.org/lkml/2019/8/18/193 assumes
> that orangefs does not support negative timestamps.
> And, the reason was pointed out in the commit text:
>
> ----------------------
> Assume the limits as unsigned according to the below
> commit 98e8eef557a9 ("changed PVFS_time from int64_t to uint64_t")
> in https://github.com/waltligon/orangefs
>
> Author: Neill Miller <neillm@mcs.anl.gov>
> Date:   Thu Sep 2 15:00:38 2004 +0000
> --------------------
>
> So the timestamp being wrapped to 0 in this case is correct behavior
> according to my patchset.
> The generic/258 assumes that the timestamps can be negative. If this
> is not true then it should not be run for this fs.
>
> But, if you think the timestamp should support negative timestamps for
> orangefs, I'd be happy to change it.

I think it's unclear from the orangefs source code what the intention is,
as there is a mixed of signed and unsigned types used for the inode
stamps:

#define encode_PVFS_time encode_int64_t
#define encode_int64_t(pptr,x) do { \
    *(int64_t*) *(pptr) = cpu_to_le64(*(x)); \
    *(pptr) += 8; \
} while (0)
#define decode_PVFS_time decode_int64_t
#define decode_int64_t(pptr,x) do { \
    *(x) = le64_to_cpu(*(int64_t*) *(pptr)); \
    *(pptr) += 8; \
} while (0)

This suggests that making it unsigned may have been an accident.

Then again,  it's clearly and consistently printed as unsigned in
user space:

        gossip_debug(
            GOSSIP_GETATTR_DEBUG, " VERSION is %llu, mtime is %llu\n",
            llu(s_op->attr.mtime), llu(resp_attr->mtime));

A related issue I noticed is this:

PVFS_time PINT_util_mktime_version(PVFS_time time)
{
    struct timeval t = {0,0};
    PVFS_time version = (time << 32);

    gettimeofday(&t, NULL);
    version |= (PVFS_time)t.tv_usec;
    return version;
}
PVFS_time PINT_util_mkversion_time(PVFS_time version)
{
    return (PVFS_time)(version >> 32);
}
static PINT_sm_action getattr_verify_attribs(
        struct PINT_smcb *smcb, job_status_s *js_p)
{
...
    resp_attr->mtime = PINT_util_mkversion_time(s_op->attr.mtime);
...
}

which suggests that at least for some purposes, the mtime field
is only an unsigned 32-bit number (1970..2106). From my readiing,
this affects the on-disk format, but not the protocol implemented
by the kernel.

atime and ctime are apparently 64-bit, but mtime is only 32-bit
seconds, plus a 32-bit 'version'. I suppose the server could be
fixed to allow a larger range, but probably would take it out of
the 'version' bits, not the upper half.

To be on the safe side, I suppose the kernel can only assume
an unsigned 32-bit range to be available. If the server gets
extended beyond that, it would have to pass a feature flag.

     Arnd


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2019-08-30 13:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190829041132.26677-1-deepa.kernel@gmail.com>
2019-08-29  4:38 ` [f2fs-dev] [GIT PULL] vfs: Add support for timestamp limits Deepa Dinamani
2019-08-30  1:20   ` Mike Marshall
2019-08-30  2:02     ` Deepa Dinamani
2019-08-30 13:58       ` Arnd Bergmann [this message]
2019-08-31 22:50         ` Deepa Dinamani

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='CAK8P3a0NMUv2xOw=fCxJXo_2wbmBMG24Fst3U1LT-m7C8uxz0w@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=adilger.kernel@dilger.ca \
    --cc=adilger@dilger.ca \
    --cc=adrian.hunter@intel.com \
    --cc=aivazian.tigran@gmail.com \
    --cc=al@alarsen.net \
    --cc=anna.schumaker@netapp.com \
    --cc=anton@enomsg.org \
    --cc=asmadeus@codewreck.org \
    --cc=ccross@android.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=coda@cs.cmu.edu \
    --cc=codalist@coda.cs.cmu.edu \
    --cc=darrick.wong@oracle.com \
    --cc=dedekind1@gmail.com \
    --cc=deepa.kernel@gmail.com \
    --cc=devel@lists.orangefs.org \
    --cc=dsterba@suse.com \
    --cc=dushistov@mail.ru \
    --cc=dwmw2@infradead.org \
    --cc=ericvh@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=hubcap@omnibond.com \
    --cc=idryomov@gmail.com \
    --cc=jack@suse.com \
    --cc=jaegeuk@kernel.org \
    --cc=jaharkes@cs.cmu.edu \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=jlayton@kernel.org \
    --cc=jlbec@evilplan.org \
    --cc=keescook@chromium.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-karma-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-ntfs-dev@lists.sourceforge.net \
    --cc=linux-xfs@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lucho@ionkov.net \
    --cc=luisbg@kernel.org \
    --cc=martin@omnibond.com \
    --cc=me@bobcopeland.com \
    --cc=mikulas@artax.karlin.mff.cuni.cz \
    --cc=nico@fluxnic.net \
    --cc=phillip@squashfs.org.uk \
    --cc=reiserfs-devel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=sage@redhat.com \
    --cc=salah.triki@gmail.com \
    --cc=sfrench@samba.org \
    --cc=shaggy@kernel.org \
    --cc=tj@kernel.org \
    --cc=tony.luck@intel.com \
    --cc=trond.myklebust@hammerspace.com \
    --cc=tytso@mit.edu \
    --cc=v9fs-developer@lists.sourceforge.net \
    --cc=viro@zeniv.linux.org.uk \
    --cc=y2038@lists.linaro.org \
    --cc=zyan@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).