|
@@ -402,7 +402,10 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
|
|
|
}
|
|
|
|
|
|
ret = btrfs_map_bio(root, WRITE, bio, 0, 1);
|
|
|
- BUG_ON(ret); /* -ENOMEM */
|
|
|
+ if (ret) {
|
|
|
+ bio->bi_error = ret;
|
|
|
+ bio_endio(bio);
|
|
|
+ }
|
|
|
|
|
|
bio_put(bio);
|
|
|
|
|
@@ -432,7 +435,10 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
|
|
|
}
|
|
|
|
|
|
ret = btrfs_map_bio(root, WRITE, bio, 0, 1);
|
|
|
- BUG_ON(ret); /* -ENOMEM */
|
|
|
+ if (ret) {
|
|
|
+ bio->bi_error = ret;
|
|
|
+ bio_endio(bio);
|
|
|
+ }
|
|
|
|
|
|
bio_put(bio);
|
|
|
return 0;
|