vfs: fix bad hashing of dentries
[firefly-linux-kernel-4.4.55.git] / fs / btrfs / disk-io.c
index b8b60b660c8f833cb38bf93823e1a3738e32669a..abecce3993542adf75463b2f681189787b0ea74b 100644 (file)
@@ -3161,6 +3161,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;
@@ -3175,6 +3177,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;
@@ -3514,6 +3518,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);
 
        del_fs_roots(fs_info);