diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index d96305e5cc93..f651a37c7e0a 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -2986,7 +2986,10 @@ static int write_dev_supers(struct btrfs_device *device, | |||
2986 | if (wait) { | 2986 | if (wait) { |
2987 | bh = __find_get_block(device->bdev, bytenr / 4096, | 2987 | bh = __find_get_block(device->bdev, bytenr / 4096, |
2988 | BTRFS_SUPER_INFO_SIZE); | 2988 | BTRFS_SUPER_INFO_SIZE); |
2989 | BUG_ON(!bh); | 2989 | if (!bh) { |
2990 | errors++; | ||
2991 | continue; | ||
2992 | } | ||
2990 | wait_on_buffer(bh); | 2993 | wait_on_buffer(bh); |
2991 | if (!buffer_uptodate(bh)) | 2994 | if (!buffer_uptodate(bh)) |
2992 | errors++; | 2995 | errors++; |
@@ -3013,6 +3016,13 @@ static int write_dev_supers(struct btrfs_device *device, | |||
3013 | */ | 3016 | */ |
3014 | bh = __getblk(device->bdev, bytenr / 4096, | 3017 | bh = __getblk(device->bdev, bytenr / 4096, |
3015 | BTRFS_SUPER_INFO_SIZE); | 3018 | BTRFS_SUPER_INFO_SIZE); |
3019 | if (!bh) { | ||
3020 | printk(KERN_ERR "btrfs: couldn't get super " | ||
3021 | "buffer head for bytenr %Lu\n", bytenr); | ||
3022 | errors++; | ||
3023 | continue; | ||
3024 | } | ||
3025 | |||
3016 | memcpy(bh->b_data, sb, BTRFS_SUPER_INFO_SIZE); | 3026 | memcpy(bh->b_data, sb, BTRFS_SUPER_INFO_SIZE); |
3017 | 3027 | ||
3018 | /* one reference for submit_bh */ | 3028 | /* one reference for submit_bh */ |