Btrfs: Wait for IO on the block device inodes of newly added devices
[linux-2.6-block.git] / fs / btrfs / volumes.c
index 51f113119b258295b8bf08ac82b2d9e91f8ecd5e..f63cf7621a01a3b46665fa87100dd31939e6c459 100644 (file)
@@ -1038,6 +1038,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
                return -EIO;
        }
 
+       filemap_write_and_wait(bdev->bd_inode->i_mapping);
        mutex_lock(&root->fs_info->volume_mutex);
 
        trans = btrfs_start_transaction(root, 1);