Commit 613cbe3d4870429bf2e816d4bbe3146d157ee5c1
Committed by
Linus Torvalds
1 parent
ff54250a0e
Exists in
master
and in
4 other branches
Don't set relatime when noatime is specified
Since commit 0a1c01c9477602ee8b44548a9405b2c1d587b5a2 ("Make relatime default") when a file system is mounted explicitely with noatime it gets both the MNT_RELATIME and MNT_NOATIME bits set. This shows up like this in /proc/mounts: /dev/xxx /yyy ext3 rw,noatime,relatime,errors=continue,data=writeback 0 0 That looks strange. The VFS uses noatime in this case, but both flags are set. So it's more a cosmetic issue, but still better to fix. Cc: mjg@redhat.com Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff
fs/namespace.c
... | ... | @@ -1920,8 +1920,9 @@ |
1920 | 1920 | if (data_page) |
1921 | 1921 | ((char *)data_page)[PAGE_SIZE - 1] = 0; |
1922 | 1922 | |
1923 | - /* Default to relatime */ | |
1924 | - mnt_flags |= MNT_RELATIME; | |
1923 | + /* Default to relatime unless overriden */ | |
1924 | + if (!(flags & MS_NOATIME)) | |
1925 | + mnt_flags |= MNT_RELATIME; | |
1925 | 1926 | |
1926 | 1927 | /* Separate the per-mountpoint flags */ |
1927 | 1928 | if (flags & MS_NOSUID) |