1 ext4: clear mmp sequence number when remounting read-only
3 Previously, when an MMP-protected file system is remounted read-only,
4 the kmmpd thread would exit the next time it woke up (a few seconds
5 later), without resetting the MMP sequence number back to
8 Fix this by explicitly killing the MMP thread when the file system is
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 Cc: Andreas Dilger <adilger@dilger.ca>
14 fs/ext4/mmp.c | 7 ++-----
15 fs/ext4/super.c | 2 ++
16 2 files changed, 4 insertions(+), 5 deletions(-)
18 diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
19 index 27b9a76a0dfa..638ad4743477 100644
22 @@ -186,11 +186,8 @@ static int kmmpd(void *data)
26 - if (sb_rdonly(sb)) {
27 - ext4_warning(sb, "kmmpd being stopped since filesystem "
28 - "has been remounted as readonly.");
34 diff = jiffies - last_update_time;
35 if (diff < mmp_update_interval * HZ)
36 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
37 index 90d0e113a174..38b5d2a22a63 100644
40 @@ -5219,6 +5219,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
43 ext4_mark_recovery_complete(sb, es);
45 + kthread_stop(sbi->s_mmp_tsk);
47 /* Make sure we can mount this feature set readwrite */
48 if (ext4_has_feature_readonly(sb) ||