]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/btrfs/disk-io.c
Btrfs: fix csum tree corruption, duplicate and outdated checksums
[karo-tx-linux.git] / fs / btrfs / disk-io.c
index 81ea55314b1ff0f61d2691f786a481889cd831ac..370ef74501576ddbe9d7128c244753429effc57f 100644 (file)
@@ -3244,6 +3244,8 @@ static int barrier_all_devices(struct btrfs_fs_info *info)
        /* send down all the barriers */
        head = &info->fs_devices->devices;
        list_for_each_entry_rcu(dev, head, dev_list) {
+               if (dev->missing)
+                       continue;
                if (!dev->bdev) {
                        errors_send++;
                        continue;
@@ -3258,6 +3260,8 @@ static int barrier_all_devices(struct btrfs_fs_info *info)
 
        /* wait for all the barriers */
        list_for_each_entry_rcu(dev, head, dev_list) {
+               if (dev->missing)
+                       continue;
                if (!dev->bdev) {
                        errors_wait++;
                        continue;
@@ -3594,6 +3598,11 @@ int close_ctree(struct btrfs_root *root)
 
        btrfs_free_block_groups(fs_info);
 
+       /*
+        * we must make sure there is not any read request to
+        * submit after we stopping all workers.
+        */
+       invalidate_inode_pages2(fs_info->btree_inode->i_mapping);
        btrfs_stop_all_workers(fs_info);
 
        free_root_pointers(fs_info, 1);