|
@@ -1330,6 +1330,12 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
|
|
|
* this also happens on 'umount -rf' or on shutdown, when
|
|
|
* the filesystem is busy.
|
|
|
*/
|
|
|
+
|
|
|
+ /* wait for the uuid_scan task to finish */
|
|
|
+ down(&fs_info->uuid_tree_rescan_sem);
|
|
|
+ /* avoid complains from lockdep et al. */
|
|
|
+ up(&fs_info->uuid_tree_rescan_sem);
|
|
|
+
|
|
|
sb->s_flags |= MS_RDONLY;
|
|
|
|
|
|
btrfs_dev_replace_suspend_for_unmount(fs_info);
|