Btrfs: merge inode_list in __merge_refs
[firefly-linux-kernel-4.4.55.git] / fs / btrfs / super.c
index 915ac14c20642ec619ec159d90d0fbed2a02b0da..acd2df85bed5cd7b81b88191baee26e1829a14a7 100644 (file)
@@ -1226,6 +1226,15 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
                        goto restore;
                }
 
+               if (fs_info->fs_devices->missing_devices >
+                    fs_info->num_tolerated_disk_barrier_failures &&
+                   !(*flags & MS_RDONLY)) {
+                       printk(KERN_WARNING
+                              "Btrfs: too many missing devices, writeable remount is not allowed\n");
+                       ret = -EACCES;
+                       goto restore;
+               }
+
                if (btrfs_super_log_root(fs_info->super_copy) != 0) {
                        ret = -EINVAL;
                        goto restore;