Make statfs properly return read-only state after emergency remount
authorCarlos Maiolino <cmaiolino@redhat.com>
Thu, 29 Jun 2017 09:25:40 +0000 (11:25 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 30 Jun 2017 00:21:06 +0000 (20:21 -0400)
commita8e2b6367794e6cee9eecba6d5ff425f338e0754
treedf6a37f24748795a1426909f905742e908610172
parent6916363f3083837ed5adb3df2dd90d6b97017dff
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 <cmaiolino@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/statfs.c