Received: by 10.192.165.156 with SMTP id m28csp1387308imm; Mon, 16 Apr 2018 20:57:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/aN5SIGLgjl8UlhPtJjqeKuYnk1wlxsC4dFWqB9UWtO6gRwsyR71WLmrmIgps+CFhR9WcD X-Received: by 10.99.158.2 with SMTP id s2mr460559pgd.48.1523937467706; Mon, 16 Apr 2018 20:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523937467; cv=none; d=google.com; s=arc-20160816; b=lqaouxEV7vNGMVfy5b1+jJ0e/S3ejLuVTSr44xiUaU/wTZVB0B6ojiHd4YVeRifpTU i5mwlJG93ZmozzXKiLz35oLeonTlmhNiz1s0XApHEB/Ux0fch2puzokyKqZfhpfMjZS3 IXn39AYvvxyR1pxYPyK6PXmNN6XrpWK8Cdk+wPYzi+YscA9a5NIYWbjlEvtUR7YQoLrv 67iueMV8b0FEtnweDmhZ6wvR53ka5jBI5wLXwnqMrIK1J+tABu/2IRyJsPVbxkfZ2kl5 0VErg3t47oZMjoXgrY/a7awkszWMIvYKMqd0qLlEP8Z7lsq28ZO6bLMyxBFQ9KLOHO2O NE7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=BiUKmaEmts5jmpw3AbkILth2y4y21CzOhvl9jhFcIUI=; b=ep6EW3nZZbK0h0hGkcbpJQXZTMOeWvddi2qkCrnmuBeafKgN8PMRvUU+/y8pWg49yK udzIlQkpu/ba/ocdgaDsxMhlgMEhUd8j+zQck/UUQX9VVfRal6f4FW6+RIA7KYUuWOQq pc2uPQISxAX7fMEY2ks1OVGx27ejhk1kTx0rGSdXXzOA5dS2SJq8NxxNp3D1snZGklLK 0KgNT+R/o9I1pDOvkV1t12JQzykSsFpQ83aaZk3i8HAkagIzVfSQ3V3SNj0Az7k6lg+k zwwQd425JfvuLGG9H7tATCK7YUmM+OruEjH+giESTk/WpirIea7dHwiQBq8IDXN1Z/4o aLfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=MJpVO6YP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s10-v6si14025615plq.240.2018.04.16.20.57.32; Mon, 16 Apr 2018 20:57:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=MJpVO6YP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752177AbeDQD40 (ORCPT + 99 others); Mon, 16 Apr 2018 23:56:26 -0400 Received: from mail-pl0-f45.google.com ([209.85.160.45]:34154 "EHLO mail-pl0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751840AbeDQD4Y (ORCPT ); Mon, 16 Apr 2018 23:56:24 -0400 Received: by mail-pl0-f45.google.com with SMTP id z12-v6so3768357plo.1 for ; Mon, 16 Apr 2018 20:56:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=BiUKmaEmts5jmpw3AbkILth2y4y21CzOhvl9jhFcIUI=; b=MJpVO6YP1M5dorgYYFyj7XPhTLOOyHV9UPXP7t2VAuOyiVd30mVwUDAzBC9D9j4T+n ZsFOVWI2Nf0ymMcGxI+zCpy1+nHLmp5d/l6u6gOvcwaO4X7wo6qe5XW9NdE+XpEXsb+U 6EBdHLxvcBwacRtfWsUVmV92gDFX8YecNG/DHCxzVZGB4PTnPk0SHHFTPsHF2QeKnFT6 68fBsa2d6VYR4u+fFeD14F5b4MtB9yzWEAKgL/yIsAZNfD1zejsseyzj2s7wFwwDc39y 7/z9fKNQBJw3uWpjl4CnJDaa0B3wZnGOe0wT+IbywbSEEbUg8v/5ew4OYZTEYOUWeYV4 aRnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BiUKmaEmts5jmpw3AbkILth2y4y21CzOhvl9jhFcIUI=; b=pkmIXqrEp5RrSR98tVe8qBRtAaxJF5gYgya00ei7cXP2VCtveT3hy2voo/UtMcR/3j 1EYbSNxj6+OZpFpfN2/OUWEX+cki4KNhgLzbohOmDWWh3Jckn+VZZOQ8d8uFAa6p0csw B3IKmE+MbN3iVHrzYN3sp9I8bs6dptOX8iGEN4MRmaJl+483RbzoRvoB3kwxAnHG66he GanqdGYyBCaqTnf91B3+1xP8eQlDbcyozmO1vyEDEKJxluB2ZQ8ieFhs1grkHGjujxYF l4Ha+/L7ayFOcDHPNSERymTZFC8Wj5sGplrc3nsDltqvDZYiwa0O4nbw1/8nZ8QOpKZi /j8g== X-Gm-Message-State: ALQs6tAxKRdbSRwKzCl/NLLWkdJiKttDBJOya9t1LkYJIbqwnFn9T81M o8pj9gAqwFObSTjrozJCky7lCBEGgbg= X-Received: by 2002:a17:902:264:: with SMTP id 91-v6mr478833plc.341.1523937383523; Mon, 16 Apr 2018 20:56:23 -0700 (PDT) Received: from [192.168.1.211] (107.191.0.158.static.utbb.net. [107.191.0.158]) by smtp.gmail.com with ESMTPSA id a22sm22370877pgw.10.2018.04.16.20.56.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 20:56:22 -0700 (PDT) Subject: Re: [PATCH] blk-mq: start request gstate with gen 1 To: Jianchao Wang Cc: bart.vanassche@wdc.com, tj@kernel.org, ming.lei@redhat.com, Martin@Lichtvoll.de, stable@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <1523936780-1589-1-git-send-email-jianchao.w.wang@oracle.com> From: Jens Axboe Message-ID: Date: Mon, 16 Apr 2018 21:56:20 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <1523936780-1589-1-git-send-email-jianchao.w.wang@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/16/18 9:46 PM, Jianchao Wang wrote: > rq->gstate and rq->aborted_gstate both are zero before rqs are > allocated. If we have a small timeout, when the timer fires, > there could be rqs that are never allocated, and also there could > be rq that has been allocated but not initialized and started. At > the moment, the rq->gstate and rq->aborted_gstate both are 0, thus > the blk_mq_terminate_expired will identify the rq is timed out and > invoke .timeout early. > > For scsi, this will cause scsi_times_out to be invoked before the > scsi_cmnd is not initialized, scsi_cmnd->device is still NULL at > the moment, then we will get crash. Oops, this looks good to me. Applied. -- Jens Axboe