From patchwork Thu Apr 19 20:04:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10351557 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3FA2E60231 for ; Thu, 19 Apr 2018 20:05:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31A86284FC for ; Thu, 19 Apr 2018 20:05:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2669C28515; Thu, 19 Apr 2018 20:05:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0512284FC for ; Thu, 19 Apr 2018 20:05:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753283AbeDSUFP (ORCPT ); Thu, 19 Apr 2018 16:05:15 -0400 Received: from mail-io0-f178.google.com ([209.85.223.178]:38039 "EHLO mail-io0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752558AbeDSUFP (ORCPT ); Thu, 19 Apr 2018 16:05:15 -0400 Received: by mail-io0-f178.google.com with SMTP id h9-v6so8037209iob.5 for ; Thu, 19 Apr 2018 13:05:15 -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=fCeGCKPk7OrQ2ol0znUrX7SvsqgIn1ecxrsM6Lj9UYw=; b=mtJwUbDBIUOT7T4lmhPqZyasH7UlpU6hOnvCdVh1Ql3IEljb5Z/0MX6XlKYyzGWViN zf6iWsWD30uVZz9qnCgdvFnnwclLbb8Kf2ik9Q57R2UUji9f+93RJNIXyXZ1N2G+EURY zJbK8S/5sG6tEwu00Bju6gsDCAY1oKfLIgfRdPC3XRwNylomE6F//89CK7LAOS7xEH+k 1pAlCT/+raJnYgxvpBzko3MHd1sXvm4uByYcJsohjclghg4sGIpisff8O7Taa63uJLNP afdjw/vq5V7DkG5kT4csRVFI/HWbeQPr5k8dKnBSvbaxaojqrZP8sShtPF5ApkOPXLAd YvEQ== 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=fCeGCKPk7OrQ2ol0znUrX7SvsqgIn1ecxrsM6Lj9UYw=; b=oAiWBavo/eNR07tvDAjATGOA3Dk9VaJl6pRXylS/wbkdaDtq1xHz05HhKVaS2eJFB2 cu1PTUDHwpkjKxKMjWDs11lJ7kI3pkBHOJN1/Mh+a48CEUmcM762ebnvyEARowKzn0FL EDVbNuGOw5tGodVRWXKyWcZRSH8A9ynr2ZYvjD7RLcTEeIMF8sNxSC0ySxUV+0T8TU0B WoX4M77aACUxaR9BVsQ+9uhHox2twI4GOiJc1jQaJPYNX2gBIyyLwNhCHyh9Vls2wxds mx2KjqCEE/W5O+8BjvyP6ZInnAkQ1G3RqpuWQgmuTSKsJulbeVszDjdT3cbQ3F09annh 4c2w== X-Gm-Message-State: ALQs6tAPI61JrR8ww+dM8agr3lZT5O34zuCcTxi741H4GSfaNCPQfD38 cNrNxuvRsNKcnzSugy1RAO5aHA== X-Google-Smtp-Source: AB8JxZq2DHOPgpBz7OygeZbsqBTYmCS0Ut/COWlSVnasA2jMYbZ4hp1NWgF3VU0EUzxbRZ/vT0zjvg== X-Received: by 2002:a6b:a08f:: with SMTP id j137-v6mr8256712ioe.23.1524168305445; Thu, 19 Apr 2018 13:05:05 -0700 (PDT) Received: from [192.168.1.167] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id d85-v6sm2533633itb.23.2018.04.19.13.04.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 13:04:58 -0700 (PDT) Subject: Re: [PATCH blktests] scsi/004: add regression test for false BLK_STS_OK with non good SAM status To: Omar Sandoval , Steffen Maier Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, Omar Sandoval , Johannes Thumshirn , Bart Van Assche , Hannes Reinecke , Douglas Gilbert , Damien Le Moal , Christoph Hellwig , Lee Duncan References: <1523955817-15790-1-git-send-email-maier@linux.ibm.com> <20180419185330.GA20941@vader> <20180419191320.GB20941@vader> From: Jens Axboe Message-ID: <2f661ad2-ecbd-0fdf-6188-4f900f539504@kernel.dk> Date: Thu, 19 Apr 2018 14:04:56 -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: <20180419191320.GB20941@vader> Content-Language: en-US Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 4/19/18 1:13 PM, Omar Sandoval wrote: > On Thu, Apr 19, 2018 at 11:53:30AM -0700, Omar Sandoval wrote: >> Thanks for the test! Applied. > > Side note, it's unfortunate that this test takes 180 seconds to run only > because we have to wait for the command timeout. We should be able to > export request_queue->rq_timeout writeable in sysfs. Would you be > interested in doing that? Here's one, I even tested it. diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index d00d1b0ec109..d5d628c3c12d 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -496,6 +496,27 @@ static ssize_t queue_dax_show(struct request_queue *q, char *page) return queue_var_show(blk_queue_dax(q), page); } +static ssize_t queue_timeout_show(struct request_queue *q, char *page) +{ + return sprintf(page, "%u\n", q->rq_timeout / HZ); +} + +static ssize_t queue_timeout_store(struct request_queue *q, const char *page, + size_t count) +{ + unsigned long timeout; + ssize_t ret; + + ret = queue_var_store(&timeout, page, count); + if (ret < 0) + return ret; + if (!timeout) + return -EINVAL; + + blk_queue_rq_timeout(q, timeout * HZ); + return count; +} + static struct queue_sysfs_entry queue_requests_entry = { .attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR }, .show = queue_requests_show, @@ -678,6 +699,12 @@ static struct queue_sysfs_entry throtl_sample_time_entry = { }; #endif +static struct queue_sysfs_entry queue_timeout_entry = { + .attr = {.name = "timeout", .mode = S_IRUGO | S_IWUSR }, + .show = queue_timeout_show, + .store = queue_timeout_store, +}; + static struct attribute *default_attrs[] = { &queue_requests_entry.attr, &queue_ra_entry.attr, @@ -714,6 +741,7 @@ static struct attribute *default_attrs[] = { #ifdef CONFIG_BLK_DEV_THROTTLING_LOW &throtl_sample_time_entry.attr, #endif + &queue_timeout_entry.attr, NULL, };