From patchwork Wed May 30 15:16:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10439255 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 97887601E9 for ; Wed, 30 May 2018 15:17:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8778A27FA1 for ; Wed, 30 May 2018 15:17:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7BD2B28C3C; Wed, 30 May 2018 15:17:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CA1C27FA1 for ; Wed, 30 May 2018 15:17:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753876AbeE3PRD (ORCPT ); Wed, 30 May 2018 11:17:03 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:42287 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751794AbeE3PQz (ORCPT ); Wed, 30 May 2018 11:16:55 -0400 Received: by mail-qt0-f193.google.com with SMTP id c2-v6so23682822qtn.9; Wed, 30 May 2018 08:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=JA2ntDLCI0oPHy8e4xp7dLq0lFgmk62WC+bV347mAm0=; b=WH29q8P4s7yajvYOQDYn51LJunEF3suUb+ZuFMeL67uVn/RG/qS5M1+4mI8efH4duO 1Rf0atw1vZ2s+LcosuXmzKDvc68MDAuei65eC+sE+pnuYAwRrWVCijfr5Pt2YZfZRjIj P66Zy9IfVZPLIJiSjYXzT/tUg989qqDfRfg4yH9PcDj7P0TKy25KzQgdBLMNXMNJulwH BKgxgIfuSPwCU6SApF4ii4bsBgIZNAO3fn1BHbH8dv+S2zFSIu683x/siErzZ/U/0GuB CdWrM+2X4+Z0WuV2uGaOjnWhFRepnyiKKwx7SyxOUId6BXz1qbkhiPn0U00fr88tuRv0 IBPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=JA2ntDLCI0oPHy8e4xp7dLq0lFgmk62WC+bV347mAm0=; b=bA7vWI6z6h5SS/VTGWMhfRlERxLT0UY+jGNH1TYzCNcrhUH6eHqI4/mLB5uLjHD0XT XtvoF6EeL6NK2OLugqsNWuldQ1G9tR2Z2AVSNeJ47M8Ar3Wq33+R8A61JMHJgjrCyvXy 6cSPq11bM/1hnUrAYiLufUEJZCT8Q8Qgd/AsK1xcE71BvXsEqmlt6SH8iqqoMik/Zptv LXGKkbn7OytchL9bbB7+uGq+AqnRQxJ25c4oCY6EZYfQ9LFy8qhJfv4NdsjLsi/52j9y jU+Q9nZpRfWguBLcIVhjxMTG/YczN3G6NQ6gLVFs1vjqi4QCXkgDOFhfuEU/C/dNxKPu pJ6Q== X-Gm-Message-State: APt69E1iSxRlba3Wp9LG2ncf+eKOM036OpkIV0bb9CQW18g140bH0Nee Sp9fjI8N0LjdeWvpkruHgQysthE5gyChgMPYE5o= X-Google-Smtp-Source: ADUXVKI4UL8XDoqs00FhdJ62zaGHCHrBqMRlNPk4XukTjvwc39nvjjJ6RZRdpjaTaGWZ4xERTt7t09Nm9+FrsdpXsWg= X-Received: by 2002:ac8:64a:: with SMTP id e10-v6mr2928098qth.163.1527693414561; Wed, 30 May 2018 08:16:54 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:b903:0:0:0:0:0 with HTTP; Wed, 30 May 2018 08:16:53 -0700 (PDT) In-Reply-To: <20180525233528.GA371@deepa-ubuntu> References: <20180525233528.GA371@deepa-ubuntu> From: Arnd Bergmann Date: Wed, 30 May 2018 17:16:53 +0200 X-Google-Sender-Auth: 4BU6rtJEl8jUZQHj0xFDRX1rqXU Message-ID: Subject: Re: [GIT PULL] Transition vfs to 64-bit timestamps To: Deepa Dinamani Cc: Thomas Gleixner , Linux Kernel Mailing List , Al Viro , Linus Torvalds , y2038 Mailman List , Linux FS-devel Mailing List , "Dilger, Andreas" , anton@tuxera.com, Felipe Balbi , "J. Bruce Fields" , ceph-devel , "Darrick J. Wong" , David Howells , David Sterba , David Woodhouse , Christoph Hellwig , OGAWA Hirofumi , Mike Marshall , Jan Kara , Jaegeuk Kim , Jan Harkes , Jiri Slaby , Kees Cook , Mark Fasheh , Miklos Szeredi , Nicolas Pitre , reiserfs-devel@vger.kernel.org, Richard Weinberger , Sage Weil , Steve French , Steven Whitehouse , Tejun Heo , Trond Myklebust , "Theodore Ts'o" , zyan@redhat.com, Miklos Szeredi Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sat, May 26, 2018 at 1:35 AM, Deepa Dinamani wrote: > The flag patch applies cleanly. I've not seen the timestamps > update logic change often. The series applies cleanly on 4.17-rc6 > and linux-next tip (top commit: next-20180517). It just stopped applying cleanly against the latest linux-next tree, due to a conflict against two patches from the overlayfs-next tree: b2a285e1dc5d ("Revert "vfs: update ovl inode before relatime check"") 681b186a012d ("Revert "ovl: fix relatime for directories"") After the conflict resolution below, it works fine again. Not sure what the best merge strategy would be, at least the bit in ovl_file_accessed() isn't obvious enough. Arnd diff --cc fs/inode.c index 6404639e2491,9fe1f941be02..195b974e7a77 --- a/fs/inode.c +++ b/fs/inode.c @@@ -1635,10 -1681,11 +1635,10 @@@ static int update_time(struct inode *in * This function automatically handles read only file systems and media, * as well as the "noatime" flag and inode specific "noatime" markers. */ -bool __atime_needs_update(const struct path *path, struct inode *inode, - bool rcu) +bool atime_needs_update(const struct path *path, struct inode *inode) { struct vfsmount *mnt = path->mnt; - struct timespec now; + struct timespec64 now; if (inode->i_flags & S_NOATIME) return false; @@@ -1661,10 -1708,10 +1661,14 @@@ now = current_time(inode); - if (!relatime_need_update(mnt, inode, now)) - if (!relatime_need_update(path, inode, timespec64_to_timespec(now), rcu)) ++ if (!relatime_need_update(mnt, inode, timespec64_to_timespec(now))) return false; - if (timespec_equal(&inode->i_atime, &now)) + if (timespec64_equal(&inode->i_atime, &now)) return false; return true; @@@ -1674,9 -1721,9 +1678,9 @@@ void touch_atime(const struct path *pat { struct vfsmount *mnt = path->mnt; struct inode *inode = d_inode(path->dentry); - struct timespec now; + struct timespec64 now; - if (!__atime_needs_update(path, inode, false)) + if (!atime_needs_update(path, inode)) return; if (!sb_start_write_trylock(inode->i_sb)) inode->i_ctime = upperinode->i_ctime; } @@@ -439,7 -384,39 +439,7 @@@ struct posix_acl *ovl_get_acl(struct in return acl; } - int ovl_update_time(struct inode *inode, struct timespec *ts, int flags) -static bool ovl_open_need_copy_up(struct dentry *dentry, int flags) -{ - /* Copy up of disconnected dentry does not set upper alias */ - if (ovl_dentry_upper(dentry) && - (ovl_dentry_has_upper_alias(dentry) || - (dentry->d_flags & DCACHE_DISCONNECTED))) - return false; - - if (special_file(d_inode(dentry)->i_mode)) - return false; - - if (!(OPEN_FMODE(flags) & FMODE_WRITE) && !(flags & O_TRUNC)) - return false; - - return true; -} - -int ovl_open_maybe_copy_up(struct dentry *dentry, unsigned int file_flags) -{ - int err = 0; - - if (ovl_open_need_copy_up(dentry, file_flags)) { - err = ovl_want_write(dentry); - if (!err) { - err = ovl_copy_up_flags(dentry, file_flags); - ovl_drop_write(dentry); - } - } - - return err; -} - + int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags) { if (flags & S_ATIME) { struct ovl_fs *ofs = inode->i_sb->s_fs_info; diff --cc fs/overlayfs/overlayfs.h index 93c84929d422,9fe10247f9d4..8477d9e4b4fe --- a/fs/overlayfs/overlayfs.h +++ b/fs/overlayfs/overlayfs.h @@@ -356,18 -330,10 +356,18 @@@ int ovl_xattr_get(struct dentry *dentry void *value, size_t size); ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size); struct posix_acl *ovl_get_acl(struct inode *inode, int type); - int ovl_update_time(struct inode *inode, struct timespec *ts, int flags); -int ovl_open_maybe_copy_up(struct dentry *dentry, unsigned int file_flags); + int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags); bool ovl_is_private_xattr(const char *name); --- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --cc fs/overlayfs/inode.c index e31d64206a01,d7cca60f28e6..e0bb217c01e2 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -169,8 +169,8 @@ static void ovl_file_accessed(struct file *file) if (!upperinode) return; - if ((!timespec_equal(&inode->i_mtime, &upperinode->i_mtime) || - !timespec_equal(&inode->i_ctime, &upperinode->i_ctime))) { + if ((!timespec64_equal(&inode->i_mtime, &upperinode->i_mtime) || + !timespec64_equal(&inode->i_ctime, &upperinode->i_ctime))) { inode->i_mtime = upperinode->i_mtime;