Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753290AbdGGNqN (ORCPT ); Fri, 7 Jul 2017 09:46:13 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:43282 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752933AbdGGNqJ (ORCPT ); Fri, 7 Jul 2017 09:46:09 -0400 From: Stefan Haberland To: axboe@fb.com Cc: linux-kernel@vger.kernel.org Subject: blk-mq timeout question Date: Fri, 7 Jul 2017 15:45:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-TM-AS-GCONF: 00 x-cbid: 17070713-0020-0000-0000-0000039C70C3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17070713-0021-0000-0000-0000421FF115 Message-Id: <97ae004d-e5ec-8197-ee1d-1770c931f46a@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-07_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1707070225 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 643 Lines: 20 While changing the DASD device driver to use the blk-mq interfaces I found the following unexpected behavior: In case of a timeout our complete callback is never called. Here is the sequence of events as I understood: - timeout occurs - blk_mq_check_expired() calls and checks blk_mark_rq_complete() - our .timeout callback is called which returns BLK_EH_NOT_HANDLED and schedules delayed work - our worker calls blk_mq_complete_request() - this also checks blk_mark_rq_complete() and therefore never calls our complete callback Question: Should blk_clear_rq_complete() also be called for the BLK_EH_NOT_HANDLED case? Regards, Stefan