Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp616578img; Mon, 18 Mar 2019 10:19:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGXGCpE4t+FhS/KStSS3a6EZo8TGQgoz17ARDeArjnSPVWxtaSAQJ9djfe5JmpuOpK4pzz X-Received: by 2002:a63:e915:: with SMTP id i21mr665304pgh.297.1552929573053; Mon, 18 Mar 2019 10:19:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552929573; cv=none; d=google.com; s=arc-20160816; b=ngHXn3RPhqrvxc43eMJtwVkzFqmOvuLd7+bLYNxsIP0M65G9z30qgbpItrM2YjhjkU FYHNdyIGSKE5BLFkxcqaLE42xusRViPqHZrRCN5CyS46ICWnMZjKx0JncYHdb4h1NRFu Sk/6USuSM6z2Qp2Y2t2ObHaRJKAAdlYSEEtjP9UlBk28RxoakkPEtcYadA6e0k8sBEZk 7WsN1/mXCkMpxaMecUH64SyA3/UFALSLvwTKfLfHT7t/liUTEe1+3TD+s7M3kSl10CgO VQR4SD+wv/l0pWZBUUijaVDvXEJIPgO+TCqLItRonOyzUPQC24rvpsFnzyluO5w3ExB6 dBVA== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=V4E1evcqLqxZDwrDpf1S27x2FhHzdkvtC33qAjLzojw=; b=KXpZ6k6VoGJdrMS+9XvD4TWS53QPiN64v8M2JJV6i9QQ3DrBzBj6C0fUl4pglOiZR8 mhbq+Yu20wwIxCmOpgewAMDt5Azp67rhw626GFyW2rYW1/tcrzVGQ4PfW2iojGbRDj7u acgkfhVqYjurW+t/WJoKfWDAGxGhhjmovR+UFmqStaHojWmRWtYUXkCmr59KOqKVuu6+ 6zbbPvXSOgoUIPdZ66bPzQGF2sQGu9yINDazatxvgkk2rfppy8oEMmn1t7yTHxG8M20T kEPhqy8hkcuPKF8kSwt1yT9TzWXlxgZfAKfRbnxwak7A3hH8VE6fyDk2HGGh68IHGz+Y hTuA== ARC-Authentication-Results: i=1; mx.google.com; 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 b9si602154pgf.596.2019.03.18.10.19.17; Mon, 18 Mar 2019 10:19:33 -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; 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 S1727658AbfCRRQ1 (ORCPT + 99 others); Mon, 18 Mar 2019 13:16:27 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:46648 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726765AbfCRRQ1 (ORCPT ); Mon, 18 Mar 2019 13:16:27 -0400 Received: by mail-pg1-f194.google.com with SMTP id a22so11805562pgg.13; Mon, 18 Mar 2019 10:16:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=V4E1evcqLqxZDwrDpf1S27x2FhHzdkvtC33qAjLzojw=; b=k70YN2MjuvxTsPlE+Ntb4dm/K0jBmhHpFBds3jpqqLYMrCFz3yk/1FLMyHcSZiV+fa gX1ukPmpLrEfSHv+CjjahlsgpICTBVcgNvnekY1TRsi33srN4NPOR1sDbgeCE01Fka99 BGD8pI8oYJP++elbbuNdnfAc099sVtbWMxGT+NYO9Vbutf0d83r1W5RSQqtZrr8b4Nmz FtLwsHuyf6Z7cCugWsglxSFQWFgfsGAEA9LhxMuUCPB0yGu10glfCwYe3oFEc5KchJbh kbYNzFr+ELqjdls2GPwJT6onJOWMoUxtcbiOa6vDqjwws/9Ejv0NRRcJsOxmXPTm0K8Z 9OtA== X-Gm-Message-State: APjAAAWkfOaEd2opYf1CddOaKJqN/MYcZL1xxuSp24iHRo1c6Ydzc1f1 PpXSmDVT9yLvyOP4EXwy4es1QadJo1w= X-Received: by 2002:a65:6210:: with SMTP id d16mr18684648pgv.189.1552929386882; Mon, 18 Mar 2019 10:16:26 -0700 (PDT) Received: from ?IPv6:2620:15c:2cd:203:5cdc:422c:7b28:ebb5? ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id z6sm47644372pgo.31.2019.03.18.10.16.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Mar 2019 10:16:25 -0700 (PDT) Message-ID: <1552929384.152266.27.camel@acm.org> Subject: Re: [PATCH 5/8] nbd: use blk_mq_queue_tag_busy_iter From: Bart Van Assche To: Jianchao Wang , axboe@kernel.dk Cc: hch@lst.de, jthumshirn@suse.de, hare@suse.de, josef@toxicpanda.com, sagi@grimberg.me, keith.busch@intel.com, jsmart2021@gmail.com, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Date: Mon, 18 Mar 2019 10:16:24 -0700 In-Reply-To: <1552640264-26101-6-git-send-email-jianchao.w.wang@oracle.com> References: <1552640264-26101-1-git-send-email-jianchao.w.wang@oracle.com> <1552640264-26101-6-git-send-email-jianchao.w.wang@oracle.com> Content-Type: text/plain; charset="UTF-7" X-Mailer: Evolution 3.26.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-03-15 at 16:57 +-0800, Jianchao Wang wrote: +AD4 blk+AF8-mq+AF8-tagset+AF8-busy+AF8-iter is not safe that it could get stale request +AD4 in tags-+AD4-rqs+AFsAXQ. Use blk+AF8-mq+AF8-queue+AF8-tag+AF8-busy+AF8-iter here. +AD4 +AD4 Signed-off-by: Jianchao Wang +ADw-jianchao.w.wang+AEA-oracle.com+AD4 +AD4 --- +AD4 drivers/block/nbd.c +AHw 2 +- +AD4 1 file changed, 1 insertion(), 1 deletion(-) +AD4 +AD4 diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c +AD4 index 7c9a949..9e7e828 100644 +AD4 --- a/drivers/block/nbd.c +AD4 +-+-+- b/drivers/block/nbd.c +AD4 +AEAAQA -747,7 +-747,7 +AEAAQA static bool nbd+AF8-clear+AF8-req(struct request +ACo-req, void +ACo-data, bool reserved) +AD4 static void nbd+AF8-clear+AF8-que(struct nbd+AF8-device +ACo-nbd) +AD4 +AHs +AD4 blk+AF8-mq+AF8-quiesce+AF8-queue(nbd-+AD4-disk-+AD4-queue)+ADs +AD4 - blk+AF8-mq+AF8-tagset+AF8-busy+AF8-iter(+ACY-nbd-+AD4-tag+AF8-set, nbd+AF8-clear+AF8-req, NULL)+ADs +AD4 +- blk+AF8-mq+AF8-queue+AF8-tag+AF8-busy+AF8-iter(nbd-+AD4-disk-+AD4-queue, nbd+AF8-clear+AF8-req, NULL, true)+ADs +AD4 blk+AF8-mq+AF8-unquiesce+AF8-queue(nbd-+AD4-disk-+AD4-queue)+ADs +AD4 dev+AF8-dbg(disk+AF8-to+AF8-dev(nbd-+AD4-disk), +ACI-queue cleared+AFw-n+ACI)+ADs +AD4 +AH0 Hi Jianchao, The nbd driver calls nbd+AF8-clear+AF8-que() after having called sock+AF8-shutdown(). So what makes you think that it's not safe to call blk+AF8-mq+AF8-tagset+AF8-busy+AF8-iter() from nbd+AF8-clear+AF8-que()? Thanks, Bart.