Message ID | 4b575ac74fab6d233b891f8c12dadaea3873931c.1539282366.git.osandov@fb.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [01/13] swim: fix cleanup on setup error | expand |
On 10/11/18 12:30 PM, Omar Sandoval wrote: > From: Omar Sandoval <osandov@fb.com> > > If floppy_end_request() gets passed an error, it should end the whole > request, not just the current segment. I don't think this is correct, we should still just end the individual chunks.
On Thu, Oct 11, 2018 at 12:39:51PM -0600, Jens Axboe wrote: > On 10/11/18 12:30 PM, Omar Sandoval wrote: > > From: Omar Sandoval <osandov@fb.com> > > > > If floppy_end_request() gets passed an error, it should end the whole > > request, not just the current segment. > > I don't think this is correct, we should still just end the > individual chunks. Yup, I'll drop this and the swim3 equivalent, thanks.
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index f2b6f4da1034..acbafd831ea3 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -2210,13 +2210,15 @@ static int do_format(int drive, struct format_descr *tmp_format_req) static void floppy_end_request(struct request *req, blk_status_t error) { - unsigned int nr_sectors = current_count_sectors; + unsigned int nr_bytes; unsigned int drive = (unsigned long)req->rq_disk->private_data; /* current_count_sectors can be zero if transfer failed */ if (error) - nr_sectors = blk_rq_cur_sectors(req); - if (__blk_end_request(req, error, nr_sectors << 9)) + nr_bytes = blk_rq_bytes(req); + else + nr_bytes = current_count_sectors << 9; + if (__blk_end_request(req, error, nr_bytes)) return; /* We're done with the request */