Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed6565e7 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

block: handle partial completions for special payload requests



SCSI devices can return short writes on Write Same just like for normal
writes, so we need to handle this case for our special payload requests
as well.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reported-by: default avatarAbdul Haleem <abdhalee@linux.vnet.ibm.com>
Tested-by: default avatarAbdul Haleem <abdhalee@linux.vnet.ibm.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent f36ea50c
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -2644,8 +2644,6 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes)
		return false;
	}

	WARN_ON_ONCE(req->rq_flags & RQF_SPECIAL_PAYLOAD);

	req->__data_len -= total_bytes;

	/* update sector only for requests with clear definition of sector */
@@ -2658,6 +2656,7 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes)
		req->cmd_flags |= req->bio->bi_opf & REQ_FAILFAST_MASK;
	}

	if (!(req->rq_flags & RQF_SPECIAL_PAYLOAD)) {
		/*
		 * If total number of sectors is less than the first segment
		 * size, something has gone terribly wrong.
@@ -2669,6 +2668,7 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes)

		/* recalculate the number of segments */
		blk_recalc_rq_segments(req);
	}

	return true;
}