aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poetzsch <christian.potzsch@imgtec.com>2015-07-24 16:42:58 +0100
committerAmit Pundir <amit.pundir@linaro.org>2016-01-04 13:09:17 +0530
commitf58da4846b27bc584618e309eeb83118d79058a5 (patch)
tree5b2e80af1417a09a4041017bf6fccf0fdea22828
parente936f60fc191bda9daa52c19f73bc2989acfd9f6 (diff)
Fix for in kernel emergency remount when loop mounts are used
adb reboot calls /proc/sysrq-trigger to force an emergency remount (ro) of all mounted disks. This is executed in the order of the time the mount was originally done. Because we have a test system which loop mount images from an extra partition, we see errors cause the loop mounted partitions gets remounted after this physical partition was set to read only already. Fix this by reversing the order of the emergency remount. This will remount the disk first which have been mounted last. So instead of remounting in this order: /dev/sda1 /dev/loop1 /dev/loop2 we now remount in this order: /dev/loop2 /dev/loop1 /dev/sda1 Change-Id: I68fe7e16cc9400ab5278877af70c9ea1d9b57936 Signed-off-by: Christian Poetzsch <christian.potzsch@imgtec.com>
-rw-r--r--fs/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/super.c b/fs/super.c
index 954aeb80e202..1014e7cc355f 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -789,7 +789,7 @@ static void do_emergency_remount(struct work_struct *work)
struct super_block *sb, *p = NULL;
spin_lock(&sb_lock);
- list_for_each_entry(sb, &super_blocks, s_list) {
+ list_for_each_entry_reverse(sb, &super_blocks, s_list) {
if (hlist_unhashed(&sb->s_instances))
continue;
sb->s_count++;