diff options
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 6b9cff42265d..2854c824ab64 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -684,6 +684,12 @@ int btrfs_close_devices(struct btrfs_fs_devices *fs_devices) | |||
684 | __btrfs_close_devices(fs_devices); | 684 | __btrfs_close_devices(fs_devices); |
685 | free_fs_devices(fs_devices); | 685 | free_fs_devices(fs_devices); |
686 | } | 686 | } |
687 | /* | ||
688 | * Wait for rcu kworkers under __btrfs_close_devices | ||
689 | * to finish all blkdev_puts so device is really | ||
690 | * free when umount is done. | ||
691 | */ | ||
692 | rcu_barrier(); | ||
687 | return ret; | 693 | return ret; |
688 | } | 694 | } |
689 | 695 | ||
@@ -4929,7 +4935,18 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, | |||
4929 | em = lookup_extent_mapping(em_tree, chunk_start, 1); | 4935 | em = lookup_extent_mapping(em_tree, chunk_start, 1); |
4930 | read_unlock(&em_tree->lock); | 4936 | read_unlock(&em_tree->lock); |
4931 | 4937 | ||
4932 | BUG_ON(!em || em->start != chunk_start); | 4938 | if (!em) { |
4939 | printk(KERN_ERR "btrfs: couldn't find em for chunk %Lu\n", | ||
4940 | chunk_start); | ||
4941 | return -EIO; | ||
4942 | } | ||
4943 | |||
4944 | if (em->start != chunk_start) { | ||
4945 | printk(KERN_ERR "btrfs: bad chunk start, em=%Lu, wanted=%Lu\n", | ||
4946 | em->start, chunk_start); | ||
4947 | free_extent_map(em); | ||
4948 | return -EIO; | ||
4949 | } | ||
4933 | map = (struct map_lookup *)em->bdev; | 4950 | map = (struct map_lookup *)em->bdev; |
4934 | 4951 | ||
4935 | length = em->len; | 4952 | length = em->len; |