Skip to content

Commit

Permalink
Make statfs properly return read-only state after emergency remount
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cmaiolino authored and Al Viro committed Jun 30, 2017
1 parent 6916363 commit a8e2b63
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/statfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a8e2b63

Please sign in to comment.