Project

General

Profile

Actions

Bug #53844

closed

kclient: xfstest generic/003 failed with "access time has changed for file in read-only filesystem"

Added by Xiubo Li over 2 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
kcephfs
Crash signature (v1):
Crash signature (v2):

Description

generic/003     - output mismatch (see /data/xfstests/results//generic/003.out.bad)
    --- tests/generic/003.out    2021-11-04 10:18:48.552469708 +0800
    +++ /data/xfstests/results//generic/003.out.bad    2022-01-11 23:24:44.448417734 +0800
    @@ -1,2 +1,4 @@
     QA output created by 003
    +ERROR: access time has changed for file1 after remount
    +ERROR: access time has changed for file in read-only filesystem
     Silence is golden
    ...
    (Run 'diff -u tests/generic/003.out /data/xfstests/results//generic/003.out.bad'  to see the entire diff)

Actions #1

Updated by Jeff Layton about 2 years ago

I'm not sure this is actually fixable. The test seems to require that the atime not change on a read, but that's something that's more or less driven by the MDS, and it can't reasonably skip changing the atime just because the client happened to mount r/o. The MDS doesn't have any concept of a read-only mount (AFAIK).

The bottom line is that atime is a terrible fit for network filesystems like ceph (and really, atime was just a terrible idea anyway -- "Hey, let's turn every read operation into an inode write!").

Actions #2

Updated by Xiubo Li about 2 years ago

Jeff Layton wrote:

I'm not sure this is actually fixable. The test seems to require that the atime not change on a read, but that's something that's more or less driven by the MDS, and it can't reasonably skip changing the atime just because the client happened to mount r/o. The MDS doesn't have any concept of a read-only mount (AFAIK).

The bottom line is that atime is a terrible fit for network filesystems like ceph (and really, atime was just a terrible idea anyway -- "Hey, let's turn every read operation into an inode write!").

Sorry I missed your last comment.

Currently the cephfs doesn't maintain the `atime`, more detail please see [1].

Currently the atime is flip-floping frequently:

The test for directory:

[root@lxbceph1 kcephfs]# mkdir dir
[root@lxbceph1 kcephfs]# stat dir
  File: dir
  Size: 0             Blocks: 0          IO Block: 65536  directory
Device: 32h/50d    Inode: 1099511627777  Links: 2
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Context: system_u:object_r:cephfs_t:s0
Access: 2022-04-20 13:03:40.179479553 +0800
Modify: 2022-04-20 13:03:40.179479553 +0800
Change: 2022-04-20 13:03:40.179479553 +0800
 Birth: 2022-04-20 13:03:40.179479553 +0800
[root@lxbceph1 kcephfs]# ls dir
[root@lxbceph1 kcephfs]# stat dir
  File: dir
  Size: 0             Blocks: 0          IO Block: 65536  directory
Device: 32h/50d    Inode: 1099511627777  Links: 2
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Context: system_u:object_r:cephfs_t:s0
Access: 2022-04-20 13:03:47.159746159 +0800
Modify: 2022-04-20 13:03:40.179479553 +0800
Change: 2022-04-20 13:03:40.179479553 +0800
 Birth: 2022-04-20 13:03:40.179479553 +0800
[root@lxbceph1 kcephfs]# mkdir dir/aa
[root@lxbceph1 kcephfs]# stat dir
  File: dir
  Size: 1             Blocks: 0          IO Block: 65536  directory
Device: 32h/50d    Inode: 1099511627777  Links: 3
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Context: system_u:object_r:cephfs_t:s0
Access: 2022-04-20 13:03:47.159746159 +0800
Modify: 2022-04-20 13:03:55.432062116 +0800
Change: 2022-04-20 13:03:55.432062116 +0800
 Birth: 2022-04-20 13:03:40.179479553 +0800
[root@lxbceph1 kcephfs]# ls dir
aa
[root@lxbceph1 kcephfs]# stat dir
  File: dir
  Size: 1             Blocks: 0          IO Block: 65536  directory
Device: 32h/50d    Inode: 1099511627777  Links: 3
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Context: system_u:object_r:cephfs_t:s0
Access: 2022-04-20 13:03:40.179479553 +0800
Modify: 2022-04-20 13:03:55.432062116 +0800
Change: 2022-04-20 13:03:55.432062116 +0800
 Birth: 2022-04-20 13:03:40.179479553 +0800
[root@lxbceph1 kcephfs]# 

Same for the regular files. It will try to update the ctime in mmap and generic read cases and will ignore updating it in direct and sync read cases.

And even we update it in mmap and generic read cases we will drop it and won't sync it to MDS. And we are seeing the atime will be updated and then dropped to the floor again and again.

Sent a patch to disable the atime updating for the whole mount in [2].

[1] https://lists.ceph.io/hyperkitty/list/ceph-users@ceph.io/thread/VSJM7T4CS5TDRFF6XFPIYMHP75K73PZ6/
[2] https://patchwork.kernel.org/project/ceph-devel/list/?series=633625

Actions #3

Updated by Xiubo Li about 2 years ago

  • Status changed from New to Resolved

Have disabled the `atime` updating and we won't maintain it, updated the doc in https://github.com/ceph/ceph/pull/45979.

Actions

Also available in: Atom PDF