aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-04-18 18:00:41 -0400
committerTejun Heo <tj@kernel.org>2009-04-18 18:00:41 -0400
commit6f41469c627fe118121dfce2a8134ad24da3df28 (patch)
tree7e759568615dcc0e4a17d6ee079795dff2199d53
parent15da90b516e9da92cc1d90001e640fd6707d0e27 (diff)
block: clear req->errors on bio completion only for fs requests
Impact: subtle behavior change For fs requests, rq is only carrier of bios and rq error status as a whole doesn't mean much. This is the reason why rq->errors is being cleared on each partial completion of a request as on each partial completion the error status is transferred to the respective bios. For pc requests, rq->errors is used to carry error status to the issuer and thus __end_that_request_first() doesn't clear it on such cases. The condition was fine till now as only fs and pc requests have used bio and thus the bio completion path. However, future changes will unify data accesses to bio and all non fs users care about rq error status. Clear rq->errors on bio completion only for fs requests. In general, the implicit clearing is a bit too subtle especially as the meaning of rq->errors is completely dependent on low level drivers. Unifying / cleaning up rq->errors usage and letting llds manage it would be better. TODO comment added. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/blk-core.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 07ab75403e1a..cce7a88dc612 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1739,10 +1739,14 @@ static int __end_that_request_first(struct request *req, int error,
1739 trace_block_rq_complete(req->q, req); 1739 trace_block_rq_complete(req->q, req);
1740 1740
1741 /* 1741 /*
1742 * for a REQ_TYPE_BLOCK_PC request, we want to carry any eventual 1742 * For fs requests, rq is just carrier of independent bio's
1743 * sense key with us all the way through 1743 * and each partial completion should be handled separately.
1744 * Reset per-request error on each partial completion.
1745 *
1746 * TODO: tj: This is too subtle. It would be better to let
1747 * low level drivers do what they see fit.
1744 */ 1748 */
1745 if (!blk_pc_request(req)) 1749 if (blk_fs_request(req))
1746 req->errors = 0; 1750 req->errors = 0;
1747 1751
1748 if (error && (blk_fs_request(req) && !(req->cmd_flags & REQ_QUIET))) { 1752 if (error && (blk_fs_request(req) && !(req->cmd_flags & REQ_QUIET))) {