Commit

Yauhen Kharuzhy committed 4c9ddb5

btrfs: Don't start autoreplacement process at mounting at remounting stage

Don't start autoreplace process if filesystem still is not mounted or is in
remounting state. This needed to allow fixing degraded RAID
automatically after mounting.

Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@zavadatar.com>

Comments (0)

Files changed (1)

File fs/btrfs/disk-io.c Modified

View file
  • Ignore whitespace
  • Hide word diff
 		}
 sleep:
 		btrfs_check_devices(root->fs_info->fs_devices);
-		if (!root->fs_info->casualty_kthread)
+		if (!root->fs_info->casualty_kthread
+			&& root->fs_info->open
+			&& !test_bit(BTRFS_FS_STATE_REMOUNTING, &root->fs_info->fs_state)) {
 			root->fs_info->casualty_kthread =
 				kthread_run(casualty_kthread, root,
 							"btrfs-casualty");
+		}
 
 		wake_up_process(root->fs_info->cleaner_kthread);
 		mutex_unlock(&root->fs_info->transaction_kthread_mutex);