ext4: clear mmp sequence number when remounting read-only

Previously, when an MMP-protected file system is remounted read-only,
the kmmpd thread would exit the next time it woke up (a few seconds
later), without resetting the MMP sequence number back to
EXT4_MMP_SEQ_CLEAN.

Fix this by explicitly killing the MMP thread when the file system is
remounted read-only.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Andreas Dilger <adilger@dilger.ca>

Changed files
+4 -5
fs
ext4
+2 -5
fs/ext4/mmp.c
··· 186 186 goto exit_thread; 187 187 } 188 188 189 - if (sb_rdonly(sb)) { 190 - ext4_warning(sb, "kmmpd being stopped since filesystem " 191 - "has been remounted as readonly."); 192 - goto exit_thread; 193 - } 189 + if (sb_rdonly(sb)) 190 + break; 194 191 195 192 diff = jiffies - last_update_time; 196 193 if (diff < mmp_update_interval * HZ)
+2
fs/ext4/super.c
··· 5212 5212 5213 5213 if (sbi->s_journal) 5214 5214 ext4_mark_recovery_complete(sb, es); 5215 + if (sbi->s_mmp_tsk) 5216 + kthread_stop(sbi->s_mmp_tsk); 5215 5217 } else { 5216 5218 /* Make sure we can mount this feature set readwrite */ 5217 5219 if (ext4_has_feature_readonly(sb) ||