From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F4D2C3A5A4 for ; Fri, 30 Aug 2019 13:59:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3491223426 for ; Fri, 30 Aug 2019 13:59:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="n/OOoJ0+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3491223426 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I2e7P29cJ9zPqg5nveRhvWWgROpV+H4zOe97fI39+mM=; b=n/OOoJ0+CyWYW0 ZplduH7UbmsaOSpQcO7SKDyNS4w5L82WeEhnCxBOPwQTuJvUzb9cZeRv0YBvFyeV7oeWqwDnP+X9+ NzyGDQcrM4EICeYqycyEoijDzf2M4i3O+vpAMqksJxlBUuCCtj4/Nj6RToIilDJ8mG2MM1Fb0fquG X9i60Mg7cHlMKcdlr0UNqOU7BlIYLaKnYbFC3TXBrf+tsXsrCtSV2BsXgfhma9t0Dc3vY21fANgN4 ysYclp8a2II6vmJUUKTQVN7/iLFNDmh2nbQXwcEHvfkT2H+XI0q5B7qvANQGkvjB/+qBfPKB+PoFi 50PDLKp0HSx9WQ/p/OpA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i3hQZ-0004MC-CW; Fri, 30 Aug 2019 13:58:59 +0000 Received: from mail-qk1-f193.google.com ([209.85.222.193]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i3hQU-0004LI-CE for linux-mtd@lists.infradead.org; Fri, 30 Aug 2019 13:58:56 +0000 Received: by mail-qk1-f193.google.com with SMTP id d23so6207605qko.3 for ; Fri, 30 Aug 2019 06:58:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wZh0lrnnbveFd2ktjNoW+9Y7+KeLBrFI15hkdhrfg8w=; b=GEFzxvK761M5W3Z7B9HhK3t4Dtg7Zsiq9h0kf5JR91lmvQ6srxaE1F5Aj9UwmqDRNM U4oOZ5sLF4V/Apa10nsg+7sPmWbEnxYaNnRYJTjEdk4n9qBGnxLKmbj8jRCVer8ok3KP ZdJ4mJjhFza9JYsOUoDwSTUByL6Xk891F0ULXuhaA+GCaWaUJ2W4Jlz2y5C2ZLuZvyLk DoPm/gxXGW0KA26RgG5pN4mUi99XUuNIzOSMny5N9/q8EVlYy+KkWqKZ859qM4Za4iy/ ot6UwWAVLzy6yHu2I7eUWPfbS4KptKpuoC/V21w9lLQp2lhypJT+Cy3DLXuknc6z4pC/ 7HsQ== X-Gm-Message-State: APjAAAUsZuP3X/R+cqxqxOQ8FTvxz0H42TRO7e7r8KP0Zff5PjpoTZM1 MlsskK9X/Hpo2B7DDjbPu8pVsGKuVWlF4wAXn3I= X-Google-Smtp-Source: APXvYqwLJSfUvFHYpnCbLtQwiLesqk6Up0F09OxCEWeJS/zvGXm8TGjLQauibK2uyX+MPGtGJJXtticB+OlivKMyzRQ= X-Received: by 2002:a37:4b0d:: with SMTP id y13mr15306907qka.3.1567173532434; Fri, 30 Aug 2019 06:58:52 -0700 (PDT) MIME-Version: 1.0 References: <20190829041132.26677-1-deepa.kernel@gmail.com> In-Reply-To: From: Arnd Bergmann Date: Fri, 30 Aug 2019 15:58:35 +0200 Message-ID: Subject: Re: [GIT PULL] vfs: Add support for timestamp limits To: Deepa Dinamani X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190830_065854_422916_B4D88DCB X-CRM114-Status: GOOD ( 25.90 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Latchesar Ionkov , Martin Brandenburg , jfs-discussion@lists.sourceforge.net, Dave Kleikamp , Anders Larsen , Chao Yu , Bob Copeland , Adrian Hunter , Andreas Dilger , mikulas@artax.karlin.mff.cuni.cz, stoph Hellwig , Nicolas Pitre , Mike Marshall , linux-cifs@vger.kernel.org, "Yan, Zheng" , Sage Weil , "Darrick J. Wong" , y2038 Mailman List , Richard Weinberger , Steve French , Anton Vorontsov , Russell King - ARM Linux , codalist@coda.cs.cmu.edu, Christoph Hellwig , coda@cs.cmu.edu, V9FS Developers , Ilya Dryomov , Ext4 Developers List , salah.triki@gmail.com, asmadeus@codewreck.org, devel@lists.orangefs.org, Evgeniy Dushistov , Kees Cook , Eric Van Hensbergen , Jan Kara , reiserfs-devel@vger.kernel.org, Tejun Heo , Alexander Viro , aivazian.tigran@gmail.com, phillip@squashfs.org.uk, David Sterba , Jaegeuk Kim , ceph-devel , trond.myklebust@hammerspace.com, OGAWA Hirofumi , Andreas Dilger , Jan Harkes , Linux NFS Mailing List , Tony Luck , Theodore Ts'o , Luis de Bethencourt , Artem Bityutskiy , linux-ntfs-dev@lists.sourceforge.net, Greg KH , linux-karma-devel@lists.sourceforge.net, Jeff Layton , Linux Kernel Mailing List , "Linux F2FS DEV, Mailing List" , linux-xfs , Colin Cross , Linux FS-devel Mailing List , linux-mtd , David Woodhouse , Anna Schumaker , Joel Becker Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Fri, Aug 30, 2019 at 4:02 AM Deepa Dinamani wrote: > On Thu, Aug 29, 2019 at 6:20 PM Mike Marshall 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 > 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 MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/