From: Carlos Maiolino Date: Thu, 29 Jun 2017 09:25:40 +0000 (+0200) Subject: Make statfs properly return read-only state after emergency remount X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a8e2b6367794e6cee9eecba6d5ff425f338e0754;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Make statfs properly return read-only state after emergency remount Emergency remount (sysrq-u) sets MS_RDONLY to the superblock but doesn't set MNT_READONLY to the mount point. Once calculate_f_flags() only check for the mount point read only state, when setting kstatfs flags, after an emergency remount, statfs does not report the filesystem as read-only, even though it is. Enable flags_by_sb() to also check for superblock read only state, so the kstatfs and consequently statfs can properly show the read-only state of the filesystem. Signed-off-by: Carlos Maiolino Signed-off-by: Al Viro --- diff --git a/fs/statfs.c b/fs/statfs.c index 4e4623c7a126..c1dfc374e3c1 100644 --- a/fs/statfs.c +++ b/fs/statfs.c @@ -38,6 +38,8 @@ static int flags_by_sb(int s_flags) flags |= ST_SYNCHRONOUS; if (s_flags & MS_MANDLOCK) flags |= ST_MANDLOCK; + if (s_flags & MS_RDONLY) + flags |= ST_RDONLY; return flags; }