diff options
| author | Amir Goldstein <amir@cellrox.com> | 2014-08-04 19:29:32 +0300 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2018-12-02 01:01:01 +0100 |
| commit | fb653d6bf19a37e8381f30fa1dd69a7cd1f13333 (patch) | |
| tree | 75e8614bcf417ec2f6433cae57982877626192b4 /scripts/checkstack.pl | |
| parent | 121fb781d9711e05f91ecc665fe401ca59cb3f39 (diff) | |
sysrq: Emergency Remount R/O in reverse order
This change fixes a problem where reboot on Android panics the kernel
almost every time when file systems are mounted over loop devices.
Android reboot command does:
- sync
- echo u > /proc/sysrq-trigger
- syscall_reboot
The problem is with sysrq emergency remount R/O trying to remount-ro
in wrong order.
since /data is re-mounted ro before loop devices, loop device
remount-ro fails to flush the journal and panics the kernel:
EXT4-fs (loop0): Remounting filesystem read-only
EXT4-fs (loop0): previous I/O error to superblock detected
loop: Write error at byte offset 0, length 4096.
Buffer I/O error on device loop0, logical block 0
lost page write due to I/O error on loop0
Kernel panic - not syncing: EXT4-fs panic from previous error
The fix is quite simple. In do_emergency_remount(), use
list_for_each_entry_reverse() on sb list instead of list_for_each_entry().
It makes a lot of sense to umount the file systems in reverse order in
which they were added to sb list.
Change-Id: I4370e39b5873bd16ade5d5f9ddb2704beb02a2bb
Signed-off-by: Amir Goldstein <amir@cellrox.com>
Acked-by: Oren Laadan <orenl@cellrox.com>
Diffstat (limited to 'scripts/checkstack.pl')
0 files changed, 0 insertions, 0 deletions
