[lkml]   [2012]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[RFC] [PATCH] vfs: remount all file-systems R/O on emergency remount.
From: Artem Bityutskiy <>

Currently the emergency remount (triggered by Sysrq-u) re-mounting only
those file-systems R/O, which have an associated block device (sb->s_bdev).
This does not work for file-systems like UBIFS and JFFS2 which work on top
of MTD devices (character devices) and always have sb->s_bdev = NULL.

This also does not work for tmpfs.

Most probably the intention was to avoid re-mounting R/O file-systems like
procfs, sysfs, cgroup, and debugfs. However, I do not really see why not
to remount them R/O as well in case of emergency.

This patch removes the 'sb->s_bdev != NULL' check from
'do_emergency_remount()', so _all_ file-systems will be re-mounted R/O.

Tested in Fedora - all file-systems (ext4, ubifs, procfs, sysfs, cgroup, and
debugfs) become R/O on Sysrq-u with this patch.

Signed-off-by: Artem Bityutskiy <>
fs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/super.c b/fs/super.c
index 0902cfa..95cf173 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -812,7 +812,7 @@ static void do_emergency_remount(struct work_struct *work)
- if (sb->s_root && sb->s_bdev && (sb->s_flags & MS_BORN) &&
+ if (sb->s_root && (sb->s_flags & MS_BORN) &&
!(sb->s_flags & MS_RDONLY)) {
* What lock protects sb->s_flags??

 \ /
  Last update: 2012-08-24 10:41    [W:0.061 / U:2.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site