All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <1489613678.2660.9.camel@sandisk.com>

diff --git a/a/1.txt b/N1/1.txt
index 2af67a3..06afa7d 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -1,43 +1,32 @@
 On Thu, 2017-03-16 at 00:22 +0800, Ming Lei wrote:
 > On Wed, Mar 15, 2017 at 03:36:31PM +0000, Bart Van Assche wrote:
-> > Please have another look at __blk_mq_requeue_request(). In that functio=
-n
+> > Please have another look at __blk_mq_requeue_request(). In that function
 > > the following code occurs: if (test_and_clear_bit(REQ_ATOM_STARTED,
 > > &rq->atomic_flags)) { ... }
-> >=20
-> > I think the=A0REQ_ATOM_STARTED check in blk_mq_check_expired() races wi=
-th the
+> > 
+> > I think the REQ_ATOM_STARTED check in blk_mq_check_expired() races with the
 > > test_and_clear_bit(REQ_ATOM_STARTED, &rq->atomic_flags) call in
 > > __blk_mq_requeue_request().
->=20
-> OK, this race should only exist in case that the requeue happens after di=
-spatch
-> busy, because COMPLETE flag isn't set. And if the requeue is from io comp=
-letion,
+> 
+> OK, this race should only exist in case that the requeue happens after dispatch
+> busy, because COMPLETE flag isn't set. And if the requeue is from io completion,
 > no such race because COMPLETE flag is set.
->=20
-> One solution I thought of is to call blk_mark_rq_complete() before requeu=
-ing
-> when dispatch busy happened, but that looks a bit silly. Another way is t=
-o
-> set STARTED flag just after .queue_rq returns BLK_MQ_RQ_QUEUE_OK, which l=
-ooks
+> 
+> One solution I thought of is to call blk_mark_rq_complete() before requeuing
+> when dispatch busy happened, but that looks a bit silly. Another way is to
+> set STARTED flag just after .queue_rq returns BLK_MQ_RQ_QUEUE_OK, which looks
 > reasonable too. Any comments on the 2nd solution?
 
 Sorry but I don't think that would be sufficient. There are several other
-scenarios that have not been mentioned above, e.g. that a tag gets freed an=
-d
-reused after the blk_mq_check_expired() call started and before that functi=
-on
-has had the chance to examine any members of struct request. What is needed=
- in
+scenarios that have not been mentioned above, e.g. that a tag gets freed and
+reused after the blk_mq_check_expired() call started and before that function
+has had the chance to examine any members of struct request. What is needed in
 blk_mq_check_expired() is the following as a single atomic operation:
 * Check whether REQ_ATOM_STARTED has been set.
 * Check whether REQ_ATOM_COMPLETE has not yet been set.
 * If both conditions have been met, set REQ_ATOM_COMPLETE.
 
-I don't think there is another solution than using a single state variable =
-to
+I don't think there is another solution than using a single state variable to
 represent the REQ_ATOM_STARTED and REQ_ATOM_COMPLETE states instead of two
 independent bits. How about the patch below?
 
@@ -55,156 +44,149 @@ __blk_mq_finish_request() perform the transition from "complete" to
 blk_mq_check_expired() uses a single atomic operation to test the
 "started" and "complete" states and to set the "complete" state.
 ---
-=A0block/blk-core.c=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0|=A0=A06 +++--
-=A0block/blk-mq.c=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0| 67 ++++++++++++++=
-+++-----------------------------
-=A0block/blk-timeout.c=A0=A0=A0=A0=A0=A0=A0=A0|=A0=A02 +-
-=A0block/blk.h=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0| 21 ++++++++=
-++-----
-=A0drivers/scsi/virtio_scsi.c |=A0=A02 +-
-=A0include/linux/blkdev.h=A0=A0=A0=A0=A0|=A0=A01 +
-=A06 files changed, 47 insertions(+), 52 deletions(-)
+ block/blk-core.c           |  6 +++--
+ block/blk-mq.c             | 67 +++++++++++++++++-----------------------------
+ block/blk-timeout.c        |  2 +-
+ block/blk.h                | 21 ++++++++++-----
+ drivers/scsi/virtio_scsi.c |  2 +-
+ include/linux/blkdev.h     |  1 +
+ 6 files changed, 47 insertions(+), 52 deletions(-)
 
 diff --git a/block/blk-core.c b/block/blk-core.c
 index 0eeb99ef654f..dff857d2b86b 100644
 --- a/block/blk-core.c
 +++ b/block/blk-core.c
 @@ -1305,7 +1305,7 @@ EXPORT_SYMBOL(blk_get_request);
-=A0void blk_requeue_request(struct request_queue *q, struct request *rq)
-=A0{
-=A0	blk_delete_timer(rq);
+ void blk_requeue_request(struct request_queue *q, struct request *rq)
+ {
+ 	blk_delete_timer(rq);
 -	blk_clear_rq_complete(rq);
 +	atomic_set(&rq->state, REQ_NOT_STARTED);
-=A0	trace_block_rq_requeue(q, rq);
-=A0	wbt_requeue(q->rq_wb, &rq->issue_stat);
-=A0
+ 	trace_block_rq_requeue(q, rq);
+ 	wbt_requeue(q->rq_wb, &rq->issue_stat);
+ 
 @@ -2477,7 +2477,9 @@ void blk_start_request(struct request *req)
-=A0		wbt_issue(req->q->rq_wb, &req->issue_stat);
-=A0	}
-=A0
+ 		wbt_issue(req->q->rq_wb, &req->issue_stat);
+ 	}
+ 
 -	BUG_ON(test_bit(REQ_ATOM_COMPLETE, &req->atomic_flags));
-+	WARN_ONCE(atomic_read(&req->state) !=3D REQ_NOT_STARTED,
-+		=A0=A0"unexpected request state %d !=3D %d\n",
-+		=A0=A0atomic_read(&req->state), REQ_NOT_STARTED);
-=A0	blk_add_timer(req);
-=A0}
-=A0EXPORT_SYMBOL(blk_start_request);
++	WARN_ONCE(atomic_read(&req->state) != REQ_NOT_STARTED,
++		  "unexpected request state %d != %d\n",
++		  atomic_read(&req->state), REQ_NOT_STARTED);
+ 	blk_add_timer(req);
+ }
+ EXPORT_SYMBOL(blk_start_request);
 diff --git a/block/blk-mq.c b/block/blk-mq.c
 index 159187a28d66..fe73d5a1ffc3 100644
 --- a/block/blk-mq.c
 +++ b/block/blk-mq.c
-@@ -343,7 +343,7 @@ void __blk_mq_finish_request(struct blk_mq_hw_ctx *hctx=
-, struct blk_mq_ctx *ctx,
-=A0	wbt_done(q->rq_wb, &rq->issue_stat);
-=A0	rq->rq_flags =3D 0;
-=A0
+@@ -343,7 +343,7 @@ void __blk_mq_finish_request(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx,
+ 	wbt_done(q->rq_wb, &rq->issue_stat);
+ 	rq->rq_flags = 0;
+ 
 -	clear_bit(REQ_ATOM_STARTED, &rq->atomic_flags);
 +	atomic_set(&rq->state, REQ_NOT_STARTED);
-=A0	clear_bit(REQ_ATOM_POLL_SLEPT, &rq->atomic_flags);
-=A0	if (rq->tag !=3D -1)
-=A0		blk_mq_put_tag(hctx, hctx->tags, ctx, rq->tag);
+ 	clear_bit(REQ_ATOM_POLL_SLEPT, &rq->atomic_flags);
+ 	if (rq->tag != -1)
+ 		blk_mq_put_tag(hctx, hctx->tags, ctx, rq->tag);
 @@ -479,7 +479,7 @@ EXPORT_SYMBOL(blk_mq_complete_request);
-=A0
-=A0int blk_mq_request_started(struct request *rq)
-=A0{
+ 
+ int blk_mq_request_started(struct request *rq)
+ {
 -	return test_bit(REQ_ATOM_STARTED, &rq->atomic_flags);
-+	return atomic_read(&rq->state) =3D=3D REQ_STARTED;
-=A0}
-=A0EXPORT_SYMBOL_GPL(blk_mq_request_started);
-=A0
++	return atomic_read(&rq->state) == REQ_STARTED;
+ }
+ EXPORT_SYMBOL_GPL(blk_mq_request_started);
+ 
 @@ -505,16 +505,10 @@ void blk_mq_start_request(struct request *rq)
-=A0	=A0*/
-=A0	smp_mb__before_atomic();
-=A0
+ 	 */
+ 	smp_mb__before_atomic();
+ 
 -	/*
--	=A0* Mark us as started and clear complete. Complete might have been
--	=A0* set if requeue raced with timeout, which then marked it as
--	=A0* complete. So be sure to clear complete again when we start
--	=A0* the request, otherwise we'll ignore the completion event.
--	=A0*/
+-	 * Mark us as started and clear complete. Complete might have been
+-	 * set if requeue raced with timeout, which then marked it as
+-	 * complete. So be sure to clear complete again when we start
+-	 * the request, otherwise we'll ignore the completion event.
+-	 */
 -	if (!test_bit(REQ_ATOM_STARTED, &rq->atomic_flags))
 -		set_bit(REQ_ATOM_STARTED, &rq->atomic_flags);
 -	if (test_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags))
 -		clear_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags);
-+	WARN_ONCE(atomic_read(&rq->state) !=3D REQ_NOT_STARTED,
-+		=A0=A0"unexpected request state %d !=3D %d\n",
-+		=A0=A0atomic_read(&rq->state), REQ_NOT_STARTED);
++	WARN_ONCE(atomic_read(&rq->state) != REQ_NOT_STARTED,
++		  "unexpected request state %d != %d\n",
++		  atomic_read(&rq->state), REQ_NOT_STARTED);
 +	atomic_set(&rq->state, REQ_STARTED);
-=A0
-=A0	if (q->dma_drain_size && blk_rq_bytes(rq)) {
-=A0		/*
+ 
+ 	if (q->dma_drain_size && blk_rq_bytes(rq)) {
+ 		/*
 @@ -530,12 +524,14 @@ EXPORT_SYMBOL(blk_mq_start_request);
-=A0static void __blk_mq_requeue_request(struct request *rq)
-=A0{
-=A0	struct request_queue *q =3D rq->q;
+ static void __blk_mq_requeue_request(struct request *rq)
+ {
+ 	struct request_queue *q = rq->q;
 +	enum rq_state prev;
-=A0
-=A0	trace_block_rq_requeue(q, rq);
-=A0	wbt_requeue(q->rq_wb, &rq->issue_stat);
-=A0	blk_mq_sched_requeue_request(rq);
-=A0
+ 
+ 	trace_block_rq_requeue(q, rq);
+ 	wbt_requeue(q->rq_wb, &rq->issue_stat);
+ 	blk_mq_sched_requeue_request(rq);
+ 
 -	if (test_and_clear_bit(REQ_ATOM_STARTED, &rq->atomic_flags)) {
-+	prev =3D atomic_xchg(&rq->state, REQ_NOT_STARTED);
-+	if (prev !=3D REQ_NOT_STARTED) {
-=A0		if (q->dma_drain_size && blk_rq_bytes(rq))
-=A0			rq->nr_phys_segments--;
-=A0	}
-@@ -661,17 +657,7 @@ void blk_mq_rq_timed_out(struct request *req, bool res=
-erved)
-=A0	const struct blk_mq_ops *ops =3D req->q->mq_ops;
-=A0	enum blk_eh_timer_return ret =3D BLK_EH_RESET_TIMER;
-=A0
++	prev = atomic_xchg(&rq->state, REQ_NOT_STARTED);
++	if (prev != REQ_NOT_STARTED) {
+ 		if (q->dma_drain_size && blk_rq_bytes(rq))
+ 			rq->nr_phys_segments--;
+ 	}
+@@ -661,17 +657,7 @@ void blk_mq_rq_timed_out(struct request *req, bool reserved)
+ 	const struct blk_mq_ops *ops = req->q->mq_ops;
+ 	enum blk_eh_timer_return ret = BLK_EH_RESET_TIMER;
+ 
 -	/*
--	=A0* We know that complete is set at this point. If STARTED isn't set
--	=A0* anymore, then the request isn't active and the "timeout" should
--	=A0* just be ignored. This can happen due to the bitflag ordering.
--	=A0* Timeout first checks if STARTED is set, and if it is, assumes
--	=A0* the request is active. But if we race with completion, then
--	=A0* we both flags will get cleared. So check here again, and ignore
--	=A0* a timeout event with a request that isn't active.
--	=A0*/
+-	 * We know that complete is set at this point. If STARTED isn't set
+-	 * anymore, then the request isn't active and the "timeout" should
+-	 * just be ignored. This can happen due to the bitflag ordering.
+-	 * Timeout first checks if STARTED is set, and if it is, assumes
+-	 * the request is active. But if we race with completion, then
+-	 * we both flags will get cleared. So check here again, and ignore
+-	 * a timeout event with a request that isn't active.
+-	 */
 -	if (!test_bit(REQ_ATOM_STARTED, &req->atomic_flags))
 -		return;
-+	WARN_ON_ONCE(atomic_read(&req->state) !=3D REQ_COMPLETE);
-=A0
-=A0	if (ops->timeout)
-=A0		ret =3D ops->timeout(req, reserved);
-@@ -682,7 +668,7 @@ void blk_mq_rq_timed_out(struct request *req, bool rese=
-rved)
-=A0		break;
-=A0	case BLK_EH_RESET_TIMER:
-=A0		blk_add_timer(req);
++	WARN_ON_ONCE(atomic_read(&req->state) != REQ_COMPLETE);
+ 
+ 	if (ops->timeout)
+ 		ret = ops->timeout(req, reserved);
+@@ -682,7 +668,7 @@ void blk_mq_rq_timed_out(struct request *req, bool reserved)
+ 		break;
+ 	case BLK_EH_RESET_TIMER:
+ 		blk_add_timer(req);
 -		blk_clear_rq_complete(req);
 +		atomic_set(&req->state, REQ_STARTED);
-=A0		break;
-=A0	case BLK_EH_NOT_HANDLED:
-=A0		break;
-@@ -692,27 +678,24 @@ void blk_mq_rq_timed_out(struct request *req, bool re=
-served)
-=A0	}
-=A0}
-=A0
+ 		break;
+ 	case BLK_EH_NOT_HANDLED:
+ 		break;
+@@ -692,27 +678,24 @@ void blk_mq_rq_timed_out(struct request *req, bool reserved)
+ 	}
+ }
+ 
 +/*
 + * Check whether or not a request has expired. This function can execute
-+ * concurrently with other functions that change the request state. This c=
-an
++ * concurrently with other functions that change the request state. This can
 + * result in returning a deadline (blk_mq_timeout_data.next) that occurs
 + * before a request times out. However, this is harmless because the next
 + * call of blk_mq_queue_tag_busy_iter(q, blk_mq_check_expired, &data) will
 + * yield the correct timeout, unless the same race occurs again.
 + */
-=A0static void blk_mq_check_expired(struct blk_mq_hw_ctx *hctx,
-=A0		struct request *rq, void *priv, bool reserved)
-=A0{
-=A0	struct blk_mq_timeout_data *data =3D priv;
-=A0
+ static void blk_mq_check_expired(struct blk_mq_hw_ctx *hctx,
+ 		struct request *rq, void *priv, bool reserved)
+ {
+ 	struct blk_mq_timeout_data *data = priv;
+ 
 -	if (!test_bit(REQ_ATOM_STARTED, &rq->atomic_flags)) {
 -		/*
--		=A0* If a request wasn't started before the queue was
--		=A0* marked dying, kill it here or it'll go unnoticed.
--		=A0*/
+-		 * If a request wasn't started before the queue was
+-		 * marked dying, kill it here or it'll go unnoticed.
+-		 */
 -		if (unlikely(blk_queue_dying(rq->q))) {
--			rq->errors =3D -EIO;
+-			rq->errors = -EIO;
 -			blk_mq_end_request(rq, rq->errors);
 -		}
 -		return;
@@ -215,50 +197,49 @@ an
 -			blk_mq_rq_timed_out(rq, reserved);
 -	} else if (!data->next_set || time_after(data->next, rq->deadline)) {
 +	if (time_after_eq(jiffies, rq->deadline) &&
-+	=A0=A0=A0=A0!blk_mark_rq_complete_if_started(rq)) {
++	    !blk_mark_rq_complete_if_started(rq)) {
 +		blk_mq_rq_timed_out(rq, reserved);
 +	} else if ((!data->next_set || time_after(data->next, rq->deadline)) &&
-+		=A0=A0=A0blk_mq_request_started(rq)) {
-=A0		data->next =3D rq->deadline;
-=A0		data->next_set =3D 1;
-=A0	}
-@@ -2821,7 +2804,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_q=
-ueue *q,
-=A0
-=A0	hrtimer_init_sleeper(&hs, current);
-=A0	do {
++		   blk_mq_request_started(rq)) {
+ 		data->next = rq->deadline;
+ 		data->next_set = 1;
+ 	}
+@@ -2821,7 +2804,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
+ 
+ 	hrtimer_init_sleeper(&hs, current);
+ 	do {
 -		if (test_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags))
-+		if (atomic_read(&rq->state) =3D=3D REQ_COMPLETE)
-=A0			break;
-=A0		set_current_state(TASK_UNINTERRUPTIBLE);
-=A0		hrtimer_start_expires(&hs.timer, mode);
++		if (atomic_read(&rq->state) == REQ_COMPLETE)
+ 			break;
+ 		set_current_state(TASK_UNINTERRUPTIBLE);
+ 		hrtimer_start_expires(&hs.timer, mode);
 diff --git a/block/blk-timeout.c b/block/blk-timeout.c
 index a30441a200c0..9a8b44ebfb99 100644
 --- a/block/blk-timeout.c
 +++ b/block/blk-timeout.c
 @@ -94,7 +94,7 @@ static void blk_rq_timed_out(struct request *req)
-=A0		break;
-=A0	case BLK_EH_RESET_TIMER:
-=A0		blk_add_timer(req);
+ 		break;
+ 	case BLK_EH_RESET_TIMER:
+ 		blk_add_timer(req);
 -		blk_clear_rq_complete(req);
 +		atomic_set(&req->state, REQ_NOT_STARTED);
-=A0		break;
-=A0	case BLK_EH_NOT_HANDLED:
-=A0		/*
+ 		break;
+ 	case BLK_EH_NOT_HANDLED:
+ 		/*
 diff --git a/block/blk.h b/block/blk.h
 index d1ea4bd9b9a3..8af5fe21e85f 100644
 --- a/block/blk.h
 +++ b/block/blk.h
 @@ -115,23 +115,32 @@ void blk_account_io_done(struct request *req);
-=A0 * Internal atomic flags for request handling
-=A0 */
-=A0enum rq_atomic_flags {
--	REQ_ATOM_COMPLETE =3D 0,
+  * Internal atomic flags for request handling
+  */
+ enum rq_atomic_flags {
+-	REQ_ATOM_COMPLETE = 0,
 -	REQ_ATOM_STARTED,
-=A0	REQ_ATOM_POLL_SLEPT,
-=A0};
-=A0
-=A0/*
+ 	REQ_ATOM_POLL_SLEPT,
+ };
+ 
+ /*
 + * Request states. Note: REQ_STARTED is only used by the blk-mq code.
 + */
 +enum rq_state {
@@ -268,52 +249,50 @@ index d1ea4bd9b9a3..8af5fe21e85f 100644
 +};
 +
 +/*
-=A0 * EH timer and IO completion will both attempt to 'grab' the request, m=
-ake
+  * EH timer and IO completion will both attempt to 'grab' the request, make
 - * sure that only one of them succeeds
 + * sure that only one of them succeeds. The return value 0 means that this
 + * function changed the request state from "not complete" into "complete".
-=A0 */
-=A0static inline int blk_mark_rq_complete(struct request *rq)
-=A0{
+  */
+ static inline int blk_mark_rq_complete(struct request *rq)
+ {
 -	return test_and_set_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags);
-+	return atomic_xchg(&rq->state, REQ_COMPLETE) =3D=3D REQ_COMPLETE;
-=A0}
-=A0
++	return atomic_xchg(&rq->state, REQ_COMPLETE) == REQ_COMPLETE;
+ }
+ 
 -static inline void blk_clear_rq_complete(struct request *rq)
 +static inline int blk_mark_rq_complete_if_started(struct request *rq)
-=A0{
+ {
 -	clear_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags);
-+	return atomic_cmpxchg(&rq->state, REQ_STARTED, REQ_COMPLETE) !=3D
++	return atomic_cmpxchg(&rq->state, REQ_STARTED, REQ_COMPLETE) !=
 +		REQ_STARTED;
-=A0}
-=A0
-=A0/*
+ }
+ 
+ /*
 diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
 index 939c47df73fa..136379097131 100644
 --- a/drivers/scsi/virtio_scsi.c
 +++ b/drivers/scsi/virtio_scsi.c
-@@ -672,7 +672,7 @@ static int virtscsi_tmf(struct virtio_scsi *vscsi, stru=
-ct virtio_scsi_cmd *cmd)
-=A0	=A0*
-=A0	=A0* In the abort case, sc->scsi_done will do nothing, because
-=A0	=A0* the block layer must have detected a timeout and as a result
--	=A0* REQ_ATOM_COMPLETE has been set.
-+	=A0* rq->state =3D=3D REQ_COMPLETED.
-=A0	=A0*/
-=A0	virtscsi_poll_requests(vscsi);
-=A0
+@@ -672,7 +672,7 @@ static int virtscsi_tmf(struct virtio_scsi *vscsi, struct virtio_scsi_cmd *cmd)
+ 	 *
+ 	 * In the abort case, sc->scsi_done will do nothing, because
+ 	 * the block layer must have detected a timeout and as a result
+-	 * REQ_ATOM_COMPLETE has been set.
++	 * rq->state == REQ_COMPLETED.
+ 	 */
+ 	virtscsi_poll_requests(vscsi);
+ 
 diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
 index 5a7da607ca04..b286887b095e 100644
 --- a/include/linux/blkdev.h
 +++ b/include/linux/blkdev.h
 @@ -142,6 +142,7 @@ struct request {
-=A0
-=A0	int internal_tag;
-=A0
+ 
+ 	int internal_tag;
+ 
 +	atomic_t state;
-=A0	unsigned long atomic_flags;
-=A0
-=A0	/* the following two fields are internal, NEVER access directly */
---=A0
+ 	unsigned long atomic_flags;
+ 
+ 	/* the following two fields are internal, NEVER access directly */
+-- 
 2.12.0
diff --git a/a/content_digest b/N1/content_digest
index 4066677..cfa8f5c 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -19,44 +19,33 @@
  "b\0"
  "On Thu, 2017-03-16 at 00:22 +0800, Ming Lei wrote:\n"
  "> On Wed, Mar 15, 2017 at 03:36:31PM +0000, Bart Van Assche wrote:\n"
- "> > Please have another look at __blk_mq_requeue_request(). In that functio=\n"
- "n\n"
+ "> > Please have another look at __blk_mq_requeue_request(). In that function\n"
  "> > the following code occurs: if (test_and_clear_bit(REQ_ATOM_STARTED,\n"
  "> > &rq->atomic_flags)) { ... }\n"
- "> >=20\n"
- "> > I think the=A0REQ_ATOM_STARTED check in blk_mq_check_expired() races wi=\n"
- "th the\n"
+ "> > \n"
+ "> > I think the\302\240REQ_ATOM_STARTED check in blk_mq_check_expired() races with the\n"
  "> > test_and_clear_bit(REQ_ATOM_STARTED, &rq->atomic_flags) call in\n"
  "> > __blk_mq_requeue_request().\n"
- ">=20\n"
- "> OK, this race should only exist in case that the requeue happens after di=\n"
- "spatch\n"
- "> busy, because COMPLETE flag isn't set. And if the requeue is from io comp=\n"
- "letion,\n"
+ "> \n"
+ "> OK, this race should only exist in case that the requeue happens after dispatch\n"
+ "> busy, because COMPLETE flag isn't set. And if the requeue is from io completion,\n"
  "> no such race because COMPLETE flag is set.\n"
- ">=20\n"
- "> One solution I thought of is to call blk_mark_rq_complete() before requeu=\n"
- "ing\n"
- "> when dispatch busy happened, but that looks a bit silly. Another way is t=\n"
- "o\n"
- "> set STARTED flag just after .queue_rq returns BLK_MQ_RQ_QUEUE_OK, which l=\n"
- "ooks\n"
+ "> \n"
+ "> One solution I thought of is to call blk_mark_rq_complete() before requeuing\n"
+ "> when dispatch busy happened, but that looks a bit silly. Another way is to\n"
+ "> set STARTED flag just after .queue_rq returns BLK_MQ_RQ_QUEUE_OK, which looks\n"
  "> reasonable too. Any comments on the 2nd solution?\n"
  "\n"
  "Sorry but I don't think that would be sufficient. There are several other\n"
- "scenarios that have not been mentioned above, e.g. that a tag gets freed an=\n"
- "d\n"
- "reused after the blk_mq_check_expired() call started and before that functi=\n"
- "on\n"
- "has had the chance to examine any members of struct request. What is needed=\n"
- " in\n"
+ "scenarios that have not been mentioned above, e.g. that a tag gets freed and\n"
+ "reused after the blk_mq_check_expired() call started and before that function\n"
+ "has had the chance to examine any members of struct request. What is needed in\n"
  "blk_mq_check_expired() is the following as a single atomic operation:\n"
  "* Check whether REQ_ATOM_STARTED has been set.\n"
  "* Check whether REQ_ATOM_COMPLETE has not yet been set.\n"
  "* If both conditions have been met, set REQ_ATOM_COMPLETE.\n"
  "\n"
- "I don't think there is another solution than using a single state variable =\n"
- "to\n"
+ "I don't think there is another solution than using a single state variable to\n"
  "represent the REQ_ATOM_STARTED and REQ_ATOM_COMPLETE states instead of two\n"
  "independent bits. How about the patch below?\n"
  "\n"
@@ -74,156 +63,149 @@
  "blk_mq_check_expired() uses a single atomic operation to test the\n"
  "\"started\" and \"complete\" states and to set the \"complete\" state.\n"
  "---\n"
- "=A0block/blk-core.c=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0|=A0=A06 +++--\n"
- "=A0block/blk-mq.c=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0| 67 ++++++++++++++=\n"
- "+++-----------------------------\n"
- "=A0block/blk-timeout.c=A0=A0=A0=A0=A0=A0=A0=A0|=A0=A02 +-\n"
- "=A0block/blk.h=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0| 21 ++++++++=\n"
- "++-----\n"
- "=A0drivers/scsi/virtio_scsi.c |=A0=A02 +-\n"
- "=A0include/linux/blkdev.h=A0=A0=A0=A0=A0|=A0=A01 +\n"
- "=A06 files changed, 47 insertions(+), 52 deletions(-)\n"
+ "\302\240block/blk-core.c\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240|\302\240\302\2406 +++--\n"
+ "\302\240block/blk-mq.c\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240| 67 +++++++++++++++++-----------------------------\n"
+ "\302\240block/blk-timeout.c\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240|\302\240\302\2402 +-\n"
+ "\302\240block/blk.h\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240| 21 ++++++++++-----\n"
+ "\302\240drivers/scsi/virtio_scsi.c |\302\240\302\2402 +-\n"
+ "\302\240include/linux/blkdev.h\302\240\302\240\302\240\302\240\302\240|\302\240\302\2401 +\n"
+ "\302\2406 files changed, 47 insertions(+), 52 deletions(-)\n"
  "\n"
  "diff --git a/block/blk-core.c b/block/blk-core.c\n"
  "index 0eeb99ef654f..dff857d2b86b 100644\n"
  "--- a/block/blk-core.c\n"
  "+++ b/block/blk-core.c\n"
  "@@ -1305,7 +1305,7 @@ EXPORT_SYMBOL(blk_get_request);\n"
- "=A0void blk_requeue_request(struct request_queue *q, struct request *rq)\n"
- "=A0{\n"
- "=A0\tblk_delete_timer(rq);\n"
+ "\302\240void blk_requeue_request(struct request_queue *q, struct request *rq)\n"
+ "\302\240{\n"
+ "\302\240\tblk_delete_timer(rq);\n"
  "-\tblk_clear_rq_complete(rq);\n"
  "+\tatomic_set(&rq->state, REQ_NOT_STARTED);\n"
- "=A0\ttrace_block_rq_requeue(q, rq);\n"
- "=A0\twbt_requeue(q->rq_wb, &rq->issue_stat);\n"
- "=A0\n"
+ "\302\240\ttrace_block_rq_requeue(q, rq);\n"
+ "\302\240\twbt_requeue(q->rq_wb, &rq->issue_stat);\n"
+ "\302\240\n"
  "@@ -2477,7 +2477,9 @@ void blk_start_request(struct request *req)\n"
- "=A0\t\twbt_issue(req->q->rq_wb, &req->issue_stat);\n"
- "=A0\t}\n"
- "=A0\n"
+ "\302\240\t\twbt_issue(req->q->rq_wb, &req->issue_stat);\n"
+ "\302\240\t}\n"
+ "\302\240\n"
  "-\tBUG_ON(test_bit(REQ_ATOM_COMPLETE, &req->atomic_flags));\n"
- "+\tWARN_ONCE(atomic_read(&req->state) !=3D REQ_NOT_STARTED,\n"
- "+\t\t=A0=A0\"unexpected request state %d !=3D %d\\n\",\n"
- "+\t\t=A0=A0atomic_read(&req->state), REQ_NOT_STARTED);\n"
- "=A0\tblk_add_timer(req);\n"
- "=A0}\n"
- "=A0EXPORT_SYMBOL(blk_start_request);\n"
+ "+\tWARN_ONCE(atomic_read(&req->state) != REQ_NOT_STARTED,\n"
+ "+\t\t\302\240\302\240\"unexpected request state %d != %d\\n\",\n"
+ "+\t\t\302\240\302\240atomic_read(&req->state), REQ_NOT_STARTED);\n"
+ "\302\240\tblk_add_timer(req);\n"
+ "\302\240}\n"
+ "\302\240EXPORT_SYMBOL(blk_start_request);\n"
  "diff --git a/block/blk-mq.c b/block/blk-mq.c\n"
  "index 159187a28d66..fe73d5a1ffc3 100644\n"
  "--- a/block/blk-mq.c\n"
  "+++ b/block/blk-mq.c\n"
- "@@ -343,7 +343,7 @@ void __blk_mq_finish_request(struct blk_mq_hw_ctx *hctx=\n"
- ", struct blk_mq_ctx *ctx,\n"
- "=A0\twbt_done(q->rq_wb, &rq->issue_stat);\n"
- "=A0\trq->rq_flags =3D 0;\n"
- "=A0\n"
+ "@@ -343,7 +343,7 @@ void __blk_mq_finish_request(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx,\n"
+ "\302\240\twbt_done(q->rq_wb, &rq->issue_stat);\n"
+ "\302\240\trq->rq_flags = 0;\n"
+ "\302\240\n"
  "-\tclear_bit(REQ_ATOM_STARTED, &rq->atomic_flags);\n"
  "+\tatomic_set(&rq->state, REQ_NOT_STARTED);\n"
- "=A0\tclear_bit(REQ_ATOM_POLL_SLEPT, &rq->atomic_flags);\n"
- "=A0\tif (rq->tag !=3D -1)\n"
- "=A0\t\tblk_mq_put_tag(hctx, hctx->tags, ctx, rq->tag);\n"
+ "\302\240\tclear_bit(REQ_ATOM_POLL_SLEPT, &rq->atomic_flags);\n"
+ "\302\240\tif (rq->tag != -1)\n"
+ "\302\240\t\tblk_mq_put_tag(hctx, hctx->tags, ctx, rq->tag);\n"
  "@@ -479,7 +479,7 @@ EXPORT_SYMBOL(blk_mq_complete_request);\n"
- "=A0\n"
- "=A0int blk_mq_request_started(struct request *rq)\n"
- "=A0{\n"
+ "\302\240\n"
+ "\302\240int blk_mq_request_started(struct request *rq)\n"
+ "\302\240{\n"
  "-\treturn test_bit(REQ_ATOM_STARTED, &rq->atomic_flags);\n"
- "+\treturn atomic_read(&rq->state) =3D=3D REQ_STARTED;\n"
- "=A0}\n"
- "=A0EXPORT_SYMBOL_GPL(blk_mq_request_started);\n"
- "=A0\n"
+ "+\treturn atomic_read(&rq->state) == REQ_STARTED;\n"
+ "\302\240}\n"
+ "\302\240EXPORT_SYMBOL_GPL(blk_mq_request_started);\n"
+ "\302\240\n"
  "@@ -505,16 +505,10 @@ void blk_mq_start_request(struct request *rq)\n"
- "=A0\t=A0*/\n"
- "=A0\tsmp_mb__before_atomic();\n"
- "=A0\n"
+ "\302\240\t\302\240*/\n"
+ "\302\240\tsmp_mb__before_atomic();\n"
+ "\302\240\n"
  "-\t/*\n"
- "-\t=A0* Mark us as started and clear complete. Complete might have been\n"
- "-\t=A0* set if requeue raced with timeout, which then marked it as\n"
- "-\t=A0* complete. So be sure to clear complete again when we start\n"
- "-\t=A0* the request, otherwise we'll ignore the completion event.\n"
- "-\t=A0*/\n"
+ "-\t\302\240* Mark us as started and clear complete. Complete might have been\n"
+ "-\t\302\240* set if requeue raced with timeout, which then marked it as\n"
+ "-\t\302\240* complete. So be sure to clear complete again when we start\n"
+ "-\t\302\240* the request, otherwise we'll ignore the completion event.\n"
+ "-\t\302\240*/\n"
  "-\tif (!test_bit(REQ_ATOM_STARTED, &rq->atomic_flags))\n"
  "-\t\tset_bit(REQ_ATOM_STARTED, &rq->atomic_flags);\n"
  "-\tif (test_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags))\n"
  "-\t\tclear_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags);\n"
- "+\tWARN_ONCE(atomic_read(&rq->state) !=3D REQ_NOT_STARTED,\n"
- "+\t\t=A0=A0\"unexpected request state %d !=3D %d\\n\",\n"
- "+\t\t=A0=A0atomic_read(&rq->state), REQ_NOT_STARTED);\n"
+ "+\tWARN_ONCE(atomic_read(&rq->state) != REQ_NOT_STARTED,\n"
+ "+\t\t\302\240\302\240\"unexpected request state %d != %d\\n\",\n"
+ "+\t\t\302\240\302\240atomic_read(&rq->state), REQ_NOT_STARTED);\n"
  "+\tatomic_set(&rq->state, REQ_STARTED);\n"
- "=A0\n"
- "=A0\tif (q->dma_drain_size && blk_rq_bytes(rq)) {\n"
- "=A0\t\t/*\n"
+ "\302\240\n"
+ "\302\240\tif (q->dma_drain_size && blk_rq_bytes(rq)) {\n"
+ "\302\240\t\t/*\n"
  "@@ -530,12 +524,14 @@ EXPORT_SYMBOL(blk_mq_start_request);\n"
- "=A0static void __blk_mq_requeue_request(struct request *rq)\n"
- "=A0{\n"
- "=A0\tstruct request_queue *q =3D rq->q;\n"
+ "\302\240static void __blk_mq_requeue_request(struct request *rq)\n"
+ "\302\240{\n"
+ "\302\240\tstruct request_queue *q = rq->q;\n"
  "+\tenum rq_state prev;\n"
- "=A0\n"
- "=A0\ttrace_block_rq_requeue(q, rq);\n"
- "=A0\twbt_requeue(q->rq_wb, &rq->issue_stat);\n"
- "=A0\tblk_mq_sched_requeue_request(rq);\n"
- "=A0\n"
+ "\302\240\n"
+ "\302\240\ttrace_block_rq_requeue(q, rq);\n"
+ "\302\240\twbt_requeue(q->rq_wb, &rq->issue_stat);\n"
+ "\302\240\tblk_mq_sched_requeue_request(rq);\n"
+ "\302\240\n"
  "-\tif (test_and_clear_bit(REQ_ATOM_STARTED, &rq->atomic_flags)) {\n"
- "+\tprev =3D atomic_xchg(&rq->state, REQ_NOT_STARTED);\n"
- "+\tif (prev !=3D REQ_NOT_STARTED) {\n"
- "=A0\t\tif (q->dma_drain_size && blk_rq_bytes(rq))\n"
- "=A0\t\t\trq->nr_phys_segments--;\n"
- "=A0\t}\n"
- "@@ -661,17 +657,7 @@ void blk_mq_rq_timed_out(struct request *req, bool res=\n"
- "erved)\n"
- "=A0\tconst struct blk_mq_ops *ops =3D req->q->mq_ops;\n"
- "=A0\tenum blk_eh_timer_return ret =3D BLK_EH_RESET_TIMER;\n"
- "=A0\n"
+ "+\tprev = atomic_xchg(&rq->state, REQ_NOT_STARTED);\n"
+ "+\tif (prev != REQ_NOT_STARTED) {\n"
+ "\302\240\t\tif (q->dma_drain_size && blk_rq_bytes(rq))\n"
+ "\302\240\t\t\trq->nr_phys_segments--;\n"
+ "\302\240\t}\n"
+ "@@ -661,17 +657,7 @@ void blk_mq_rq_timed_out(struct request *req, bool reserved)\n"
+ "\302\240\tconst struct blk_mq_ops *ops = req->q->mq_ops;\n"
+ "\302\240\tenum blk_eh_timer_return ret = BLK_EH_RESET_TIMER;\n"
+ "\302\240\n"
  "-\t/*\n"
- "-\t=A0* We know that complete is set at this point. If STARTED isn't set\n"
- "-\t=A0* anymore, then the request isn't active and the \"timeout\" should\n"
- "-\t=A0* just be ignored. This can happen due to the bitflag ordering.\n"
- "-\t=A0* Timeout first checks if STARTED is set, and if it is, assumes\n"
- "-\t=A0* the request is active. But if we race with completion, then\n"
- "-\t=A0* we both flags will get cleared. So check here again, and ignore\n"
- "-\t=A0* a timeout event with a request that isn't active.\n"
- "-\t=A0*/\n"
+ "-\t\302\240* We know that complete is set at this point. If STARTED isn't set\n"
+ "-\t\302\240* anymore, then the request isn't active and the \"timeout\" should\n"
+ "-\t\302\240* just be ignored. This can happen due to the bitflag ordering.\n"
+ "-\t\302\240* Timeout first checks if STARTED is set, and if it is, assumes\n"
+ "-\t\302\240* the request is active. But if we race with completion, then\n"
+ "-\t\302\240* we both flags will get cleared. So check here again, and ignore\n"
+ "-\t\302\240* a timeout event with a request that isn't active.\n"
+ "-\t\302\240*/\n"
  "-\tif (!test_bit(REQ_ATOM_STARTED, &req->atomic_flags))\n"
  "-\t\treturn;\n"
- "+\tWARN_ON_ONCE(atomic_read(&req->state) !=3D REQ_COMPLETE);\n"
- "=A0\n"
- "=A0\tif (ops->timeout)\n"
- "=A0\t\tret =3D ops->timeout(req, reserved);\n"
- "@@ -682,7 +668,7 @@ void blk_mq_rq_timed_out(struct request *req, bool rese=\n"
- "rved)\n"
- "=A0\t\tbreak;\n"
- "=A0\tcase BLK_EH_RESET_TIMER:\n"
- "=A0\t\tblk_add_timer(req);\n"
+ "+\tWARN_ON_ONCE(atomic_read(&req->state) != REQ_COMPLETE);\n"
+ "\302\240\n"
+ "\302\240\tif (ops->timeout)\n"
+ "\302\240\t\tret = ops->timeout(req, reserved);\n"
+ "@@ -682,7 +668,7 @@ void blk_mq_rq_timed_out(struct request *req, bool reserved)\n"
+ "\302\240\t\tbreak;\n"
+ "\302\240\tcase BLK_EH_RESET_TIMER:\n"
+ "\302\240\t\tblk_add_timer(req);\n"
  "-\t\tblk_clear_rq_complete(req);\n"
  "+\t\tatomic_set(&req->state, REQ_STARTED);\n"
- "=A0\t\tbreak;\n"
- "=A0\tcase BLK_EH_NOT_HANDLED:\n"
- "=A0\t\tbreak;\n"
- "@@ -692,27 +678,24 @@ void blk_mq_rq_timed_out(struct request *req, bool re=\n"
- "served)\n"
- "=A0\t}\n"
- "=A0}\n"
- "=A0\n"
+ "\302\240\t\tbreak;\n"
+ "\302\240\tcase BLK_EH_NOT_HANDLED:\n"
+ "\302\240\t\tbreak;\n"
+ "@@ -692,27 +678,24 @@ void blk_mq_rq_timed_out(struct request *req, bool reserved)\n"
+ "\302\240\t}\n"
+ "\302\240}\n"
+ "\302\240\n"
  "+/*\n"
  "+ * Check whether or not a request has expired. This function can execute\n"
- "+ * concurrently with other functions that change the request state. This c=\n"
- "an\n"
+ "+ * concurrently with other functions that change the request state. This can\n"
  "+ * result in returning a deadline (blk_mq_timeout_data.next) that occurs\n"
  "+ * before a request times out. However, this is harmless because the next\n"
  "+ * call of blk_mq_queue_tag_busy_iter(q, blk_mq_check_expired, &data) will\n"
  "+ * yield the correct timeout, unless the same race occurs again.\n"
  "+ */\n"
- "=A0static void blk_mq_check_expired(struct blk_mq_hw_ctx *hctx,\n"
- "=A0\t\tstruct request *rq, void *priv, bool reserved)\n"
- "=A0{\n"
- "=A0\tstruct blk_mq_timeout_data *data =3D priv;\n"
- "=A0\n"
+ "\302\240static void blk_mq_check_expired(struct blk_mq_hw_ctx *hctx,\n"
+ "\302\240\t\tstruct request *rq, void *priv, bool reserved)\n"
+ "\302\240{\n"
+ "\302\240\tstruct blk_mq_timeout_data *data = priv;\n"
+ "\302\240\n"
  "-\tif (!test_bit(REQ_ATOM_STARTED, &rq->atomic_flags)) {\n"
  "-\t\t/*\n"
- "-\t\t=A0* If a request wasn't started before the queue was\n"
- "-\t\t=A0* marked dying, kill it here or it'll go unnoticed.\n"
- "-\t\t=A0*/\n"
+ "-\t\t\302\240* If a request wasn't started before the queue was\n"
+ "-\t\t\302\240* marked dying, kill it here or it'll go unnoticed.\n"
+ "-\t\t\302\240*/\n"
  "-\t\tif (unlikely(blk_queue_dying(rq->q))) {\n"
- "-\t\t\trq->errors =3D -EIO;\n"
+ "-\t\t\trq->errors = -EIO;\n"
  "-\t\t\tblk_mq_end_request(rq, rq->errors);\n"
  "-\t\t}\n"
  "-\t\treturn;\n"
@@ -234,50 +216,49 @@
  "-\t\t\tblk_mq_rq_timed_out(rq, reserved);\n"
  "-\t} else if (!data->next_set || time_after(data->next, rq->deadline)) {\n"
  "+\tif (time_after_eq(jiffies, rq->deadline) &&\n"
- "+\t=A0=A0=A0=A0!blk_mark_rq_complete_if_started(rq)) {\n"
+ "+\t\302\240\302\240\302\240\302\240!blk_mark_rq_complete_if_started(rq)) {\n"
  "+\t\tblk_mq_rq_timed_out(rq, reserved);\n"
  "+\t} else if ((!data->next_set || time_after(data->next, rq->deadline)) &&\n"
- "+\t\t=A0=A0=A0blk_mq_request_started(rq)) {\n"
- "=A0\t\tdata->next =3D rq->deadline;\n"
- "=A0\t\tdata->next_set =3D 1;\n"
- "=A0\t}\n"
- "@@ -2821,7 +2804,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_q=\n"
- "ueue *q,\n"
- "=A0\n"
- "=A0\thrtimer_init_sleeper(&hs, current);\n"
- "=A0\tdo {\n"
+ "+\t\t\302\240\302\240\302\240blk_mq_request_started(rq)) {\n"
+ "\302\240\t\tdata->next = rq->deadline;\n"
+ "\302\240\t\tdata->next_set = 1;\n"
+ "\302\240\t}\n"
+ "@@ -2821,7 +2804,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,\n"
+ "\302\240\n"
+ "\302\240\thrtimer_init_sleeper(&hs, current);\n"
+ "\302\240\tdo {\n"
  "-\t\tif (test_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags))\n"
- "+\t\tif (atomic_read(&rq->state) =3D=3D REQ_COMPLETE)\n"
- "=A0\t\t\tbreak;\n"
- "=A0\t\tset_current_state(TASK_UNINTERRUPTIBLE);\n"
- "=A0\t\thrtimer_start_expires(&hs.timer, mode);\n"
+ "+\t\tif (atomic_read(&rq->state) == REQ_COMPLETE)\n"
+ "\302\240\t\t\tbreak;\n"
+ "\302\240\t\tset_current_state(TASK_UNINTERRUPTIBLE);\n"
+ "\302\240\t\thrtimer_start_expires(&hs.timer, mode);\n"
  "diff --git a/block/blk-timeout.c b/block/blk-timeout.c\n"
  "index a30441a200c0..9a8b44ebfb99 100644\n"
  "--- a/block/blk-timeout.c\n"
  "+++ b/block/blk-timeout.c\n"
  "@@ -94,7 +94,7 @@ static void blk_rq_timed_out(struct request *req)\n"
- "=A0\t\tbreak;\n"
- "=A0\tcase BLK_EH_RESET_TIMER:\n"
- "=A0\t\tblk_add_timer(req);\n"
+ "\302\240\t\tbreak;\n"
+ "\302\240\tcase BLK_EH_RESET_TIMER:\n"
+ "\302\240\t\tblk_add_timer(req);\n"
  "-\t\tblk_clear_rq_complete(req);\n"
  "+\t\tatomic_set(&req->state, REQ_NOT_STARTED);\n"
- "=A0\t\tbreak;\n"
- "=A0\tcase BLK_EH_NOT_HANDLED:\n"
- "=A0\t\t/*\n"
+ "\302\240\t\tbreak;\n"
+ "\302\240\tcase BLK_EH_NOT_HANDLED:\n"
+ "\302\240\t\t/*\n"
  "diff --git a/block/blk.h b/block/blk.h\n"
  "index d1ea4bd9b9a3..8af5fe21e85f 100644\n"
  "--- a/block/blk.h\n"
  "+++ b/block/blk.h\n"
  "@@ -115,23 +115,32 @@ void blk_account_io_done(struct request *req);\n"
- "=A0 * Internal atomic flags for request handling\n"
- "=A0 */\n"
- "=A0enum rq_atomic_flags {\n"
- "-\tREQ_ATOM_COMPLETE =3D 0,\n"
+ "\302\240 * Internal atomic flags for request handling\n"
+ "\302\240 */\n"
+ "\302\240enum rq_atomic_flags {\n"
+ "-\tREQ_ATOM_COMPLETE = 0,\n"
  "-\tREQ_ATOM_STARTED,\n"
- "=A0\tREQ_ATOM_POLL_SLEPT,\n"
- "=A0};\n"
- "=A0\n"
- "=A0/*\n"
+ "\302\240\tREQ_ATOM_POLL_SLEPT,\n"
+ "\302\240};\n"
+ "\302\240\n"
+ "\302\240/*\n"
  "+ * Request states. Note: REQ_STARTED is only used by the blk-mq code.\n"
  "+ */\n"
  "+enum rq_state {\n"
@@ -287,54 +268,52 @@
  "+};\n"
  "+\n"
  "+/*\n"
- "=A0 * EH timer and IO completion will both attempt to 'grab' the request, m=\n"
- "ake\n"
+ "\302\240 * EH timer and IO completion will both attempt to 'grab' the request, make\n"
  "- * sure that only one of them succeeds\n"
  "+ * sure that only one of them succeeds. The return value 0 means that this\n"
  "+ * function changed the request state from \"not complete\" into \"complete\".\n"
- "=A0 */\n"
- "=A0static inline int blk_mark_rq_complete(struct request *rq)\n"
- "=A0{\n"
+ "\302\240 */\n"
+ "\302\240static inline int blk_mark_rq_complete(struct request *rq)\n"
+ "\302\240{\n"
  "-\treturn test_and_set_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags);\n"
- "+\treturn atomic_xchg(&rq->state, REQ_COMPLETE) =3D=3D REQ_COMPLETE;\n"
- "=A0}\n"
- "=A0\n"
+ "+\treturn atomic_xchg(&rq->state, REQ_COMPLETE) == REQ_COMPLETE;\n"
+ "\302\240}\n"
+ "\302\240\n"
  "-static inline void blk_clear_rq_complete(struct request *rq)\n"
  "+static inline int blk_mark_rq_complete_if_started(struct request *rq)\n"
- "=A0{\n"
+ "\302\240{\n"
  "-\tclear_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags);\n"
- "+\treturn atomic_cmpxchg(&rq->state, REQ_STARTED, REQ_COMPLETE) !=3D\n"
+ "+\treturn atomic_cmpxchg(&rq->state, REQ_STARTED, REQ_COMPLETE) !=\n"
  "+\t\tREQ_STARTED;\n"
- "=A0}\n"
- "=A0\n"
- "=A0/*\n"
+ "\302\240}\n"
+ "\302\240\n"
+ "\302\240/*\n"
  "diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c\n"
  "index 939c47df73fa..136379097131 100644\n"
  "--- a/drivers/scsi/virtio_scsi.c\n"
  "+++ b/drivers/scsi/virtio_scsi.c\n"
- "@@ -672,7 +672,7 @@ static int virtscsi_tmf(struct virtio_scsi *vscsi, stru=\n"
- "ct virtio_scsi_cmd *cmd)\n"
- "=A0\t=A0*\n"
- "=A0\t=A0* In the abort case, sc->scsi_done will do nothing, because\n"
- "=A0\t=A0* the block layer must have detected a timeout and as a result\n"
- "-\t=A0* REQ_ATOM_COMPLETE has been set.\n"
- "+\t=A0* rq->state =3D=3D REQ_COMPLETED.\n"
- "=A0\t=A0*/\n"
- "=A0\tvirtscsi_poll_requests(vscsi);\n"
- "=A0\n"
+ "@@ -672,7 +672,7 @@ static int virtscsi_tmf(struct virtio_scsi *vscsi, struct virtio_scsi_cmd *cmd)\n"
+ "\302\240\t\302\240*\n"
+ "\302\240\t\302\240* In the abort case, sc->scsi_done will do nothing, because\n"
+ "\302\240\t\302\240* the block layer must have detected a timeout and as a result\n"
+ "-\t\302\240* REQ_ATOM_COMPLETE has been set.\n"
+ "+\t\302\240* rq->state == REQ_COMPLETED.\n"
+ "\302\240\t\302\240*/\n"
+ "\302\240\tvirtscsi_poll_requests(vscsi);\n"
+ "\302\240\n"
  "diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h\n"
  "index 5a7da607ca04..b286887b095e 100644\n"
  "--- a/include/linux/blkdev.h\n"
  "+++ b/include/linux/blkdev.h\n"
  "@@ -142,6 +142,7 @@ struct request {\n"
- "=A0\n"
- "=A0\tint internal_tag;\n"
- "=A0\n"
+ "\302\240\n"
+ "\302\240\tint internal_tag;\n"
+ "\302\240\n"
  "+\tatomic_t state;\n"
- "=A0\tunsigned long atomic_flags;\n"
- "=A0\n"
- "=A0\t/* the following two fields are internal, NEVER access directly */\n"
- "--=A0\n"
+ "\302\240\tunsigned long atomic_flags;\n"
+ "\302\240\n"
+ "\302\240\t/* the following two fields are internal, NEVER access directly */\n"
+ "--\302\240\n"
  2.12.0
 
-ca8e4e91c50c29dc5c1c31fd03d9d8be0fb7e78b873cb8bd407788b16e24ae39
+c84f9b118b156912157610dddf95cc34cdf48e3a9f3b8d0aaf40da900ae1d4a7

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.