Bug 665376

Summary: incorrectly documented the mount "atime" option
Product: Red Hat Enterprise Linux 6 Reporter: Debbie Johnson <dejohnso>
Component: util-linux-ngAssignee: Karel Zak <kzak>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: azelinka, esandeen, kzak, ndoane, rvokal
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: util-linux-ng-2.17.2-9.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 14:06:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Debbie Johnson 2010-12-23 14:01:46 UTC
Description of problem:
The mount command with atime option always mounts filesystems as relatime.
According to mount's man page, atime option appears to work as well as
strictatime option. Please see below.

[man mount]
...
atime Update inode access time for each access. See also the strictatime
mount option.
...

As you see, the description of atime points to strictatime's. We confirmed
the behavior of strictatime is the same as RHEL5's atime. So, we suppose
atime should work as well as strictatime. We believe that this is due to a
bug of atime. Could you please fix mount so that it works properly?

Version-Release number of selected component:
Red Hat Enterprise Linux Version Number: 6
Release Number: RC1
Architecture: x86_64
Kernel Version: kernel-2.6.32-71.el6.x86_64
Related Package Version: util-linux-ng-2.17.2-6.el6.x86_64
Related Middleware / Application: N/A

Drivers or hardware or architecture dependency:
None.

How reproducible:
Always

Step to Reproduce:
1. Run mount command with atime option
# mount -o atime /dev/sdb1 /tmp/bar

2. Check the mount's option
# cat /proc/mounts
...
/dev/sdb1 /tmp/bar ext4 rw,relatime,barrier=1,data=ordered 0 0
<The filesystem should be mounted as not atime but relatime.>

Actual Results:
An option "atime" of mount doesn't work as expected.

Expected Results:
An option "atime" of mount works as well as an option strictatime.

Summary of actions taken to resolve issue:
None.

Location of diagnostic data:
None.

Hardware configuration:
Model: Fujitsu PRIMERGY RX300S4
CPU Info: Intel(R) Xeon(R) E5420 2.50GHz
Memory Info: 12GB
Hardware Component Information: None.
Configuration Info: None.
Guest Configuration Info: None.

Business Impact:

Target Release:6.2

Errata Request:No.

Hotfix Request:No.


A fix has been provided by customer which simply is a fix to man pages.. this is attached.

Comment 1 Eric Sandeen 2011-01-17 17:35:53 UTC
It's the mount binary which handles "strictatime" and "atime" options, in util-linux-ng ...  it needs to pass MS_STRICTATIME flags to the mount syscall if that behavior is desired.  It does for strictatime but does not for atime.

Karel, is "atime" supposed to work as well?

Comment 2 Karel Zak 2011-01-18 09:53:15 UTC
(In reply to comment #1)
> It's the mount binary which handles "strictatime" and "atime" options, in
> util-linux-ng ...  it needs to pass MS_STRICTATIME flags to the mount syscall
> if that behavior is desired.  It does for strictatime but does not for atime.
> 
> Karel, is "atime" supposed to work as well?

There is not relation between atime and strictatime in mount(8). The traditional way how mount(8) works with mount flags is:

 noatime:  flags |= MS_NOATIME
   atime:  flags &= ~MS_NOATIME

so set/unset the flag only. There is not any other logic. The rest have to be done in kernel. I don't think that mount(8) is the right place to play any game with mount flags...

The latest upstream version of the man page:

  atime  Update inode access time for each access. 
         See also the strictatime mount option.

noatime  Do  not  update inode access times on this filesystem 
         (e.g, for faster access on the news spool to 
          speed up news servers).

strictatime
         Allows to explicitly requesting full atime updates. This makes 
         it possible for kernel to  defaults to  relatime or noatime but
         still allow userspace to override it. For more details about the
         default system mount options see /proc/mounts.


The "atime" description is probably bad, should be "disable noatime option, 
the inode access time is controlled by kernel defaults, see strictatime for more details" or so...

Comment 7 errata-xmlrpc 2011-05-19 14:06:43 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0699.html