Unverified Commit 46b93d6d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents a5fe3270 90578327
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -169,6 +169,17 @@ static void nbd_requeue_cmd(struct nbd_cmd *cmd)
{
	struct request *req = blk_mq_rq_from_pdu(cmd);

	lockdep_assert_held(&cmd->lock);

	/*
	 * Clear INFLIGHT flag so that this cmd won't be completed in
	 * normal completion path
	 *
	 * INFLIGHT flag will be set when the cmd is queued to nbd next
	 * time.
	 */
	__clear_bit(NBD_CMD_INFLIGHT, &cmd->flags);

	if (!test_and_set_bit(NBD_CMD_REQUEUED, &cmd->flags))
		blk_mq_requeue_request(req, true);
}
@@ -434,8 +445,8 @@ static enum blk_eh_timer_return nbd_xmit_timeout(struct request *req,
					nbd_mark_nsock_dead(nbd, nsock, 1);
				mutex_unlock(&nsock->tx_lock);
			}
			mutex_unlock(&cmd->lock);
			nbd_requeue_cmd(cmd);
			mutex_unlock(&cmd->lock);
			nbd_config_put(nbd);
			return BLK_EH_DONE;
		}