Details

    • Bug
    • Resolution: Fixed
    • Major
    • Lustre 2.6.0
    • Lustre 2.5.0
    • 3
    • 9899

    Description

      ll_readdir calls touch_atime() which is wrong because it ignores
      whether O_NOATIME is set in f_flags. On RHEL 6, this is moreover unnecessary as vfs_readdir() calls file_accessed() (which does check for O_NOATIME) after invoking f_op->readdir().

      Attachments

        Issue Links

          Activity

            [LU-3831] ll_readdir() ignores O_NOATIME

            b2_5 patch version/back-port is at http://review.whamcloud.com/13687/.

            bfaccini Bruno Faccini (Inactive) added a comment - b2_5 patch version/back-port is at http://review.whamcloud.com/13687/ .

            Faccini Bruno (bruno.faccini@intel.com) uploaded a new patch: http://review.whamcloud.com/13687
            Subject: LU-3831 llite: Remove touch_atime() call in ll_readdir()
            Project: fs/lustre-release
            Branch: b2_5
            Current Patch Set: 1
            Commit: e6105f668ec9135f1c888399329f4d8fd5b68cde

            gerrit Gerrit Updater added a comment - Faccini Bruno (bruno.faccini@intel.com) uploaded a new patch: http://review.whamcloud.com/13687 Subject: LU-3831 llite: Remove touch_atime() call in ll_readdir() Project: fs/lustre-release Branch: b2_5 Current Patch Set: 1 Commit: e6105f668ec9135f1c888399329f4d8fd5b68cde
            jhammond John Hammond added a comment -

            Patch landed to master. Thanks Swapnil.

            jhammond John Hammond added a comment - Patch landed to master. Thanks Swapnil.

            Patch: http://review.whamcloud.com/#/c/8664/

            I used the recently added file_is_noatime() to honor O_NOATIME before calling touch_atime in ll_readdir()

            spimpale Swapnil Pimpale (Inactive) added a comment - Patch: http://review.whamcloud.com/#/c/8664/ I used the recently added file_is_noatime() to honor O_NOATIME before calling touch_atime in ll_readdir()
            jhammond John Hammond added a comment -

            Despite ll_readdir() ignoring O_NATIME, directory access timestamps are not updated from userspace's POV.

            # mkdir /mnt/lustre/d0
            # stat /mnt/lustre/d0
              File: `/mnt/lustre/d0'
              Size: 4096      	Blocks: 8          IO Block: 4096   directory
            Device: 2c54f966h/743766374d	Inode: 144115205255725058  Links: 2
            Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
            Access: 2013-08-23 13:51:06.000000000 -0500
            Modify: 2013-08-23 13:51:06.000000000 -0500
            Change: 2013-08-23 13:51:06.000000000 -0500
            # /bin/ls /mnt/lustre/d0
            # stat /mnt/lustre/d0
              File: `/mnt/lustre/d0'
              Size: 4096      	Blocks: 8          IO Block: 4096   directory
            Device: 2c54f966h/743766374d	Inode: 144115205255725058  Links: 2
            Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
            Access: 2013-08-23 13:51:06.000000000 -0500
            Modify: 2013-08-23 13:51:06.000000000 -0500
            Change: 2013-08-23 13:51:06.000000000 -0500
            # date 
            Fri Aug 23 13:52:10 CDT 2013
            # /bin/ls /mnt/lustre/d0
            # stat /mnt/lustre/d0
              File: `/mnt/lustre/d0'
              Size: 4096      	Blocks: 8          IO Block: 4096   directory
            Device: 2c54f966h/743766374d	Inode: 144115205255725058  Links: 2
            Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
            Access: 2013-08-23 13:51:06.000000000 -0500
            Modify: 2013-08-23 13:51:06.000000000 -0500
            Change: 2013-08-23 13:51:06.000000000 -0500
            
            jhammond John Hammond added a comment - Despite ll_readdir() ignoring O_NATIME, directory access timestamps are not updated from userspace's POV. # mkdir /mnt/lustre/d0 # stat /mnt/lustre/d0 File: `/mnt/lustre/d0' Size: 4096 Blocks: 8 IO Block: 4096 directory Device: 2c54f966h/743766374d Inode: 144115205255725058 Links: 2 Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2013-08-23 13:51:06.000000000 -0500 Modify: 2013-08-23 13:51:06.000000000 -0500 Change: 2013-08-23 13:51:06.000000000 -0500 # /bin/ls /mnt/lustre/d0 # stat /mnt/lustre/d0 File: `/mnt/lustre/d0' Size: 4096 Blocks: 8 IO Block: 4096 directory Device: 2c54f966h/743766374d Inode: 144115205255725058 Links: 2 Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2013-08-23 13:51:06.000000000 -0500 Modify: 2013-08-23 13:51:06.000000000 -0500 Change: 2013-08-23 13:51:06.000000000 -0500 # date Fri Aug 23 13:52:10 CDT 2013 # /bin/ls /mnt/lustre/d0 # stat /mnt/lustre/d0 File: `/mnt/lustre/d0' Size: 4096 Blocks: 8 IO Block: 4096 directory Device: 2c54f966h/743766374d Inode: 144115205255725058 Links: 2 Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2013-08-23 13:51:06.000000000 -0500 Modify: 2013-08-23 13:51:06.000000000 -0500 Change: 2013-08-23 13:51:06.000000000 -0500
            jhammond John Hammond added a comment -

            O_NOATIME is broken in several places. I'm preparing to report that issue but didn't want to forget this one. Will investigate '-o noatime' after this. Not sure about how it's handled on-disk but I feel confident that from the client POV it will appear to be broken.

            jhammond John Hammond added a comment - O_NOATIME is broken in several places. I'm preparing to report that issue but didn't want to forget this one. Will investigate '-o noatime' after this. Not sure about how it's handled on-disk but I feel confident that from the client POV it will appear to be broken.

            There is likely a historical reason for this (i.e. it wasn't done in some 2.4.9 kernel), but was moved into the VFS and nobody noticed. Sounds like this call can just be deleted.

            It is also worthwhile to check if the MDS code handles "-o noatime" or "-o relatime" properly or not. It might be that the MDS writes the atime sent from the client even if it is mounted with "-o noatime".

            adilger Andreas Dilger added a comment - There is likely a historical reason for this (i.e. it wasn't done in some 2.4.9 kernel), but was moved into the VFS and nobody noticed. Sounds like this call can just be deleted. It is also worthwhile to check if the MDS code handles "-o noatime" or "-o relatime" properly or not. It might be that the MDS writes the atime sent from the client even if it is mounted with "-o noatime".

            People

              jhammond John Hammond
              jhammond John Hammond
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: