block: switch bios to blk_status_t
Replace bi_error with a new bi_status to allow for a clear conversion. Note that device mapper overloaded bi_error with a private value, which we'll have to keep arround at least for now and thus propagate to a proper blk_status_t value. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:

committed by
Jens Axboe

parent
fc17b6534e
commit
4e4cbee93d
@@ -85,7 +85,7 @@ static void ext4_finish_bio(struct bio *bio)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (bio->bi_error) {
|
||||
if (bio->bi_status) {
|
||||
SetPageError(page);
|
||||
mapping_set_error(page->mapping, -EIO);
|
||||
}
|
||||
@@ -104,7 +104,7 @@ static void ext4_finish_bio(struct bio *bio)
|
||||
continue;
|
||||
}
|
||||
clear_buffer_async_write(bh);
|
||||
if (bio->bi_error)
|
||||
if (bio->bi_status)
|
||||
buffer_io_error(bh);
|
||||
} while ((bh = bh->b_this_page) != head);
|
||||
bit_spin_unlock(BH_Uptodate_Lock, &head->b_state);
|
||||
@@ -303,24 +303,25 @@ static void ext4_end_bio(struct bio *bio)
|
||||
bdevname(bio->bi_bdev, b),
|
||||
(long long) bio->bi_iter.bi_sector,
|
||||
(unsigned) bio_sectors(bio),
|
||||
bio->bi_error)) {
|
||||
bio->bi_status)) {
|
||||
ext4_finish_bio(bio);
|
||||
bio_put(bio);
|
||||
return;
|
||||
}
|
||||
bio->bi_end_io = NULL;
|
||||
|
||||
if (bio->bi_error) {
|
||||
if (bio->bi_status) {
|
||||
struct inode *inode = io_end->inode;
|
||||
|
||||
ext4_warning(inode->i_sb, "I/O error %d writing to inode %lu "
|
||||
"(offset %llu size %ld starting block %llu)",
|
||||
bio->bi_error, inode->i_ino,
|
||||
bio->bi_status, inode->i_ino,
|
||||
(unsigned long long) io_end->offset,
|
||||
(long) io_end->size,
|
||||
(unsigned long long)
|
||||
bi_sector >> (inode->i_blkbits - 9));
|
||||
mapping_set_error(inode->i_mapping, bio->bi_error);
|
||||
mapping_set_error(inode->i_mapping,
|
||||
blk_status_to_errno(bio->bi_status));
|
||||
}
|
||||
|
||||
if (io_end->flag & EXT4_IO_END_UNWRITTEN) {
|
||||
|
Reference in New Issue
Block a user