File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -107,17 +107,18 @@ static unsigned int bio_allowed_max_sectors(const struct queue_limits *lim)
107
107
108
108
static struct bio * bio_submit_split (struct bio * bio , int split_sectors )
109
109
{
110
- if (unlikely (split_sectors < 0 )) {
111
- bio -> bi_status = errno_to_blk_status (split_sectors );
112
- bio_endio (bio );
113
- return NULL ;
114
- }
110
+ if (unlikely (split_sectors < 0 ))
111
+ goto error ;
115
112
116
113
if (split_sectors ) {
117
114
struct bio * split ;
118
115
119
116
split = bio_split (bio , split_sectors , GFP_NOIO ,
120
117
& bio -> bi_bdev -> bd_disk -> bio_split );
118
+ if (IS_ERR (split )) {
119
+ split_sectors = PTR_ERR (split );
120
+ goto error ;
121
+ }
121
122
split -> bi_opf |= REQ_NOMERGE ;
122
123
blkcg_bio_issue_init (split );
123
124
bio_chain (split , bio );
@@ -128,6 +129,10 @@ static struct bio *bio_submit_split(struct bio *bio, int split_sectors)
128
129
}
129
130
130
131
return bio ;
132
+ error :
133
+ bio -> bi_status = errno_to_blk_status (split_sectors );
134
+ bio_endio (bio );
135
+ return NULL ;
131
136
}
132
137
133
138
struct bio * bio_split_discard (struct bio * bio , const struct queue_limits * lim ,
You can’t perform that action at this time.
0 commit comments