linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
	 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	 linux-kernel@vger.kernel.org, Jeff Layton <jlayton@kernel.org>,
	 kernel test robot <oliver.sang@intel.com>
Subject: [PATCH 0/2] fs: fixes for multigrain ctime code
Date: Thu, 07 Sep 2023 12:33:46 -0400	[thread overview]
Message-ID: <20230907-ctime-fixes-v1-0-3b74c970d934@kernel.org> (raw)

The kernel test robot noted some test failures with the LTP mount03 test
on tmpfs. From the test output, it looked like the atime had gone
backward.

One way this could happen would be for tmpfs to get a new inode from the
slab that had a ctime that appeared to be in the future.
inode_update_ctime_current would just return that time and then the
mtime and atime would be set to the same value. Then later, the atime
gets overwritten by "now" which is still lower than the garbage ctime
value.

I've not been able to reproduce this on my test rig, so I'm not certain
this fixes the problem that was reported. I'm hopeful though, so I've
left the KTR tags in place.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Jeff Layton (2):
      fs: initialize inode->__i_ctime to the epoch
      fs: don't update the atime if existing atime is newer than "now"

 fs/inode.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
base-commit: 7ba2090ca64ea1aa435744884124387db1fac70f
change-id: 20230907-ctime-fixes-ec6319ca01be

Best regards,
-- 
Jeff Layton <jlayton@kernel.org>



             reply	other threads:[~2023-09-07 16:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07 16:33 Jeff Layton [this message]
2023-09-07 16:33 ` [PATCH 1/2] fs: initialize inode->__i_ctime to the epoch Jeff Layton
2023-09-08 10:42   ` Jan Kara
2023-09-08 11:41     ` Jeff Layton
2023-09-08 12:10       ` Jan Kara
2023-09-07 16:33 ` [PATCH 2/2] fs: don't update the atime if existing atime is newer than "now" Jeff Layton
2023-09-08 12:11   ` Jan Kara
2023-09-08 12:10 ` [PATCH 0/2] fs: fixes for multigrain ctime code Christian Brauner

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=20230907-ctime-fixes-v1-0-3b74c970d934@kernel.org \
    --to=jlayton@kernel.org \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=oliver.sang@intel.com \
    --cc=viro@zeniv.linux.org.uk \
    /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