diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 7aa9cd36bf1b..534266fe505f 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -962,6 +962,13 @@ static int btree_releasepage(struct page *page, gfp_t gfp_flags) | |||
962 | tree = &BTRFS_I(page->mapping->host)->io_tree; | 962 | tree = &BTRFS_I(page->mapping->host)->io_tree; |
963 | map = &BTRFS_I(page->mapping->host)->extent_tree; | 963 | map = &BTRFS_I(page->mapping->host)->extent_tree; |
964 | 964 | ||
965 | /* | ||
966 | * We need to mask out eg. __GFP_HIGHMEM and __GFP_DMA32 as we're doing | ||
967 | * slab allocation from alloc_extent_state down the callchain where | ||
968 | * it'd hit a BUG_ON as those flags are not allowed. | ||
969 | */ | ||
970 | gfp_flags &= ~GFP_SLAB_BUG_MASK; | ||
971 | |||
965 | ret = try_release_extent_state(map, tree, page, gfp_flags); | 972 | ret = try_release_extent_state(map, tree, page, gfp_flags); |
966 | if (!ret) | 973 | if (!ret) |
967 | return 0; | 974 | return 0; |
@@ -2253,6 +2260,12 @@ int open_ctree(struct super_block *sb, | |||
2253 | goto fail_sb_buffer; | 2260 | goto fail_sb_buffer; |
2254 | } | 2261 | } |
2255 | 2262 | ||
2263 | if (sectorsize < PAGE_SIZE) { | ||
2264 | printk(KERN_WARNING "btrfs: Incompatible sector size " | ||
2265 | "found on %s\n", sb->s_id); | ||
2266 | goto fail_sb_buffer; | ||
2267 | } | ||
2268 | |||
2256 | mutex_lock(&fs_info->chunk_mutex); | 2269 | mutex_lock(&fs_info->chunk_mutex); |
2257 | ret = btrfs_read_sys_array(tree_root); | 2270 | ret = btrfs_read_sys_array(tree_root); |
2258 | mutex_unlock(&fs_info->chunk_mutex); | 2271 | mutex_unlock(&fs_info->chunk_mutex); |
@@ -2294,6 +2307,12 @@ int open_ctree(struct super_block *sb, | |||
2294 | 2307 | ||
2295 | btrfs_close_extra_devices(fs_devices); | 2308 | btrfs_close_extra_devices(fs_devices); |
2296 | 2309 | ||
2310 | if (!fs_devices->latest_bdev) { | ||
2311 | printk(KERN_CRIT "btrfs: failed to read devices on %s\n", | ||
2312 | sb->s_id); | ||
2313 | goto fail_tree_roots; | ||
2314 | } | ||
2315 | |||
2297 | retry_root_backup: | 2316 | retry_root_backup: |
2298 | blocksize = btrfs_level_size(tree_root, | 2317 | blocksize = btrfs_level_size(tree_root, |
2299 | btrfs_super_root_level(disk_super)); | 2318 | btrfs_super_root_level(disk_super)); |