diff options
-rw-r--r-- | fs/btrfs/reada.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c index 298631eaee78..8428db7cd88f 100644 --- a/fs/btrfs/reada.c +++ b/fs/btrfs/reada.c | |||
@@ -761,12 +761,14 @@ static void __reada_start_machine(struct btrfs_fs_info *fs_info) | |||
761 | 761 | ||
762 | do { | 762 | do { |
763 | enqueued = 0; | 763 | enqueued = 0; |
764 | mutex_lock(&fs_devices->device_list_mutex); | ||
764 | list_for_each_entry(device, &fs_devices->devices, dev_list) { | 765 | list_for_each_entry(device, &fs_devices->devices, dev_list) { |
765 | if (atomic_read(&device->reada_in_flight) < | 766 | if (atomic_read(&device->reada_in_flight) < |
766 | MAX_IN_FLIGHT) | 767 | MAX_IN_FLIGHT) |
767 | enqueued += reada_start_machine_dev(fs_info, | 768 | enqueued += reada_start_machine_dev(fs_info, |
768 | device); | 769 | device); |
769 | } | 770 | } |
771 | mutex_unlock(&fs_devices->device_list_mutex); | ||
770 | total += enqueued; | 772 | total += enqueued; |
771 | } while (enqueued && total < 10000); | 773 | } while (enqueued && total < 10000); |
772 | 774 | ||