mnt: Change the default remount atime from relatime to the existing value
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 29 Jul 2014 00:36:04 +0000 (17:36 -0700)
committersungmin ha <sungmin82.ha@samsung.com>
Wed, 18 Mar 2015 05:07:30 +0000 (14:07 +0900)
commit5580a8fd6d87f41881328d4ece3a6728a08245b4
treed4edba00021c5afbae4d12657c722c42ac34f595
parent40ce8043192a5046351320eeba92a55a6698a6e1
mnt: Change the default remount atime from relatime to the existing value

Since March 2009 the kernel has treated the state that if no
MS_..ATIME flags are passed then the kernel defaults to relatime.

Defaulting to relatime instead of the existing atime state during a
remount is silly, and causes problems in practice for people who don't
specify any MS_...ATIME flags and to get the default filesystem atime
setting.  Those users may encounter a permission error because the
default atime setting does not work.

A default that does not work and causes permission problems is
ridiculous, so preserve the existing value to have a default
atime setting that is always guaranteed to work.

Using the default atime setting in this way is particularly
interesting for applications built to run in restricted userspace
environments without /proc mounted, as the existing atime mount
options of a filesystem can not be read from /proc/mounts.

In practice this fixes user space that uses the default atime
setting on remount that are broken by the permission checks
keeping less privileged users from changing more privileged users
atime settings.

Change-Id: Ia780ef3a21a95cec7b05b47b6cc95628fbc93396
Cc: stable@vger.kernel.org
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/namespace.c