diff options
author | Carlos Maiolino <cmaiolino@redhat.com> | 2017-06-29 05:25:40 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-06-29 20:21:06 -0400 |
commit | a8e2b6367794e6cee9eecba6d5ff425f338e0754 (patch) | |
tree | df6a37f24748795a1426909f905742e908610172 | |
parent | 6916363f3083837ed5adb3df2dd90d6b97017dff (diff) |
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>
-rw-r--r-- | fs/statfs.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) | |||
38 | flags |= ST_SYNCHRONOUS; | 38 | flags |= ST_SYNCHRONOUS; |
39 | if (s_flags & MS_MANDLOCK) | 39 | if (s_flags & MS_MANDLOCK) |
40 | flags |= ST_MANDLOCK; | 40 | flags |= ST_MANDLOCK; |
41 | if (s_flags & MS_RDONLY) | ||
42 | flags |= ST_RDONLY; | ||
41 | return flags; | 43 | return flags; |
42 | } | 44 | } |
43 | 45 | ||