From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753488AbdGJCYC (ORCPT ); Sun, 9 Jul 2017 22:24:02 -0400 Received: from mail-vk0-f52.google.com ([209.85.213.52]:35243 "EHLO mail-vk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753128AbdGJCYA (ORCPT ); Sun, 9 Jul 2017 22:24:00 -0400 MIME-Version: 1.0 In-Reply-To: <97ae004d-e5ec-8197-ee1d-1770c931f46a@linux.vnet.ibm.com> References: <97ae004d-e5ec-8197-ee1d-1770c931f46a@linux.vnet.ibm.com> From: Ming Lei Date: Mon, 10 Jul 2017 10:23:59 +0800 Message-ID: Subject: Re: blk-mq timeout question To: Stefan Haberland Cc: Jens Axboe , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 7, 2017 at 9:45 PM, Stefan Haberland wrote: > 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? >>From comment in blk_rq_timed_out(): case BLK_EH_NOT_HANDLED: /* * LLD handles this for now but in the future * we can send a request msg to abort the command * and we can move more of the generic scsi eh code to * the blk layer. Looks you can/should handle the case inside DASD, and not do that in blk layer. -- Ming Lei